Main MRPT website > C++ reference for 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 27 of file deepcopy_poly_ptr.h.

#include <mrpt/containers/deepcopy_poly_ptr.h>

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

Public Member Functions

 deepcopy_poly_ptr (const T &ptr)
 Ctor from a smart pointer; makes deep copy. More...
 
 deepcopy_poly_ptr ()
 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 ()
 
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* (void) 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 31 of file deepcopy_poly_ptr.h.

◆ deepcopy_poly_ptr() [2/4]

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

Default ctor; init to nullptr.

Definition at line 36 of file deepcopy_poly_ptr.h.

◆ 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 38 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 57 of file deepcopy_poly_ptr.h.

◆ ~deepcopy_poly_ptr()

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

Definition at line 70 of file deepcopy_poly_ptr.h.

Member Function Documentation

◆ get() [1/2]

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

◆ get() [2/2]

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

Definition at line 78 of file deepcopy_poly_ptr.h.

◆ get_ptr() [1/2]

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

Definition at line 93 of file deepcopy_poly_ptr.h.

◆ get_ptr() [2/2]

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

◆ operator bool()

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

Definition at line 90 of file deepcopy_poly_ptr.h.

◆ operator!()

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

Definition at line 91 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 88 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 89 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 86 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 87 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 43 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 50 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 63 of file deepcopy_poly_ptr.h.

◆ reset()

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

Definition at line 94 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.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