te::rst::SynchronizedBandBlocksManager Class Reference

Synchronized raster raster band blocks manager. More...

#include <SynchronizedBandBlocksManager.h>

Classes

class  BlockIndex
 Internal blocks indexes. More...
 

Public Member Functions

void free ()
 
void * getBlockPointer (unsigned int band, unsigned int x, unsigned int y)
 Returns a pointer to the required data block. More...
 
unsigned int getMaxNumberOfCacheBlocks () const
 The maximum number of cache blocks. More...
 
te::rst::RastergetRaster () const
 Returns the associated raster. More...
 
RasterSynchronizergetSynchronizer () const
 Return a pointer to the assotiated synchronizer instance or NULL if there is none. More...
 
bool initialize (const unsigned int maxNumberOfCacheBlocks, RasterSynchronizer &sync)
 Initialize this instance to an initial state. More...
 
bool initialize (RasterSynchronizer &sync, const unsigned char maxMemPercentUsed)
 Initialize this instance to an initial state. More...
 
bool isInitialized () const
 Returns true if this instance is initialized. More...
 
 SynchronizedBandBlocksManager ()
 
 ~SynchronizedBandBlocksManager ()
 

Protected Attributes

std::vector< BlockIndexm_blocksFifo
 blocks swap FIFO. More...
 
unsigned int m_blocksFifoNextSwapBlockIndex
 The next block swapp index over m_blocksFifo. More...
 
std::vector< unsigned char * > m_blocksHandler
 Cache blocks handler. More...
 
std::vector< std::vector< std::vector< unsigned char * > > > m_blocksPointers
 3D Matrix of block pointers indexed as [band][blockYIndex][blockXIndex]. More...
 
unsigned char * m_getBlockPointer_BlkPtr
 
unsigned int m_globalBlockSizeBytes
 The maximum block size for all bands. More...
 
unsigned int m_globalBlocksNumberX
 The maximum number of blocks (X axis) for all bands. More...
 
unsigned int m_globalBlocksNumberY
 The maximum number of blocks (Y axis) for all bands. More...
 
unsigned int m_maxNumberOfCacheBlocks
 The maximum number of cache blocks. More...
 
RasterSynchronizerm_syncPtr
 A pointer to the synchronizer used by this instance, of null if not initialized. More...
 

Private Member Functions

void initState ()
 Initialize this instance to an initial state. More...
 
 SynchronizedBandBlocksManager (const SynchronizedBandBlocksManager &other)
 

Detailed Description

Synchronized raster raster band blocks manager.

Definition at line 47 of file SynchronizedBandBlocksManager.h.

Constructor & Destructor Documentation

◆ SynchronizedBandBlocksManager() [1/2]

te::rst::SynchronizedBandBlocksManager::SynchronizedBandBlocksManager ( )

◆ ~SynchronizedBandBlocksManager()

te::rst::SynchronizedBandBlocksManager::~SynchronizedBandBlocksManager ( )

◆ SynchronizedBandBlocksManager() [2/2]

te::rst::SynchronizedBandBlocksManager::SynchronizedBandBlocksManager ( const SynchronizedBandBlocksManager other)
inlineprivate

Definition at line 173 of file SynchronizedBandBlocksManager.h.

Member Function Documentation

◆ free()

void te::rst::SynchronizedBandBlocksManager::free ( )
Note
Free all allocated internal resources and go back to the initial state.

◆ getBlockPointer()

void* te::rst::SynchronizedBandBlocksManager::getBlockPointer ( unsigned int  band,
unsigned int  x,
unsigned int  y 
)

Returns a pointer to the required data block.

Parameters
bandThe band index.
xThe block-id in x (or x-offset).
yThe block-id in y (or y-offset).
Returns
Pointer to the required data block.

◆ getMaxNumberOfCacheBlocks()

unsigned int te::rst::SynchronizedBandBlocksManager::getMaxNumberOfCacheBlocks ( ) const
inline

The maximum number of cache blocks.

Definition at line 114 of file SynchronizedBandBlocksManager.h.

◆ getRaster()

te::rst::Raster* te::rst::SynchronizedBandBlocksManager::getRaster ( ) const

Returns the associated raster.

◆ getSynchronizer()

RasterSynchronizer* te::rst::SynchronizedBandBlocksManager::getSynchronizer ( ) const
inline

