Template Class deepcopy_poly_ptr

Class Documentation

template<typename T>
class deepcopy_poly_ptr

Wrapper to a std::shared_ptr<>, adding deep-copy semantics to copy ctor and copy operator, suitable for polymorphic classes with a clone() method. Example use: deepcopy_poly_ptr<mrpt::poses::CPosePDF::Ptr>

See also

for non-virtual classes, see copy_ptr<T>

Public Functions

inline deepcopy_poly_ptr(const T &ptr)

Ctor from a smart pointer; makes deep copy.

deepcopy_poly_ptr() = default

Default ctor; init to nullptr.

inline deepcopy_poly_ptr(const deepcopy_poly_ptr<T> &o)

copy ctor: makes a copy of the object via clone()

inline deepcopy_poly_ptr<T> &operator=(const deepcopy_poly_ptr<T> &o)
inline deepcopy_poly_ptr<T> &operator=(const T &o_ptr)
inline deepcopy_poly_ptr(deepcopy_poly_ptr &&o)

move ctor

inline deepcopy_poly_ptr<T> &operator=(deepcopy_poly_ptr<T> &&o)

move operator

~deepcopy_poly_ptr() = default
inline T::element_type *get()
inline const T::element_type *get() const
inline T::element_type *operator->()
inline const T::element_type *operator->() const
inline T::element_type &operator*(void)
inline const T::element_type &operator*() const
inline operator bool() const
inline bool operator!(void) const
inline const T &get_ptr() const
inline T &get_ptr()
inline void reset()