rasdaman API
Public Member Functions | Protected Attributes | List of all members
r_Memory_Block_Vector Class Reference

#include <memblockvec.hh>

Public Member Functions

 r_Memory_Block_Vector (r_Bytes bsize=4096, unsigned int gran=8)
 constructor, receiving the size of each memory block and the granularity for extending the number of blocks. More...
 
 ~r_Memory_Block_Vector (void)
 destructor More...
 
unsigned int get_number (void) const
 return number of blocks More...
 
r_Bytes get_block_size (void) const
 return block size More...
 
unsigned int get_granularity (void) const
 return granularity More...
 
void * operator[] (unsigned int idx) const
 get a block More...
 
void * add (void)
 add a new block and return a pointer to it More...
 
void free_data (void)
 free all blocks (but not the vector, call the destructor for that) More...
 
r_Bytes get_size (r_Bytes lastFill) const
 get number of bytes stored. lastFill is the number of bytes used in the last block More...
 
void copy_data (void *dest, r_Bytes lastFill) const
 Copy the data stored in blocks into linear memory. lastFill is the number of bytes in the last block. More...
 

Protected Attributes

void ** blocks
 the array of memory block pointers More...
 
unsigned int numBlocks
 
unsigned int maxBlocks
 
r_Bytes blockSize
 the size of the blocks More...
 
unsigned int granularity
 the granularity More...
 

Constructor & Destructor Documentation

r_Memory_Block_Vector::r_Memory_Block_Vector ( r_Bytes  bsize = 4096,
unsigned int  gran = 8 
)

constructor, receiving the size of each memory block and the granularity for extending the number of blocks.

r_Memory_Block_Vector::~r_Memory_Block_Vector ( void  )

destructor

Member Function Documentation

void* r_Memory_Block_Vector::add ( void  )

add a new block and return a pointer to it

void r_Memory_Block_Vector::copy_data ( void *  dest,
r_Bytes  lastFill 
) const

Copy the data stored in blocks into linear memory. lastFill is the number of bytes in the last block.

void r_Memory_Block_Vector::free_data ( void  )

free all blocks (but not the vector, call the destructor for that)

r_Bytes r_Memory_Block_Vector::get_block_size ( void  ) const
inline

return block size

References blockSize.

unsigned int r_Memory_Block_Vector::get_granularity ( void  ) const
inline

return granularity

References granularity.

unsigned int r_Memory_Block_Vector::get_number ( void  ) const
inline

return number of blocks

References numBlocks.

r_Bytes r_Memory_Block_Vector::get_size ( r_Bytes  lastFill) const

get number of bytes stored. lastFill is the number of bytes used in the last block

void* r_Memory_Block_Vector::operator[] ( unsigned int  idx) const

get a block

Member Data Documentation

void** r_Memory_Block_Vector::blocks
protected

the array of memory block pointers

r_Bytes r_Memory_Block_Vector::blockSize
protected

the size of the blocks

Referenced by get_block_size().

unsigned int r_Memory_Block_Vector::granularity
protected

the granularity

Referenced by get_granularity().

unsigned int r_Memory_Block_Vector::maxBlocks
protected
unsigned int r_Memory_Block_Vector::numBlocks
protected

Referenced by get_number().


The documentation for this class was generated from the following file: