Go to the documentation of this file.
33 m_smartptr.reset(
dynamic_cast<typename T::element_type*
>(ptr->clone()));
41 dynamic_cast<typename T::element_type*
>(o.
m_smartptr->clone()));
45 if (
this == &o)
return *
this;
47 dynamic_cast<typename T::element_type*
>(o.
m_smartptr->clone()));
53 dynamic_cast<typename T::element_type*
>(o_ptr->clone()));
65 if (
this == &o)
return *
this;
71 typename T::element_type*
get()
76 throw std::runtime_error(
"dereferencing nullptr poly_ptr");
78 const typename T::element_type*
get()
const
83 throw std::runtime_error(
"dereferencing nullptr poly_ptr");
89 const typename T::element_type&
operator*(
void)
const {
return *
get(); }
90 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)
const T::element_type & operator*(void) const
deepcopy_poly_ptr(const T &ptr)
Ctor from a smart pointer; makes deep copy.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
deepcopy_poly_ptr()
Default ctor; init to nullptr.
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)
const T & get_ptr() const
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |