12 #include <mrpt/config.h> 30 #if MRPT_HAS_UNIQUE_PTR 31 std::unique_ptr<T> ptr;
47 #define PIMPL_FORWARD_DECLARATION(_TYPE) _TYPE 49 #define PIMPL_DECLARE_TYPE(_TYPE, _VAR_NAME) mrpt::utils::pimpl<_TYPE> _VAR_NAME 52 #define PIMPL_IMPLEMENT(_TYPE) \ 53 namespace mrpt { namespace utils { \ 54 template <> pimpl<_TYPE>::pimpl() : ptr() {} \ 55 template <> pimpl<_TYPE>::~pimpl() {} \ 57 template <> pimpl<_TYPE>::pimpl(pimpl<_TYPE> && op) noexcept : ptr(std::move(op.ptr)) {} \ 58 template <> pimpl<_TYPE>& pimpl<_TYPE>::operator=(pimpl<_TYPE>&& op) noexcept { ptr = std::move(op.ptr); return *this; } \ 60 template <> pimpl<_TYPE>::pimpl(const pimpl<_TYPE> & op) { \ 61 if (op.ptr.get() == ptr.get()) return; \ 62 ptr.reset(new _TYPE(*op.ptr)); \ 64 template <> pimpl<_TYPE>& pimpl<_TYPE>::operator=(const pimpl<_TYPE>& op) { \ 65 if (op.ptr.get() == ptr.get()) return *this; \ 66 ptr.reset(new _TYPE(*op.ptr)); \ 72 #define PIMPL_CONSTRUCT(_TYPE,_VAR_NAME) _VAR_NAME.ptr.reset( new _TYPE()) 74 #define PIMPL_GET_PTR(_TYPE, _VAR_NAME) _VAR_NAME.ptr.get() 75 #define PIMPL_GET_REF(_TYPE, _VAR_NAME) (*_VAR_NAME.ptr.get()) 76 #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...