Go to the documentation of this file.
18 #ifndef GZ_UTILS__IMPLPTR_HH_
19 #define GZ_UTILS__IMPLPTR_HH_
24 #include <gz/utils/config.hh>
25 #include <gz/utils/detail/DefaultOps.hh>
27 #include <gz/utils/Export.hh>
73 class Deleter = void (*)(T*),
74 class Operations = detail::CopyMoveDeleteOperations<T> >
85 public:
template <
class U,
class D,
class Ops>
86 ImplPtr(U *_ptr, D &&_deleter, Ops &&_ops);
112 public: T &operator*();
118 public:
const T &operator*()
const;
124 public: T *operator->();
130 public:
const T *operator->()
const;
142 public:
const T *Get()
const;
152 private:
ImplPtr Clone()
const;
158 private: Operations ops;
184 template <
class T,
typename... Args>
201 template <
class T,
class Deleter =
void (*)(T*)>
227 template <
class T,
typename... Args>
234 #define IGN_UTILS_IMPL_PTR_FWD(ImplementationClass, memberName) \
235 IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING \
236 private: ::ignition::utils::ImplPtr<ImplementationClass> memberName; \
237 IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
241 #define IGN_UTILS_UNIQUE_IMPL_PTR_FWD(ImplementationClass, memberName) \
242 IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING \
243 private: ::ignition::utils::UniqueImplPtr<ImplementationClass> memberName; \
244 IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
248 #define IGN_UTILS_IMPL_PTR(memberName) \
249 public: class Implementation; \
250 IGN_UTILS_IMPL_PTR_FWD(Implementation, memberName)
254 #define IGN_UTILS_UNIQUE_IMPL_PTR(memberName) \
255 public: class Implementation; \
256 IGN_UTILS_UNIQUE_IMPL_PTR_FWD(Implementation, memberName)
259 #include <gz/utils/detail/ImplPtr.hh>
261 #endif // GZ_UTILS__IMPLPTR_HH_
Definition: gz/utils/Environment.hh:26
UniqueImplPtr< T > MakeUniqueImpl(Args &&..._args)
Pass this to the constructor of a UniqueImplPtr object to easily initialize it. All the arguments pas...
The ImplPtr class provides a convenient away to achieve the Rule of Zero while keeping all the benefi...
Definition: gz/utils/ImplPtr.hh:75
ImplPtr< T > MakeImpl(Args &&..._args)
Pass this to the constructor of an ImplPtr object to easily initialize it. All the arguments passed i...