26 #ifndef __TERRALIB_MEMORY_INTERNAL_CACHEDBANDBLOCKSMANAGER_H
27 #define __TERRALIB_MEMORY_INTERNAL_CACHEDBANDBLOCKSMANAGER_H
30 #include "../raster/Raster.h"
38 #include <boost/noncopyable.hpp>
39 #include <boost/thread.hpp>
40 #include <boost/scoped_array.hpp>
71 const unsigned char maxMemPercentUsed,
72 const unsigned int dataPrefetchThreshold );
85 bool initialize(
const unsigned int maxNumberOfCacheBlocks,
87 const unsigned int dataPrefetchThreshold );
96 return m_rasterPtr ?
true :
false;
113 void* getBlockPointer(
unsigned int band,
unsigned int x,
unsigned int y );
125 return m_maxNumberOfCacheBlocks;
131 return m_dataPrefetchThreshold;
150 : m_b( 0 ), m_y( 0 ), m_x( 0 )
206 m_dataPrefetchThreshold( 0 ),
207 m_taskFinished( false ),
208 m_task( InvalidTaskT ),
210 m_exchangeBlockPtr( 0 ),
263 #endif // __TERRALIB_MEMORY_INTERNAL_CACHEDBANDBLOCKSMANAGER_H
boost::mutex m_taskFinishedMutex
used by the thread to inform a task finishment.
#define TEMEMORYEXPORT
You can use this macro in order to export/import classes and functions from this module.
unsigned int m_globalBlocksNumberX
The maximum number of blocks (X axis) for all bands.
unsigned int getDataPrefetchThreshold() const
The read-ahead data prefetch threshold.
Internal read/write thread execution parameters.
unsigned int m_globalBlockSizeBytes
The maximum block size for all bands.
std::auto_ptr< boost::thread > m_threadHandler
The internal thread handler.
bool m_taskFinished
true when the thread has finished the required task.
unsigned int m_b
Block band index.
unsigned int m_dataPrefetchThreshold
The user defined read-ahead threshold.
boost::scoped_array< unsigned char > m_threadDataBlockHandler
A extra block used in exchange when a read-ahead task is performed.
te::rst::Raster * getRaster() const
Returns the associated raster.
unsigned int m_x
Block index over the X axis.
Configuration flags for the TerraLib In-memory Data Access driver.
unsigned int m_y
Block index over the Y axis.
unsigned int m_blockB
Raster block band index.
unsigned int m_blockY
Raster block Y index.
te::rst::Raster * m_rasterPtr
External raster pointer.
An abstract class for raster data strucutures.
ThreadParameters m_threadParams
The internal thread execution parameters.
unsigned int m_maxNumberOfCacheBlocks
The maximum number of cache blocks.
unsigned int m_globalBlocksNumberY
The maximum number of blocks (Y axis) for all bands.
std::vector< std::vector< std::vector< unsigned char * > > > m_blocksPointers
3D Matrix of block pointers indexed as [band][blockYIndex][blockXIndex].
te::rst::Raster * m_rasterPtr
External raster pointer.
bool isInitialized() const
Returns true if this instance is initialized.
unsigned int m_blockX
Raster block X index.
unsigned int m_dataPrefetchThreshold
The read-ahead data prefetch threshold (0-will disable prefetch, 1-data always prefetched, higher values will do prefetch when necessary).
unsigned int m_blocksFifoNextSwapBlockIndex
The next block swapp index over m_blocksFifo.
unsigned char * m_blockPtr
Input block pointer.
unsigned char * m_getBlockPointer_BlkPtr
unsigned char * m_exchangeBlockPtr
Exchange block pointer.
boost::condition_variable m_taskFinishedCondVar
Used to wait for the required task finishment.
std::vector< BlockIndex > m_blocksFifo
blocks swap FIFO.
std::vector< unsigned char * > m_blocksHandler
Cache blocks handler.
RAM cached and tiled raster band blocks manager.
TaskType m_task
The required task to be performed (read/write/exit).
boost::mutex m_doTaskMutex
Used when wakenning the thread to perform some task.
unsigned int getMaxNumberOfCacheBlocks() const
The maximum number of cache blocks.
boost::condition_variable m_doTaskCondVar
Used by the thread when awakenning to perform some task.