RAM cached and tiled raster band blocks manager. More...
#include <ExpansibleBandBlocksManager.h>
Classes | |
| class | BlockIndex3D |
| 3D Block index. More... | |
| class | DiskBlockInfo |
| Disk block info. More... | |
| class | OpenDiskFileHandler |
| Open disk file handler. More... | |
Public Member Functions | |
| bool | addBottomBands (const unsigned int &expansionSize, std::vector< BlockIndex3D > &addedBlocksCoords) |
| New bands will be added at the bottom of the raster (after de the last band). | |
| bool | addBottomBlocks (const unsigned int &expansionSize, const unsigned int &band, std::vector< BlockIndex3D > &addedBlocksCoords) |
| New blocks will be added at the bottom of the raster. | |
| bool | addLeftBlocks (const unsigned int &expansionSize, const unsigned int &band, std::vector< BlockIndex3D > &addedBlocksCoords) |
| New blocks will be added at the left of the raster. | |
| bool | addRightBlocks (const unsigned int &expansionSize, const unsigned int &band, std::vector< BlockIndex3D > &addedBlocksCoords) |
| New blocks will be added at the right of the raster. | |
| bool | addTopBands (const unsigned int &expansionSize, std::vector< BlockIndex3D > &addedBlocksCoords) |
| New bands will be added at the top of the raster (before the first band). | |
| bool | addTopBlocks (const unsigned int &expansionSize, const unsigned int &band, std::vector< BlockIndex3D > &addedBlocksCoords) |
| New blocks will be added at the top of the raster. | |
| ExpansibleBandBlocksManager () | |
| void | free () |
| Free all allocated internal resources and go back to the initial state. | |
| void * | getBlockPointer (unsigned int band, unsigned int x, unsigned int y) |
| Returns a pointer to the required data block. | |
| unsigned long int | getBlockSizeBytes () |
| Returns the internal size( bytes ) used for all internal blocks. | |
| unsigned int | getMaxNumberOfRAMBlocks () const |
| The maximum number of cache blocks. | |
| unsigned int | getNumberOfBands () const |
| Returns the number of bands. | |
| unsigned int | getNumberOfBlocksX (const unsigned int band) const |
| Returns the number of blocks along the X directon for the required band. | |
| unsigned int | getNumberOfBlocksY (const unsigned int band) const |
| Returns the number of blocks along the Y directon for the required band. | |
| bool | initialize (const unsigned int maxNumberRAMBlocks, const std::vector< unsigned int > &numbersOfBlocksX, const std::vector< unsigned int > &numbersOfBlocksY, const std::vector< unsigned int > &blocksSizesBytes, const unsigned long int maxDiskFilesSize) |
| Initialize this instance to an initial state. | |
| bool | isInitialized () const |
| Returns true if this instance is initialized. | |
| ~ExpansibleBandBlocksManager () | |
Protected Types | |
| typedef std::vector< std::vector< std::vector< DiskBlockInfo > > > | ActiveDiskBlocksInfoT |
| Active disk blocks info type;. | |
| typedef BlockElementT * | BlockelementPtrT |
| Block element pointer type. | |
| typedef unsigned char | BlockElementT |
| Block element type. | |
| typedef std::list< DiskBlockInfo > | InactiveDiskBlocksInfoT |
| Inactive disk blocks info type. | |
| typedef boost::shared_ptr< OpenDiskFileHandler > | OpenDiskFileHandlerPtrT |
| Open disk file pointer type. | |
| typedef std::list< OpenDiskFileHandlerPtrT > | OpenDiskFilesHandlerT |
| Open dis files handler type. | |
| typedef boost::shared_array< BlockElementT > | RAMBlockHandlerT |
| RAM Block handler type; | |
| typedef std::list< RAMBlockHandlerT > | RAMBlocksHandlerT |
| Blocks handler type;. | |
| typedef std::vector< std::vector< std::vector< BlockelementPtrT > > > | RAMBlocksPointersContainerT |
| RAM blocks pointers container type. | |
| typedef std::vector< BlockIndex3D > | SwapFifoT |
| Swap fifo type. | |
Protected Member Functions | |
| bool | allocateAndActivateDiskBlocks (const std::vector< BlockIndex3D > &blocksIndxes) |
| Allocate and activate disk blocks. | |
| bool | allocateDiskBlocks (const unsigned int blocksNumber, std::vector< DiskBlockInfo > &diskBlocksInfos, OpenDiskFilesHandlerT &diskFilesHandler) const |
| Allocate disk blocks. | |
| void | initState () |
| Initialize this instance to an initial state. | |
| template<typename ContainerType > | |
| void | shift3DCoords (ContainerType &inputContainer, const int &dim0Shift, const int &dim1Shift, const int &dim2Shift) const |
| Shift 3D coords. | |
| template<typename ContainerType > | |
| void | shiftDim03DCoords (ContainerType &inputContainer, const unsigned int dim0index, const int dim1Shift, const int dim2Shift) const |
| Shift coords given a fixed dimention 0 index. | |
Protected Attributes | |
| ActiveDiskBlocksInfoT | m_activeDiskBlocksInfo |
| 3D Matrix of active disk block info indexed as [band][blockYIndex][blockXIndex]. | |
| RAMBlocksHandlerT | m_activeRAMBlocksHandler |
| The active RAM blocks handler. | |
| unsigned char * | m_currSwapBlockPtr |
| A pointer to the current block where disk data swap will be done. | |
| OpenDiskFilesHandlerT | m_diskFilesHandler |
| The disk files handler;. | |
| bool | m_isInitialized |
| Is this instance initialized ? | |
| unsigned long int | m_maxBlockSizeBytes |
| The maximum global used block size in bytes. | |
| unsigned long int | m_maxDiskFilesSize |
| The maximum temporary disk file size (bytes). | |
| unsigned int | m_maxNumberRAMBlocks |
| The maximum number of RAM blocks;. | |
| SwapFifoT::size_type | m_nextFIFOPositionOverSwapFifo |
| The next position where a block swap will occur over m_swapFifo;. | |
| RAMBlocksPointersContainerT | m_ramBlocksPointers |
| 3D Matrix of active RAM blocks pointers indexed in the form [band][blockYIndex][blockXIndex]. | |
| RAMBlockHandlerT | m_swapBlockHandler |
| An extra block for disk swap purposes. | |
| SwapFifoT | m_swapFifo |
| Disk swapping FIFO. | |
Private Attributes | |
| unsigned char * | m_getBlockPointer_returnValue |
RAM cached and tiled raster band blocks manager.
Definition at line 53 of file ExpansibleBandBlocksManager.h.
|
protected |
Active disk blocks info type;.
Definition at line 417 of file ExpansibleBandBlocksManager.h.
|
protected |
Block element pointer type.
Definition at line 409 of file ExpansibleBandBlocksManager.h.
|
protected |
Block element type.
Definition at line 407 of file ExpansibleBandBlocksManager.h.
|
protected |
Inactive disk blocks info type.
Definition at line 419 of file ExpansibleBandBlocksManager.h.
|
protected |
Open disk file pointer type.
Definition at line 296 of file ExpansibleBandBlocksManager.h.
|
protected |
Open dis files handler type.
Definition at line 298 of file ExpansibleBandBlocksManager.h.
|
protected |
RAM Block handler type;
Definition at line 411 of file ExpansibleBandBlocksManager.h.
|
protected |
Blocks handler type;.
Definition at line 415 of file ExpansibleBandBlocksManager.h.
|
protected |
RAM blocks pointers container type.
Definition at line 413 of file ExpansibleBandBlocksManager.h.
|
protected |
Swap fifo type.
Definition at line 421 of file ExpansibleBandBlocksManager.h.
| te::mem::ExpansibleBandBlocksManager::ExpansibleBandBlocksManager | ( | ) |
| te::mem::ExpansibleBandBlocksManager::~ExpansibleBandBlocksManager | ( | ) |
| bool te::mem::ExpansibleBandBlocksManager::addBottomBands | ( | const unsigned int & | expansionSize, |
| std::vector< BlockIndex3D > & | addedBlocksCoords | ||
| ) |
New bands will be added at the bottom of the raster (after de the last band).
| expansionSize | The number of bands to add. |
| addedBlocksCoords | The added blocks coords. |
| bool te::mem::ExpansibleBandBlocksManager::addBottomBlocks | ( | const unsigned int & | expansionSize, |
| const unsigned int & | band, | ||
| std::vector< BlockIndex3D > & | addedBlocksCoords | ||
| ) |
New blocks will be added at the bottom of the raster.
| expansionSize | The expansion size over the Y direction. |
| band | The band where the operation will be performed. |
| addedBlocksCoords | The added blocks coords. |
| bool te::mem::ExpansibleBandBlocksManager::addLeftBlocks | ( | const unsigned int & | expansionSize, |
| const unsigned int & | band, | ||
| std::vector< BlockIndex3D > & | addedBlocksCoords | ||
| ) |
New blocks will be added at the left of the raster.
| expansionSize | The expansion size over the X direction. |
| band | The band where the operation will be performed. |
| addedBlocksCoords | The added blocks coords. |
| bool te::mem::ExpansibleBandBlocksManager::addRightBlocks | ( | const unsigned int & | expansionSize, |
| const unsigned int & | band, | ||
| std::vector< BlockIndex3D > & | addedBlocksCoords | ||
| ) |
New blocks will be added at the right of the raster.
| expansionSize | The expansion size over the X direction. |
| band | The band where the operation will be performed. |
| addedBlocksCoords | The added blocks coords. |
| bool te::mem::ExpansibleBandBlocksManager::addTopBands | ( | const unsigned int & | expansionSize, |
| std::vector< BlockIndex3D > & | addedBlocksCoords | ||
| ) |
New bands will be added at the top of the raster (before the first band).
| expansionSize | The number of bands to add. |
| addedBlocksCoords | The added blocks coords. |
| bool te::mem::ExpansibleBandBlocksManager::addTopBlocks | ( | const unsigned int & | expansionSize, |
| const unsigned int & | band, | ||
| std::vector< BlockIndex3D > & | addedBlocksCoords | ||
| ) |
New blocks will be added at the top of the raster.
| expansionSize | The expansion size over the Y direction. |
| band | The band where the operation will be performed. |
| addedBlocksCoords | The added blocks coords. |
|
protected |
Allocate and activate disk blocks.
| blocksIndxes | The blocks indexes inside the internal 3D indexing matrices. |
|
protected |
Allocate disk blocks.
| blocksNumber | The number of blocks to allocate. |
| diskBlocksInfos | The info for the allocated blocks. |
| diskFilesHandler | The file handlers for all the allocated blocks. |
| void te::mem::ExpansibleBandBlocksManager::free | ( | ) |
Free all allocated internal resources and go back to the initial state.
| void * te::mem::ExpansibleBandBlocksManager::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). |
|
inline |
Returns the internal size( bytes ) used for all internal blocks.
Definition at line 159 of file ExpansibleBandBlocksManager.h.
|
inline |
The maximum number of cache blocks.
Definition at line 179 of file ExpansibleBandBlocksManager.h.
|
inline |
Returns the number of bands.
Definition at line 149 of file ExpansibleBandBlocksManager.h.
|
inline |
Returns the number of blocks along the X directon for the required band.
| band | The required band. |
Definition at line 123 of file ExpansibleBandBlocksManager.h.
|
inline |
Returns the number of blocks along the Y directon for the required band.
| band | The required band. |
Definition at line 137 of file ExpansibleBandBlocksManager.h.
| bool te::mem::ExpansibleBandBlocksManager::initialize | ( | const unsigned int | maxNumberRAMBlocks, |
| const std::vector< unsigned int > & | numbersOfBlocksX, | ||
| const std::vector< unsigned int > & | numbersOfBlocksY, | ||
| const std::vector< unsigned int > & | blocksSizesBytes, | ||
| const unsigned long int | maxDiskFilesSize | ||
| ) |
Initialize this instance to an initial state.
| maxNumberRAMBlocks | The maximum number of RAM blocks. |
| numbersOfBlocksX | The number of blocks along the X directon (for each band). |
| numbersOfBlocksY | The number of blocks along the Y directon (for each band). |
| blocksSizesBytes | The blocks sizes in bytes (for each band). |
| maxDiskFilesSize | The maximum temporary disk file size (if required). |
|
protected |
Initialize this instance to an initial state.
|
inline |
Returns true if this instance is initialized.
Definition at line 111 of file ExpansibleBandBlocksManager.h.
|
inlineprotected |
Shift 3D coords.
| inputContainer | The input coords container. |
| dim0Shift | The shift to be done over the dimension 0. |
| dim1Shift | The shift to be done over the dimension 1. |
| dim2Shift | The shift to be done over the dimension 2. |
Definition at line 379 of file ExpansibleBandBlocksManager.h.
References te::mem::ExpansibleBandBlocksManager::BlockIndex3D::m_dim0Index.
|
inlineprotected |
Shift coords given a fixed dimention 0 index.
| inputContainer | The input coords container. |
| dim0index | The dimension 0 fixed index. |
| dim1Shift | The shift to be done over the dimension 1. |
| dim2Shift | The shift to be done over the dimension 2. |
Definition at line 342 of file ExpansibleBandBlocksManager.h.
References te::mem::ExpansibleBandBlocksManager::BlockIndex3D::m_dim1Index.
|
protected |
3D Matrix of active disk block info indexed as [band][blockYIndex][blockXIndex].
Definition at line 441 of file ExpansibleBandBlocksManager.h.
|
protected |
The active RAM blocks handler.
Definition at line 435 of file ExpansibleBandBlocksManager.h.
|
protected |
A pointer to the current block where disk data swap will be done.
Definition at line 431 of file ExpansibleBandBlocksManager.h.
|
protected |
The disk files handler;.
Definition at line 443 of file ExpansibleBandBlocksManager.h.
|
private |
Definition at line 450 of file ExpansibleBandBlocksManager.h.
|
protected |
Is this instance initialized ?
Definition at line 423 of file ExpansibleBandBlocksManager.h.
|
protected |
The maximum global used block size in bytes.
Definition at line 429 of file ExpansibleBandBlocksManager.h.
|
protected |
The maximum temporary disk file size (bytes).
Definition at line 427 of file ExpansibleBandBlocksManager.h.
|
protected |
The maximum number of RAM blocks;.
Definition at line 425 of file ExpansibleBandBlocksManager.h.
|
protected |
The next position where a block swap will occur over m_swapFifo;.
Definition at line 433 of file ExpansibleBandBlocksManager.h.
|
protected |
3D Matrix of active RAM blocks pointers indexed in the form [band][blockYIndex][blockXIndex].
Definition at line 437 of file ExpansibleBandBlocksManager.h.
|
protected |
An extra block for disk swap purposes.
Definition at line 445 of file ExpansibleBandBlocksManager.h.
|
protected |
Disk swapping FIFO.
Definition at line 439 of file ExpansibleBandBlocksManager.h.