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::Raster * | getRaster () const |
| Returns the associated raster. More... | |
| RasterSynchronizer * | getSynchronizer () const |
| Return a pointer to the assotiated synchronizer instance or NULL if there is none. More... | |
| bool | initialize (RasterSynchronizer &sync, const unsigned char maxMemPercentUsed) |
| Initialize this instance to an initial state. More... | |
| bool | initialize (const unsigned int maxNumberOfCacheBlocks, RasterSynchronizer &sync) |
| 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< BlockIndex > | m_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... | |
| RasterSynchronizer * | m_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... | |
Synchronized raster raster band blocks manager.
Definition at line 50 of file SynchronizedBandBlocksManager.h.
| te::rst::SynchronizedBandBlocksManager::SynchronizedBandBlocksManager | ( | ) |
Definition at line 50 of file SynchronizedBandBlocksManager.cpp.
| te::rst::SynchronizedBandBlocksManager::~SynchronizedBandBlocksManager | ( | ) |
Definition at line 55 of file SynchronizedBandBlocksManager.cpp.
| void te::rst::SynchronizedBandBlocksManager::free | ( | ) |
Definition at line 144 of file SynchronizedBandBlocksManager.cpp.
References TE_TR, and te::common::WAccess.
| void * te::rst::SynchronizedBandBlocksManager::getBlockPointer | ( | unsigned int | band, |
| unsigned int | x, | ||
| unsigned int | y | ||
| ) |
Returns a pointer to the required data block.
| band | The band index. |
| x | The block-id in x (or x-offset). |
| y | The block-id in y (or y-offset). |
Definition at line 196 of file SynchronizedBandBlocksManager.cpp.
References te::rst::SynchronizedBandBlocksManager::BlockIndex::m_b, te::rst::SynchronizedBandBlocksManager::BlockIndex::m_x, te::rst::SynchronizedBandBlocksManager::BlockIndex::m_y, and TE_TR.
|
inline |
The maximum number of cache blocks.
Definition at line 117 of file SynchronizedBandBlocksManager.h.
| te::rst::Raster * te::rst::SynchronizedBandBlocksManager::getRaster | ( | ) | const |
Returns the associated raster.
Definition at line 264 of file SynchronizedBandBlocksManager.cpp.
Referenced by te::rst::SynchronizedBand::SynchronizedBand().
|
inline |
Return a pointer to the assotiated synchronizer instance or NULL if there is none.
Definition at line 123 of file SynchronizedBandBlocksManager.h.
Referenced by te::rst::SynchronizedBand::SynchronizedBand().
| bool te::rst::SynchronizedBandBlocksManager::initialize | ( | RasterSynchronizer & | sync, |
| const unsigned char | maxMemPercentUsed | ||
| ) |
Initialize this instance to an initial state.
| sync | The synchronized used by this instance. |
| maxMemPercentUsed | The maximum free memory percentual to use valid range: [1:100]. |
Definition at line 60 of file SynchronizedBandBlocksManager.cpp.
References te::rst::Raster::getBand(), te::rst::Band::getBlockSize(), te::rst::Raster::getNumberOfBands(), te::common::GetTotalPhysicalMemory(), te::common::GetTotalVirtualMemory(), te::common::GetUsedVirtualMemory(), te::rst::RasterSynchronizer::m_mutex, and te::rst::RasterSynchronizer::m_raster.
Referenced by te::rst::SynchronizedRaster::SynchronizedRaster().
| bool te::rst::SynchronizedBandBlocksManager::initialize | ( | const unsigned int | maxNumberOfCacheBlocks, |
| RasterSynchronizer & | sync | ||
| ) |
Initialize this instance to an initial state.
| sync | The synchronized used by this instance. |
| maxNumberOfCacheBlocks | The maximum number of cache blocks. |
Definition at line 89 of file SynchronizedBandBlocksManager.cpp.
References te::rst::Raster::getBand(), te::rst::Band::getProperty(), te::rst::RasterSynchronizer::m_mutex, te::rst::BandProperty::m_nblocksx, and te::rst::RasterSynchronizer::m_raster.
|
private |
Initialize this instance to an initial state.
Definition at line 39 of file SynchronizedBandBlocksManager.cpp.
References m_blocksFifoNextSwapBlockIndex, m_getBlockPointer_BlkPtr, m_globalBlockSizeBytes, m_globalBlocksNumberX, m_globalBlocksNumberY, m_maxNumberOfCacheBlocks, and m_syncPtr.
|
inline |
Returns true if this instance is initialized.
Definition at line 91 of file SynchronizedBandBlocksManager.h.
|
protected |
blocks swap FIFO.
Definition at line 172 of file SynchronizedBandBlocksManager.h.
|
protected |
The next block swapp index over m_blocksFifo.
Definition at line 163 of file SynchronizedBandBlocksManager.h.
Referenced by initState().
|
protected |
Cache blocks handler.
Definition at line 170 of file SynchronizedBandBlocksManager.h.
|
protected |
3D Matrix of block pointers indexed as [band][blockYIndex][blockXIndex].
Definition at line 168 of file SynchronizedBandBlocksManager.h.
|
protected |
Definition at line 166 of file SynchronizedBandBlocksManager.h.
Referenced by initState().
|
protected |
The maximum block size for all bands.
Definition at line 159 of file SynchronizedBandBlocksManager.h.
Referenced by initState().
|
protected |
The maximum number of blocks (X axis) for all bands.
Definition at line 155 of file SynchronizedBandBlocksManager.h.
Referenced by initState().
|
protected |
The maximum number of blocks (Y axis) for all bands.
Definition at line 157 of file SynchronizedBandBlocksManager.h.
Referenced by initState().
|
protected |
The maximum number of cache blocks.
Definition at line 161 of file SynchronizedBandBlocksManager.h.
Referenced by initState().
|
protected |
A pointer to the synchronizer used by this instance, of null if not initialized.
Definition at line 153 of file SynchronizedBandBlocksManager.h.
Referenced by initState().