12 #include <mrpt/config.h>
30 std::unique_ptr<T>
ptr;
46 #define PIMPL_FORWARD_DECLARATION(_TYPE) _TYPE
48 #define PIMPL_DECLARE_TYPE(_TYPE, _VAR_NAME) mrpt::utils::pimpl<_TYPE> _VAR_NAME
51 #define PIMPL_IMPLEMENT(_TYPE) \
57 pimpl<_TYPE>::pimpl() : ptr() \
61 pimpl<_TYPE>::~pimpl() \
66 pimpl<_TYPE>::pimpl(pimpl<_TYPE>&& op) noexcept : ptr(std::move(op.ptr)) \
70 pimpl<_TYPE>& pimpl<_TYPE>::operator=(pimpl<_TYPE>&& op) noexcept \
72 ptr = std::move(op.ptr); \
77 pimpl<_TYPE>::pimpl(const pimpl<_TYPE>& op) \
79 if (op.ptr.get() == ptr.get()) return; \
80 ptr.reset(new _TYPE()); \
84 pimpl<_TYPE>& pimpl<_TYPE>::operator=(const pimpl<_TYPE>& op) \
86 if (op.ptr.get() == ptr.get()) return *this; \
87 ptr.reset(new _TYPE()); \
95 #define PIMPL_CONSTRUCT(_TYPE, _VAR_NAME) _VAR_NAME.ptr.reset(new _TYPE())
97 #define PIMPL_GET_PTR(_TYPE, _VAR_NAME) _VAR_NAME.ptr.get()
98 #define PIMPL_GET_REF(_TYPE, _VAR_NAME) (*_VAR_NAME.ptr.get())
99 #define PIMPL_GET_CONSTREF(_TYPE, _VAR_NAME) (*_VAR_NAME.ptr.get())
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Pointer to IMPLementation auxiliary structure to make raw pointers movable, copiable and automaticall...
pimpl & operator=(const pimpl &op)
pimpl(pimpl &&op) noexcept
pimpl & operator=(pimpl &&op) noexcept