Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Public Types | Public Member Functions | Protected Attributes | Private Types
mrpt::utils::CReferencedMemBlock Class Reference

Detailed Description

Represents a memory block (via "void*") that can be shared between several objects through copy operator (=).

It keeps the reference count and only when it comes to zero, the memory block is really freed.

Definition at line 27 of file CReferencedMemBlock.h.

#include <mrpt/utils/CReferencedMemBlock.h>

Inheritance diagram for mrpt::utils::CReferencedMemBlock:
Inheritance graph

Public Types

typedef T value_type
 
typedef T & reference
 
typedef const T & const_reference
 
typedef C value_copy
 

Public Member Functions

 CReferencedMemBlock (size_t mem_block_size=0)
 Constructor with an optional size of the memory block.
 
virtual ~CReferencedMemBlock ()
 Destructor, calls dereference_once.
 
void resize (size_t mem_block_size)
 Resize the shared memory block.
 
template<class T >
getAs ()
 
template<class T >
getAs () const
 
 operator bool (void) const
 
bool operator! (void) const
 
bool present (void) const
 
bool null (void) const
 
T & operator* (void) throw (null_dereference)
 
const T & operator* (void) const throw (null_dereference)
 
T * operator-> (void) throw (null_dereference)
 
const T * operator-> (void) const throw (null_dereference)
 
void set_value (const T &data) throw (illegal_copy)
 
T & value (void) throw (null_dereference)
 
const T & value (void) const throw (null_dereference)
 
void set (T *data=0)
 
T * pointer (void)
 
const T * pointer (void) const
 
void alias (const smart_ptr_base< T, C, COUNTER > &)
 
bool aliases (const smart_ptr_base< T, C, COUNTER > &) const
 
unsigned alias_count (void) const
 
void clear (void)
 
void clear_unique (void)
 
void make_unique (void) throw (illegal_copy)
 
void copy (const smart_ptr_base< T, C, COUNTER > &) throw (illegal_copy)
 
void * handle (void) const
 
void make_alias (void *handle)
 

Protected Attributes

smart_ptr_holder< T, COUNTER > * m_holder
 

Private Types

typedef stlplus::smart_ptr< std::vector< char > > base_t
 

Member Typedef Documentation

◆ base_t

typedef stlplus::smart_ptr< std::vector<char> > mrpt::utils::CReferencedMemBlock::base_t
private

Definition at line 29 of file CReferencedMemBlock.h.

◆ const_reference

template<typename T , typename C , typename COUNTER >
typedef const T& stlplus::smart_ptr_base< T, C, COUNTER >::const_reference
inherited

Definition at line 72 of file smart_ptr.hpp.

◆ reference

template<typename T , typename C , typename COUNTER >
typedef T& stlplus::smart_ptr_base< T, C, COUNTER >::reference
inherited

Definition at line 71 of file smart_ptr.hpp.

◆ value_copy

template<typename T , typename C , typename COUNTER >
typedef C stlplus::smart_ptr_base< T, C, COUNTER >::value_copy
inherited

Definition at line 73 of file smart_ptr.hpp.

◆ value_type

template<typename T , typename C , typename COUNTER >
typedef T stlplus::smart_ptr_base< T, C, COUNTER >::value_type
inherited

Definition at line 70 of file smart_ptr.hpp.

Constructor & Destructor Documentation

◆ CReferencedMemBlock()

mrpt::utils::CReferencedMemBlock::CReferencedMemBlock ( size_t  mem_block_size = 0)

Constructor with an optional size of the memory block.

◆ ~CReferencedMemBlock()

virtual mrpt::utils::CReferencedMemBlock::~CReferencedMemBlock ( )
virtual

Destructor, calls dereference_once.

Member Function Documentation

◆ alias()

template<typename T , typename C , typename COUNTER >
void stlplus::smart_ptr_base< T, C, COUNTER >::alias ( const smart_ptr_base< T, C, COUNTER > &  )
inlineinherited

◆ alias_count()

template<typename T , typename C , typename COUNTER >
unsigned stlplus::smart_ptr_base< T, C, COUNTER >::alias_count ( void  ) const
inlineinherited

◆ aliases()

template<typename T , typename C , typename COUNTER >
bool stlplus::smart_ptr_base< T, C, COUNTER >::aliases ( const smart_ptr_base< T, C, COUNTER > &  ) const
inlineinherited

Referenced by std::operator!=(), and std::operator==().

◆ clear()

template<typename T , typename C , typename COUNTER >
void stlplus::smart_ptr_base< T, C, COUNTER >::clear ( void  )
inlineinherited

