te::rst::RasterSynchronizer Class Reference

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

#include <RasterSynchronizer.h>

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...
 
std::condition_variable_any m_condVar
 Block use request sync variable. More...
 
std::mutex m_mutex
 General sync mutex;. More...
 
te::common::AccessPolicy m_policy
 The access policy used on the given input raster. More...
 
Rasterm_rasterPtr
 The input raster. More...
 

Private Member Functions

 RasterSynchronizer ()
 
 RasterSynchronizer (const RasterSynchronizer &other)
 

Friends

class SynchronizedBand
 
class SynchronizedBandBlocksManager
 
class SynchronizedRaster
 

Detailed Description

An access synchronizer to be used in SynchronizedRaster raster instances.

Definition at line 54 of file RasterSynchronizer.h.

Member Typedef Documentation

◆ BlocksUseCounterT

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 79 of file RasterSynchronizer.h.

Constructor & Destructor Documentation

◆ RasterSynchronizer() [1/3]

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.

◆ ~RasterSynchronizer()

te::rst::RasterSynchronizer::~RasterSynchronizer ( )

◆ RasterSynchronizer() [2/3]

te::rst::RasterSynchronizer::RasterSynchronizer ( )
inlineprivate

Definition at line 119 of file RasterSynchronizer.h.

◆ RasterSynchronizer() [3/3]

te::rst::RasterSynchronizer::RasterSynchronizer ( const RasterSynchronizer other)
inlineprivate

Definition at line 120 of file RasterSynchronizer.h.

Member Function Documentation

◆ acquireBlock()

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.

◆ releaseBlock()

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

◆ SynchronizedBand

friend class SynchronizedBand
friend

Definition at line 57 of file RasterSynchronizer.h.

◆ SynchronizedBandBlocksManager

friend class SynchronizedBandBlocksManager
friend

Definition at line 56 of file RasterSynchronizer.h.

◆ SynchronizedRaster

friend class SynchronizedRaster
friend

Definition at line 58 of file RasterSynchronizer.h.

Member Data Documentation

◆ m_blocksUseCounters

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

blocks use counter.

Definition at line 89 of file RasterSynchronizer.h.

◆ m_condVar

std::condition_variable_any te::rst::RasterSynchronizer::m_condVar
protected

Block use request sync variable.

Definition at line 87 of file RasterSynchronizer.h.

◆ m_mutex

std::mutex te::rst::RasterSynchronizer::m_mutex
protected

General sync mutex;.

Definition at line 85 of file RasterSynchronizer.h.

◆ m_policy

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

The access policy used on the given input raster.

Definition at line 81 of file RasterSynchronizer.h.

◆ m_rasterPtr

Raster* te::rst::RasterSynchronizer::m_rasterPtr
protected

The input raster.

Definition at line 83 of file RasterSynchronizer.h.


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