HLIBpro  2.0
Public Member Functions | Protected Attributes | List of all members
MemBlockRef< T > Class Template Reference

Pointer to handle delete operations for memory blocks like refptr.

#include <MemBlock.hh>

Public Member Functions

 MemBlockRef ()
 ctor for zero sized block but reference to NULL block
 
 MemBlockRef (const MemBlockRef< T > &ref)
 ctor: store memory block ref and add a reference
 
 MemBlockRef (const size_t n)
 ctor: create memory block of size n and one reference
 
 ~MemBlockRef ()
 dtor: delete reference, but not necessarily the data
 
void set_block (MemBlock< T > *b=&_null_block)
 set internal memory block to b (default = NULL)
 
void set_block (const MemBlockRef< T > &ref)
 

Protected Attributes

T * _data
 

Member Function Documentation

void set_block ( const MemBlockRef< T > &  ref)
inline

set internal memory block to block in ref, thereby increasing references to it

Member Data Documentation

T* _data
protected

pointer to data in _block to prevent double dereferenciation and to apply offsets directly and not in index operator