Main MRPT website > C++ reference for MRPT 1.5.9
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

◆ copier_t

Definition at line 50 of file generic_copier_ptr.h.

◆ ptr_base_t

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.

◆ value_type

Definition at line 49 of file generic_copier_ptr.h.

Constructor & Destructor Documentation

◆ poly_ptr() [1/3]

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.

◆ poly_ptr() [2/3]

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.

◆ poly_ptr() [3/3]

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

◆ get() [1/2]

T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::get ( )
inlineinherited

◆ get() [2/2]

const T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::get ( ) const
inlineinherited

◆ move_from()

◆ operator bool()

mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator bool ( ) const
inlineinherited

◆ operator!()

bool mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator! ( void  ) const
inlineinherited

◆ operator*() [1/2]

T& mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator* ( void  )
inlineinherited

◆ operator*() [2/2]

const T& mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator* ( void  ) const
inlineinherited

◆ operator->() [1/2]

T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator-> ( void  )
inlineinherited

◆ operator->() [2/2]

const T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::operator-> ( void  ) const
inlineinherited

◆ operator=()

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

◆ release()

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.

◆ reset()

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

◆ resetDefaultCtor()

void mrpt::utils::internal::generic_copier_ptr< T, internal::CopyCloner< T > >::resetDefaultCtor ( )
inlineinherited

Member Data Documentation

◆ m_ptr

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.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020