te::rst::RasterSynchronizer Class Reference

An access synchronizer to be used in SynchronizedRaster raster instances. More...

#include <RasterSynchronizer.h>

Inheritance diagram for te::rst::RasterSynchronizer:

Public Member Functions

 RasterSynchronizer (Raster &raster, const te::common::AccessPolicy policy)
 Constructor. More...
 
 ~RasterSynchronizer ()
 

Protected Types

typedef std::vector< std::vector< std::vector< unsigned int > > > BlocksUseCounterT
 Blocks use counter type definition. More...
 

Protected Member Functions

bool acquireBlock (const unsigned int bandIdx, const unsigned int blockXIndex, const unsigned int blockYIndex, void *blkDataPtr)
 Acquire a raster data block. More...
 
bool releaseBlock (const unsigned int bandIdx, const unsigned int blockXIndex, const unsigned int blockYIndex, void *blkDataPtr)
 Release a raster data block. More...
 

Protected Attributes

BlocksUseCounterT m_blocksUseCounters
 blocks use counter. More...
 
boost::condition_variable_any m_condVar
 Block use request sync variable. More...
 
boost::mutex m_mutex
 General sync mutex;. More...
 
te::common::AccessPolicy m_policy
 The access policy used on the given input raster. More...
 
Rasterm_raster
 The input raster. More...
 

Friends

class SynchronizedBand
 
class SynchronizedBandBlocksManager
 
class SynchronizedRaster
 

Detailed Description

An access synchronizer to be used in SynchronizedRaster raster instances.

Definition at line 57 of file RasterSynchronizer.h.

Member Typedef Documentation

typedef std::vector< std::vector< std::vector< unsigned int > > > te::rst::RasterSynchronizer::BlocksUseCounterT
protected

Blocks use counter type definition.

Note
Indexed as [band][blockYIndex][blockXIndex]

Definition at line 82 of file RasterSynchronizer.h.

Constructor & Destructor Documentation

te::rst::RasterSynchronizer::RasterSynchronizer ( Raster raster,
const te::common::AccessPolicy  policy 
)

Constructor.

Parameters
rasterThe raster to synchronize.
policyThe access policy to use on the given input raster.
te::rst::RasterSynchronizer::~RasterSynchronizer ( )

Member Function Documentation

bool te::rst::RasterSynchronizer::acquireBlock ( const unsigned int  bandIdx,
const unsigned int  blockXIndex,
const unsigned int  blockYIndex,
void *  blkDataPtr 
)
protected

Acquire a raster data block.

Parameters
bandIdxBlock band index.
blockXIndexBlock X index.
blockYIndexBlock Y index.
blkDataPtrA pointer to a pre-allocated area where the block data will be written.
Returns
true if OK, false if the increment could not be done.
Note
The block data will be read from the internal raster and the block use counter will be incremented.
bool te::rst::RasterSynchronizer::releaseBlock ( const unsigned int  bandIdx,
const unsigned int  blockXIndex,
const unsigned int  blockYIndex,
void *  blkDataPtr 
)
protected

Release a raster data block.

Parameters
bandIdxBlock band index.
blockXIndexBlock X index.
blockYIndexBlock Y index.
blkDataPtrA pointer where the block data will be read.
Note
The block data will be writed to the internal raster and the block use counter will be decremented.
Returns
true if OK, false if the increment could not be done.

Friends And Related Function Documentation

friend class SynchronizedBand
friend

Definition at line 60 of file RasterSynchronizer.h.

friend class SynchronizedBandBlocksManager
friend

Definition at line 59 of file RasterSynchronizer.h.

friend class SynchronizedRaster
friend

Definition at line 61 of file RasterSynchronizer.h.

Member Data Documentation

BlocksUseCounterT te::rst::RasterSynchronizer::m_blocksUseCounters
protected

blocks use counter.

Definition at line 92 of file RasterSynchronizer.h.

boost::condition_variable_any te::rst::RasterSynchronizer::m_condVar
protected

Block use request sync variable.

Definition at line 90 of file RasterSynchronizer.h.

boost::mutex te::rst::RasterSynchronizer::m_mutex
protected

General sync mutex;.

Definition at line 88 of file RasterSynchronizer.h.

te::common::AccessPolicy te::rst::RasterSynchronizer::m_policy
protected

The access policy used on the given input raster.

Definition at line 84 of file RasterSynchronizer.h.

Raster& te::rst::RasterSynchronizer::m_raster
protected

The input raster.

Definition at line 86 of file RasterSynchronizer.h.


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