Return a pointer to the assotiated synchronizer instance or NULL if there is none.

Definition at line 120 of file SynchronizedBandBlocksManager.h.

◆ initialize() [1/2]

bool te::rst::SynchronizedBandBlocksManager::initialize ( const unsigned int  maxNumberOfCacheBlocks,
RasterSynchronizer sync 
)

Initialize this instance to an initial state.

Parameters
syncThe synchronized used by this instance.
maxNumberOfCacheBlocksThe maximum number of cache blocks.
Returns
true if OK, false on errors.
Note
For the case where using the write raster access policy: The use of multiple cached blocks can cause deadlocks if multiple threads are locking blocks needed by other threads, use it with caution!

◆ initialize() [2/2]

bool te::rst::SynchronizedBandBlocksManager::initialize ( RasterSynchronizer sync,
const unsigned char  maxMemPercentUsed 
)

Initialize this instance to an initial state.

Parameters
syncThe synchronized used by this instance.
maxMemPercentUsedThe maximum free memory percentual to use valid range: [1:100].
Returns
true if OK, false on errors.
Note
For the case where using the write raster access policy: The use of multiple cached blocks can cause deadlocks if multiple threads are locking blocks needed by other threads, use it with caution!

◆ initState()

void te::rst::SynchronizedBandBlocksManager::initState ( )
private

Initialize this instance to an initial state.

◆ isInitialized()

bool te::rst::SynchronizedBandBlocksManager::isInitialized ( ) const
inline

Returns true if this instance is initialized.

Returns
true if this instance is initialized.

Definition at line 88 of file SynchronizedBandBlocksManager.h.

Member Data Documentation

◆ m_blocksFifo

std::vector< BlockIndex > te::rst::SynchronizedBandBlocksManager::m_blocksFifo
protected

blocks swap FIFO.

Definition at line 169 of file SynchronizedBandBlocksManager.h.

◆ m_blocksFifoNextSwapBlockIndex

unsigned int te::rst::SynchronizedBandBlocksManager::m_blocksFifoNextSwapBlockIndex
protected

The next block swapp index over m_blocksFifo.

Definition at line 160 of file SynchronizedBandBlocksManager.h.

◆ m_blocksHandler

std::vector< unsigned char* > te::rst::SynchronizedBandBlocksManager::m_blocksHandler
protected

Cache blocks handler.

Definition at line 167 of file SynchronizedBandBlocksManager.h.

◆ m_blocksPointers

std::vector< std::vector< std::vector< unsigned char* > > > te::rst::SynchronizedBandBlocksManager::m_blocksPointers
protected

3D Matrix of block pointers indexed as [band][blockYIndex][blockXIndex].

Definition at line 165 of file SynchronizedBandBlocksManager.h.

◆ m_getBlockPointer_BlkPtr

unsigned char* te::rst::SynchronizedBandBlocksManager::m_getBlockPointer_BlkPtr
protected

Definition at line 163 of file SynchronizedBandBlocksManager.h.

◆ m_globalBlockSizeBytes

unsigned int te::rst::SynchronizedBandBlocksManager::m_globalBlockSizeBytes
protected

The maximum block size for all bands.

Definition at line 156 of file SynchronizedBandBlocksManager.h.

◆ m_globalBlocksNumberX

unsigned int te::rst::SynchronizedBandBlocksManager::m_globalBlocksNumberX
protected

The maximum number of blocks (X axis) for all bands.

Definition at line 152 of file SynchronizedBandBlocksManager.h.

◆ m_globalBlocksNumberY

unsigned int te::rst::SynchronizedBandBlocksManager::m_globalBlocksNumberY
protected

The maximum number of blocks (Y axis) for all bands.

Definition at line 154 of file SynchronizedBandBlocksManager.h.

◆ m_maxNumberOfCacheBlocks

unsigned int te::rst::SynchronizedBandBlocksManager::m_maxNumberOfCacheBlocks
protected

The maximum number of cache blocks.

Definition at line 158 of file SynchronizedBandBlocksManager.h.

◆ m_syncPtr

RasterSynchronizer* te::rst::SynchronizedBandBlocksManager::m_syncPtr
protected

A pointer to the synchronizer used by this instance, of null if not initialized.

Definition at line 150 of file SynchronizedBandBlocksManager.h.


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