MRPT  1.9.9
List of all members | Public Member Functions | Private Attributes
mrpt::containers::deepcopy_poly_ptr< T > Class Template Reference

Detailed Description

template<typename T>
class mrpt::containers::deepcopy_poly_ptr< T >

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>

Definition at line 25 of file deepcopy_poly_ptr.h.

#include <mrpt/containers/deepcopy_poly_ptr.h>

Inheritance diagram for mrpt::containers::deepcopy_poly_ptr< T >:

Public Member Functions

 deepcopy_poly_ptr (const T &ptr)
 Ctor from a smart pointer; makes deep copy. More...
 
 deepcopy_poly_ptr ()=default
 Default ctor; init to nullptr. More...
 
 deepcopy_poly_ptr (const deepcopy_poly_ptr< T > &o)
 copy ctor: makes a copy of the object via clone() More...
 
deepcopy_poly_ptr< T > & operator= (const deepcopy_poly_ptr< T > &o)
 
deepcopy_poly_ptr< T > & operator= (const T &o_ptr)
 
 deepcopy_poly_ptr (deepcopy_poly_ptr &&o)
 move ctor More...
 
deepcopy_poly_ptr< T > & operator= (deepcopy_poly_ptr< T > &&o)
 move operator More...
 
 ~deepcopy_poly_ptr ()=default
 
T::element_type * get ()
 
const T::element_type * get () const
 
T::element_type * operator-> ()
 
const T::element_type * operator-> () const
 
T::element_type & operator* (void)
 
const T::element_type & operator* () const
 
 operator bool () const
 
bool operator! (void) const
 
const T & get_ptr () const
 
T & get_ptr ()
 
void reset ()
 

Private Attributes

m_smartptr
 

Constructor & Destructor Documentation

◆ deepcopy_poly_ptr() [1/4]

template<typename T>
mrpt::containers::deepcopy_poly_ptr< T >::deepcopy_poly_ptr ( const T &  ptr)
inline

Ctor from a smart pointer; makes deep copy.

Definition at line 29 of file deepcopy_poly_ptr.h.

◆ deepcopy_poly_ptr() [2/4]

template<typename T>
mrpt::containers::deepcopy_poly_ptr< T >::deepcopy_poly_ptr ( )
default

Default ctor; init to nullptr.

◆ deepcopy_poly_ptr() [3/4]

template<typename T>
mrpt::containers::deepcopy_poly_ptr< T >::deepcopy_poly_ptr ( const deepcopy_poly_ptr< T > &  o)
inline

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

Definition at line 36 of file deepcopy_poly_ptr.h.

◆ deepcopy_poly_ptr() [4/4]

template<typename T>
mrpt::containers::deepcopy_poly_ptr< T >::deepcopy_poly_ptr ( deepcopy_poly_ptr< T > &&  o)
inline

move ctor

Definition at line 55 of file deepcopy_poly_ptr.h.

◆ ~deepcopy_poly_ptr()

template<typename T>
mrpt::containers::deepcopy_poly_ptr< T >::~deepcopy_poly_ptr ( )
default

Member Function Documentation

◆ get() [1/2]

template<typename T>
T::element_type* mrpt::containers::deepcopy_poly_ptr< T >::get ( )
inline

Definition at line 69 of file deepcopy_poly_ptr.h.

◆ get() [2/2]

template<typename T>
const T::element_type* mrpt::containers::deepcopy_poly_ptr< T >::get ( ) const
inline

Definition at line 76 of file deepcopy_poly_ptr.h.

◆ get_ptr() [1/2]

template<typename T>
const T& mrpt::containers::deepcopy_poly_ptr< T >::get_ptr ( ) const
inline

Definition at line 90 of file deepcopy_poly_ptr.h.

◆ get_ptr() [2/2]

template<typename T>
T& mrpt::containers::deepcopy_poly_ptr< T >::get_ptr ( )
inline

Definition at line 91 of file deepcopy_poly_ptr.h.

◆ operator bool()

template<typename T>
mrpt::containers::deepcopy_poly_ptr< T >::operator bool ( ) const
inline

Definition at line 88 of file deepcopy_poly_ptr.h.

◆ operator!()

template<typename T>
bool mrpt::containers::deepcopy_poly_ptr< T >::operator! ( void  ) const
inline

Definition at line 89 of file deepcopy_poly_ptr.h.

◆ operator*() [1/2]

template<typename T>
T::element_type& mrpt::containers::deepcopy_poly_ptr< T >::operator* ( void  )
inline

Definition at line 86 of file deepcopy_poly_ptr.h.

◆ operator*() [2/2]

template<typename T>
const T::element_type& mrpt::containers::deepcopy_poly_ptr< T >::operator* ( void  ) const
inline

Definition at line 87 of file deepcopy_poly_ptr.h.

◆ operator->() [1/2]

template<typename T>
T::element_type* mrpt::containers::deepcopy_poly_ptr< T >::operator-> ( )
inline

Definition at line 84 of file deepcopy_poly_ptr.h.

◆ operator->() [2/2]

template<typename T>
const T::element_type* mrpt::containers::deepcopy_poly_ptr< T >::operator-> ( ) const
inline

Definition at line 85 of file deepcopy_poly_ptr.h.

◆ operator=() [1/3]

template<typename T>
deepcopy_poly_ptr<T>& mrpt::containers::deepcopy_poly_ptr< T >::operator= ( const deepcopy_poly_ptr< T > &  o)
inline

Definition at line 41 of file deepcopy_poly_ptr.h.

◆ operator=() [2/3]

template<typename T>
deepcopy_poly_ptr<T>& mrpt::containers::deepcopy_poly_ptr< T >::operator= ( const T &  o_ptr)
inline

Definition at line 48 of file deepcopy_poly_ptr.h.

◆ operator=() [3/3]

template<typename T>
deepcopy_poly_ptr<T>& mrpt::containers::deepcopy_poly_ptr< T >::operator= ( deepcopy_poly_ptr< T > &&  o)
inline

move operator

Definition at line 61 of file deepcopy_poly_ptr.h.

◆ reset()

template<typename T>
void mrpt::containers::deepcopy_poly_ptr< T >::reset ( )
inline

Definition at line 92 of file deepcopy_poly_ptr.h.

Member Data Documentation

◆ m_smartptr

template<typename T>
T mrpt::containers::deepcopy_poly_ptr< T >::m_smartptr
private



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020