◆ clear_unique()

template<typename T , typename C , typename COUNTER >
void stlplus::smart_ptr_base< T, C, COUNTER >::clear_unique ( void  )
inlineinherited

◆ copy()

template<typename T , typename C , typename COUNTER >
void stlplus::smart_ptr_base< T, C, COUNTER >::copy ( const smart_ptr_base< T, C, COUNTER > &  )
throw (illegal_copy
)
inherited

◆ getAs() [1/2]

template<class T >
T mrpt::utils::CReferencedMemBlock::getAs ( )
inline

Definition at line 40 of file CReferencedMemBlock.h.

References empty().

◆ getAs() [2/2]

template<class T >
T mrpt::utils::CReferencedMemBlock::getAs ( ) const
inline

Definition at line 51 of file CReferencedMemBlock.h.

References empty().

◆ handle()

template<typename T , typename C , typename COUNTER >
void * stlplus::smart_ptr_base< T, C, COUNTER >::handle ( void  ) const
inherited

◆ make_alias()

template<typename T , typename C , typename COUNTER >
void stlplus::smart_ptr_base< T, C, COUNTER >::make_alias ( void *  handle)
inherited

◆ make_unique()

template<typename T , typename C , typename COUNTER >
void stlplus::smart_ptr_base< T, C, COUNTER >::make_unique ( void  )
throw (illegal_copy
)
inlineinherited

◆ null()

template<typename T , typename C , typename COUNTER >
bool stlplus::smart_ptr_base< T, C, COUNTER >::null ( void  ) const
inherited

◆ operator bool()

template<typename T , typename C , typename COUNTER >
stlplus::smart_ptr_base< T, C, COUNTER >::operator bool ( void  ) const
inherited

◆ operator!()

template<typename T , typename C , typename COUNTER >
bool stlplus::smart_ptr_base< T, C, COUNTER >::operator! ( void  ) const
inherited

◆ operator*() [1/2]

template<typename T , typename C , typename COUNTER >
T & stlplus::smart_ptr_base< T, C, COUNTER >::operator* ( void  )
throw (null_dereference
)
inherited

◆ operator*() [2/2]

template<typename T , typename C , typename COUNTER >
const T & stlplus::smart_ptr_base< T, C, COUNTER >::operator* ( void  ) const
throw (null_dereference
)
inherited

◆ operator->() [1/2]

template<typename T , typename C , typename COUNTER >
T * stlplus::smart_ptr_base< T, C, COUNTER >::operator-> ( void  )
throw (null_dereference
)
inherited

◆ operator->() [2/2]

template<typename T , typename C , typename COUNTER >
const T * stlplus::smart_ptr_base< T, C, COUNTER >::operator-> ( void  ) const
throw (null_dereference
)
inherited

◆ pointer() [1/2]

template<typename T , typename C , typename COUNTER >
T * stlplus::smart_ptr_base< T, C, COUNTER >::pointer ( void  )
inherited

◆ pointer() [2/2]

template<typename T , typename C , typename COUNTER >
const T * stlplus::smart_ptr_base< T, C, COUNTER >::pointer ( void  ) const
inherited

◆ present()

template<typename T , typename C , typename COUNTER >
bool stlplus::smart_ptr_base< T, C, COUNTER >::present ( void  ) const
inherited

◆ resize()

void mrpt::utils::CReferencedMemBlock::resize ( size_t  mem_block_size)

Resize the shared memory block.

◆ set()

template<typename T , typename C , typename COUNTER >
void stlplus::smart_ptr_base< T, C, COUNTER >::set ( T *  data = 0)
inherited

◆ set_value()

template<typename T , typename C , typename COUNTER >
void stlplus::smart_ptr_base< T, C, COUNTER >::set_value ( const T &  data)
throw (illegal_copy
)
inherited

◆ value() [1/2]

template<typename T , typename C , typename COUNTER >
T & stlplus::smart_ptr_base< T, C, COUNTER >::value ( void  )
throw (null_dereference
)
inherited

◆ value() [2/2]

template<typename T , typename C , typename COUNTER >
const T & stlplus::smart_ptr_base< T, C, COUNTER >::value ( void  ) const
throw (null_dereference
)
inherited

Member Data Documentation

◆ m_holder

template<typename T , typename C , typename COUNTER >
smart_ptr_holder<T,COUNTER>* stlplus::smart_ptr_base< T, C, COUNTER >::m_holder
protectedinherited

Definition at line 175 of file smart_ptr.hpp.




Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Fri Jan 20 02:28:26 UTC 2023