bioformats  5.1.6
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ome::bioformats::TileCache Class Reference

Tile cache. More...

#include <ome/bioformats/TileCache.h>

+ Collaboration diagram for ome::bioformats::TileCache:

Public Types

typedef dimension_size_type key_type
 Tile index type.
 
typedef ome::compat::shared_ptr< TileBuffervalue_type
 Tile buffer type.
 

Public Member Functions

 TileCache ()
 Constructor.
 
virtual ~TileCache ()
 Destructor.
 
bool insert (key_type tileindex, value_type tilebuffer)
 Insert a tile into the tile cache. More...
 
void erase (key_type tileindex)
 Remove a tile from the tile cache. More...
 
value_type find (key_type tileindex)
 Find a tile in the tile cache. More...
 
const value_type find (key_type tileindex) const
 Find a tile in the tile cache. More...
 
dimension_size_type size () const
 Get the tile cache size. More...
 
void clear ()
 Clear the tile cache.
 
value_typeoperator[] (key_type tileindex)
 Get a tile from the tile cache. More...
 

Private Member Functions

 TileCache (const TileCache &)
 Copy constructor (deleted).
 
TileCacheoperator= (const TileCache &)
 Assignment operator (deleted).
 

Private Attributes

std::map< key_type, value_typecache
 Mapping of tile number to tile buffer.
 

Detailed Description

Tile cache.

This is a collection of TileBuffer objects indexed by tile number.

Member Function Documentation

void ome::bioformats::TileCache::erase ( key_type  tileindex)

Remove a tile from the tile cache.

Parameters
tileindexthe tile to remove.

References cache.

TileCache::value_type ome::bioformats::TileCache::find ( key_type  tileindex)

Find a tile in the tile cache.

Parameters
tileindexthe tile index to find.
Returns
the tile buffer corresponding to the specified index. If the tile index was not found, this will be null.

References cache.

const TileCache::value_type ome::bioformats::TileCache::find ( key_type  tileindex) const

Find a tile in the tile cache.

Parameters
tileindexthe tile index to find.
Returns
the tile buffer corresponding to the specified tile index. If the tile index was not found, this will be null.

References cache.

bool ome::bioformats::TileCache::insert ( key_type  tileindex,
value_type  tilebuffer 
)

Insert a tile into the tile cache.

The tile index must not already be present in the tile cache. If it is already present, the insert will fail.

The tilebuffer must not be null. If the tilebuffer is null the insert will fail.

Parameters
tileindexthe tile index of the tile buffer.
tilebufferthe buffered tile pixel data.
Returns
true if the insert succeeded, false otherwise.

References cache.

TileCache::value_type & ome::bioformats::TileCache::operator[] ( key_type  tileindex)

Get a tile from the tile cache.

If the tile index is not found, it will be inserted into the cache with a null tile buffer; since this is returned by reference it may be assigned a new tile buffer directly.

Parameters
tileindexthe tile index to get.
Returns
the tile buffer corresponding to the specified tile index. If the tile index was not found, this will be null.

References cache.

dimension_size_type ome::bioformats::TileCache::size ( ) const

Get the tile cache size.

Returns
the tile cache size.

References cache.


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