Main MRPT website > C++ reference for MRPT 1.5.6
List of all members | Public Types | Public Member Functions | Protected Attributes | Private Types
mrpt::utils::poly_ptr< T > Class Template Reference

Detailed Description

template<typename T>
class mrpt::utils::poly_ptr< T >

Smart pointer for polymorphic classes with a clone() method.

No shared copies, that is, each poly_ptr<T> owns a unique instance of T. Copying a poly_ptr<T> invokes the copy operator for T.

See Also
copy_ptr<T>

Definition at line 26 of file poly_ptr.h.

#include <mrpt/utils/poly_ptr.h>

Inheritance diagram for mrpt::utils::poly_ptr< T >:
Inheritance graph

Public Types

typedef T value_type
 
typedef internal::CopyCloner< T > copier_t
 

Public Member Functions

 poly_ptr (T *ptr)
 Ctor from a pointer; takes ownership. More...
 
 poly_ptr ()
 Default ctor; init to nullptr. More...
 
 poly_ptr (const poly_ptr< T > &o)
 copy ctor: makes a copy of the object via clone() More...
 
poly_ptr< T > & operator= (const poly_ptr< T > &o)
 copy operator More...
 
void move_from (generic_copier_ptr &o)
 
T * operator-> ()
 
const T * operator-> () const
 
T & operator* (void)
 
const T & operator* (void) const
 
T * get ()
 
const T * get () const
 
 operator bool () const
 
bool operator! (void) const
 
T * release ()
 Releases the pointer (do not destroy the object) More...
 
void reset (T *ptr=NULL)
 
void resetDefaultCtor ()
 

Protected Attributes

T * m_ptr
 

Private Types

typedef
internal::generic_copier_ptr
< T, internal::CopyCloner< T > > 
ptr_base_t
 

Member Typedef Documentation

Definition at line 50 of file generic_copier_ptr.h.

template<typename T>
typedef internal::generic_copier_ptr<T, internal::CopyCloner<T> > mrpt::utils::poly_ptr< T >::ptr_base_t
private

Definition at line 29 of file poly_ptr.h.

Definition at line 49 of file generic_copier_ptr.h.

Constructor & Destructor Documentation

template<typename T>
mrpt::utils::poly_ptr< T >::poly_ptr ( T *  ptr)
inlineexplicit

Ctor from a pointer; takes ownership.

Definition at line 32 of file poly_ptr.h.

template<typename T>
mrpt::utils::poly_ptr< T >::poly_ptr ( )
inline

Default ctor; init to nullptr.

Definition at line 34 of file poly_ptr.h.

template<typename T>
mrpt::utils::poly_ptr< T >::poly_ptr ( const poly_ptr< T > &  o)
inline

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

Definition at line 36 of file poly_ptr.h.

Member Function Documentation

T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::get ( )
inlineinherited
const T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::get ( ) const
inlineinherited
mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator bool ( ) const
inlineinherited
bool mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator! ( void  ) const
inlineinherited
T& mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator* ( void  )
inlineinherited
const T& mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator* ( void  ) const
inlineinherited
T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator-> ( )
inlineinherited
const T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator-> ( ) const
inlineinherited
template<typename T>
poly_ptr<T>& mrpt::utils::poly_ptr< T >::operator= ( const poly_ptr< T > &  o)
inline
T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::release ( )
inlineinherited

Releases the pointer (do not destroy the object)

Definition at line 103 of file generic_copier_ptr.h.

References mrpt::utils::internal::generic_copier_ptr< T, Copier >::m_ptr.

void mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::reset ( T *  ptr = NULL)
inlineinherited
void mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::resetDefaultCtor ( )
inlineinherited

Member Data Documentation

T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::m_ptr
protectedinherited

Definition at line 117 of file generic_copier_ptr.h.

Referenced by mrpt::utils::poly_ptr< T >::operator=().




Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018