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;
 
  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 ),
 
unsigned int m_y
Block index over the Y axis.
 
unsigned int m_b
Block band index.
 
unsigned int m_x
Block index over the X axis.
 
Internal read/write thread execution parameters.
 
unsigned char * m_exchangeBlockPtr
Exchange block pointer.
 
unsigned int m_dataPrefetchThreshold
The user defined read-ahead threshold.
 
unsigned int m_blockB
Raster block band index.
 
boost::condition_variable m_doTaskCondVar
Used by the thread when awakenning to perform some task.
 
te::rst::Raster * m_rasterPtr
External raster pointer.
 
unsigned int m_blockY
Raster block Y index.
 
boost::mutex m_doTaskMutex
Used when wakenning the thread to perform some task.
 
unsigned int m_blockX
Raster block X index.
 
bool m_taskFinished
true when the thread has finished the required task.
 
boost::scoped_array< unsigned char > m_threadDataBlockHandler
A extra block used in exchange when a read-ahead task is performed.
 
boost::condition_variable m_taskFinishedCondVar
Used to wait for the required task finishment.
 
unsigned char * m_blockPtr
Input block pointer.
 
TaskType m_task
The required task to be performed (read/write/exit).
 
boost::mutex m_taskFinishedMutex
used by the thread to inform a task finishment.
 
RAM cached and tiled raster band blocks manager.
 
unsigned int m_globalBlockSizeBytes
The maximum block size for all bands.
 
unsigned char * m_getBlockPointer_BlkPtr
 
~CachedBandBlocksManager()
 
std::unique_ptr< boost::thread > m_threadHandler
The internal thread handler.
 
std::vector< unsigned char * > m_blocksHandler
Cache blocks handler.
 
static void threadEntry(ThreadParameters *paramsPtr)
Thread entry.
 
bool initialize(const unsigned int maxNumberOfCacheBlocks, const te::rst::Raster &externalRaster, const unsigned int dataPrefetchThreshold)
Initialize this instance to an initial state.
 
unsigned int getDataPrefetchThreshold() const
The read-ahead data prefetch threshold.
 
unsigned int m_globalBlocksNumberX
The maximum number of blocks (X axis) for all bands.
 
bool isInitialized() const
Returns true if this instance is initialized.
 
unsigned int m_blocksFifoNextSwapBlockIndex
The next block swapp index over m_blocksFifo.
 
unsigned int m_globalBlocksNumberY
The maximum number of blocks (Y axis) for all bands.
 
void * getBlockPointer(unsigned int band, unsigned int x, unsigned int y)
Returns a pointer to the required data block.
 
std::vector< std::vector< std::vector< unsigned char * > > > m_blocksPointers
3D Matrix of block pointers indexed as [band][blockYIndex][blockXIndex].
 
te::rst::Raster * getRaster() const
Returns the associated raster.
 
unsigned int m_dataPrefetchThreshold
The read-ahead data prefetch threshold (0-will disable prefetch, 1-data always prefetched,...
 
CachedBandBlocksManager()
 
te::rst::Raster * m_rasterPtr
External raster pointer.
 
ThreadParameters m_threadParams
The internal thread execution parameters.
 
void initState()
Initialize this instance to an initial state.
 
bool initialize(const te::rst::Raster &externalRaster, const unsigned char maxMemPercentUsed, const unsigned int dataPrefetchThreshold)
Initialize this instance to an initial state.
 
std::vector< BlockIndex > m_blocksFifo
blocks swap FIFO.
 
unsigned int m_maxNumberOfCacheBlocks
The maximum number of cache blocks.
 
unsigned int getMaxNumberOfCacheBlocks() const
The maximum number of cache blocks.
 
An abstract class for raster data strucutures.
 
#define TEMEMORYEXPORT
You can use this macro in order to export/import classes and functions from this module.
 
Proxy configuration file for TerraView (see terraview_config.h).