Go to the documentation of this file.
31 m_smartptr.reset(
dynamic_cast<typename T::element_type*
>(ptr->clone()));
39 dynamic_cast<typename T::element_type*
>(o.
m_smartptr->clone()));
43 if (
this == &o)
return *
this;
45 dynamic_cast<typename T::element_type*
>(o.
m_smartptr->clone()));
51 dynamic_cast<typename T::element_type*
>(o_ptr->clone()));
63 if (
this == &o)
return *
this;
69 typename T::element_type*
get()
74 throw std::runtime_error(
"dereferencing nullptr poly_ptr");
76 const typename T::element_type*
get()
const
81 throw std::runtime_error(
"dereferencing nullptr poly_ptr");
87 const typename T::element_type&
operator*()
const {
return *
get(); }
88 operator bool()
const {
return m_smartptr ? true :
false; }
deepcopy_poly_ptr(deepcopy_poly_ptr &&o)
move ctor
deepcopy_poly_ptr< T > & operator=(const deepcopy_poly_ptr< T > &o)
deepcopy_poly_ptr(const T &ptr)
Ctor from a smart pointer; makes deep copy.
const T::element_type & operator*() const
T::element_type & operator*(void)
deepcopy_poly_ptr< T > & operator=(deepcopy_poly_ptr< T > &&o)
move operator
deepcopy_poly_ptr(const deepcopy_poly_ptr< T > &o)
copy ctor: makes a copy of the object via clone()
Wrapper to a std::shared_ptr<>, adding deep-copy semantics to copy ctor and copy operator,...
T::element_type * operator->()
bool operator!(void) const
const T::element_type * operator->() const
const T::element_type * get() const
deepcopy_poly_ptr< T > & operator=(const T &o_ptr)
deepcopy_poly_ptr()=default
Default ctor; init to nullptr.
const T & get_ptr() const
~deepcopy_poly_ptr()=default
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 29 13:06:46 UTC 2020 | |