9 #ifndef CReferencedMemBlock_H 10 #define CReferencedMemBlock_H 38 void resize(
size_t mem_block_size );
42 if (!base_t::present())
43 throw std::runtime_error(
"Trying to access to an uninitialized memory block");
45 if( base_t::operator ->()->
empty() )
46 throw std::runtime_error(
"Trying to access to a memory block of size 0");
48 return reinterpret_cast<T
>( & base_t::operator ->()->operator [](0) );
51 template <
class T> T
getAs()
const 53 if (!base_t::present())
54 throw std::runtime_error(
"Trying to access to an uninitialized memory block");
56 if( base_t::operator ->()->
empty() )
57 throw std::runtime_error(
"Trying to access to a memory block of size 0");
59 return reinterpret_cast<const T
>( & base_t::operator ->()->operator [](0) );
Represents a memory block (via "void*") that can be shared between several objects through copy opera...
EIGEN_STRONG_INLINE bool empty() const
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
stlplus::smart_ptr< std::vector< char > > base_t