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::copy_ptr< T > Class Template Reference

Detailed Description

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

Smart pointer for non-polymorphic classes.

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

See also
poly_ptr<T>

Definition at line 26 of file copy_ptr.h.

#include <mrpt/utils/copy_ptr.h>

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

Public Types

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

Public Member Functions

 copy_ptr (T *ptr)
 Ctor from a pointer; takes ownership. More...
 
 copy_ptr ()
 Default ctor; init to nullptr. More...
 
 copy_ptr (const copy_ptr< T > &o)
 copy ctor: makes a copy of the object via clone() More...
 
copy_ptr< T > & operator= (const copy_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::CopyStatic< 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::CopyStatic<T> > mrpt::utils::copy_ptr< T >::ptr_base_t
private

Definition at line 29 of file copy_ptr.h.

◆ value_type

Definition at line 49 of file generic_copier_ptr.h.

Constructor & Destructor Documentation

◆ copy_ptr() [1/3]

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

Ctor from a pointer; takes ownership.

Definition at line 32 of file copy_ptr.h.

◆ copy_ptr() [2/3]

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

Default ctor; init to nullptr.

Definition at line 34 of file copy_ptr.h.

◆ copy_ptr() [3/3]

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

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

Definition at line 36 of file copy_ptr.h.

Member Function Documentation

◆ get() [1/2]

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

Definition at line 96 of file generic_copier_ptr.h.

◆ get() [2/2]

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

Definition at line 97 of file generic_copier_ptr.h.

◆ move_from()

Definition at line 59 of file generic_copier_ptr.h.

◆ operator bool()

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

Definition at line 99 of file generic_copier_ptr.h.

◆ operator!()

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

Definition at line 100 of file generic_copier_ptr.h.

◆ operator*() [1/2]

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

Definition at line 87 of file generic_copier_ptr.h.

◆ operator*() [2/2]

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

Definition at line 91 of file generic_copier_ptr.h.

◆ operator->() [1/2]

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

Definition at line 78 of file generic_copier_ptr.h.

◆ operator->() [2/2]

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

Definition at line 82 of file generic_copier_ptr.h.

◆ operator=()

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

◆ release()

T* mrpt::utils::internal::generic_copier_ptr< T, internal::CopyStatic< T > >::release ( )
inlineinherited

Releases the pointer (do not destroy the object)

Definition at line 103 of file generic_copier_ptr.h.

◆ reset()

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

Definition at line 109 of file generic_copier_ptr.h.

Referenced by mrpt::utils::copy_ptr< T >::operator=(), and TEST().

◆ resetDefaultCtor()

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

Definition at line 114 of file generic_copier_ptr.h.

Member Data Documentation

◆ m_ptr

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

Definition at line 117 of file generic_copier_ptr.h.

Referenced by mrpt::utils::copy_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