MRPT  2.0.4
List of all members | Public Member Functions | Protected Attributes
mrpt::safe_ptr< T > Struct Template Reference

Detailed Description

template<class T>
struct mrpt::safe_ptr< T >

A wrapper class for pointers that can be safely copied with "=" operator without problems.

This class does not keep any reference count nor automatically destroy the pointed data.

See also
safe_ptr, non_copiable_ptr, copiable_NULL_ptr

Definition at line 71 of file safe_pointers.h.

#include <mrpt/core/safe_pointers.h>

Inheritance diagram for mrpt::safe_ptr< T >:

Public Member Functions

 safe_ptr ()
 
 safe_ptr (const safe_ptr< T > &o)
 
 safe_ptr (const T *p)
 
safe_ptroperator= (T *p)
 
 ~safe_ptr () override=default
 
T & operator* ()
 
const T & operator* () const
 
T & operator[] (size_t i)
 
const T & operator[] (size_t i) const
 
bool operator== (const T *o) const
 
bool operator== (const safe_ptr_basic< T > &o) const
 
bool operator!= (const T *o) const
 
bool operator!= (const safe_ptr_basic< T > &o) const
 
T *& get ()
 
const T * get () const
 
T *& operator-> ()
 
const T * operator-> () const
 

Protected Attributes

T * ptr
 

Constructor & Destructor Documentation

◆ safe_ptr() [1/3]

template<class T>
mrpt::safe_ptr< T >::safe_ptr ( )
inline

Definition at line 74 of file safe_pointers.h.

◆ safe_ptr() [2/3]

template<class T>
mrpt::safe_ptr< T >::safe_ptr ( const safe_ptr< T > &  o)
inline

Definition at line 75 of file safe_pointers.h.

◆ safe_ptr() [3/3]

template<class T>
mrpt::safe_ptr< T >::safe_ptr ( const T *  p)
inline

Definition at line 76 of file safe_pointers.h.

◆ ~safe_ptr()

template<class T>
mrpt::safe_ptr< T >::~safe_ptr ( )
overridedefault

Member Function Documentation

◆ get() [1/2]

template<class T>
T*& mrpt::safe_ptr_basic< T >::get ( )
inlineinherited

Definition at line 49 of file safe_pointers.h.

◆ get() [2/2]

template<class T>
const T* mrpt::safe_ptr_basic< T >::get ( ) const
inlineinherited

Definition at line 50 of file safe_pointers.h.

◆ operator!=() [1/2]

template<class T>
bool mrpt::safe_ptr_basic< T >::operator!= ( const T *  o) const
inlineinherited

Definition at line 47 of file safe_pointers.h.

◆ operator!=() [2/2]

template<class T>
bool mrpt::safe_ptr_basic< T >::operator!= ( const safe_ptr_basic< T > &  o) const
inlineinherited

Definition at line 48 of file safe_pointers.h.

◆ operator*() [1/2]

template<class T>
T& mrpt::safe_ptr< T >::operator* ( void  )
inline

Definition at line 83 of file safe_pointers.h.

◆ operator*() [2/2]

template<class T>
const T& mrpt::safe_ptr< T >::operator* ( void  ) const
inline

Definition at line 88 of file safe_pointers.h.

◆ operator->() [1/2]

template<class T>
T*& mrpt::safe_ptr_basic< T >::operator-> ( )
inlineinherited

Definition at line 51 of file safe_pointers.h.

◆ operator->() [2/2]

template<class T>
const T* mrpt::safe_ptr_basic< T >::operator-> ( ) const
inlineinherited

Definition at line 56 of file safe_pointers.h.

◆ operator=()

template<class T>
safe_ptr& mrpt::safe_ptr< T >::operator= ( T *  p)
inline

Definition at line 77 of file safe_pointers.h.

◆ operator==() [1/2]

template<class T>
bool mrpt::safe_ptr_basic< T >::operator== ( const T *  o) const
inlineinherited

Definition at line 45 of file safe_pointers.h.

◆ operator==() [2/2]

template<class T>
bool mrpt::safe_ptr_basic< T >::operator== ( const safe_ptr_basic< T > &  o) const
inlineinherited

Definition at line 46 of file safe_pointers.h.

◆ operator[]() [1/2]

template<class T>
T& mrpt::safe_ptr< T >::operator[] ( size_t  i)
inline

Definition at line 94 of file safe_pointers.h.

◆ operator[]() [2/2]

template<class T>
const T& mrpt::safe_ptr< T >::operator[] ( size_t  i) const
inline

Definition at line 99 of file safe_pointers.h.

Member Data Documentation

◆ ptr

template<class T>
T* mrpt::safe_ptr_basic< T >::ptr
protectedinherited



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020