bioformats
5.1.0
|
Tile cache. More...
#include <ome/bioformats/TileCache.h>
Public Types | |
typedef dimension_size_type | key_type |
Tile index type. | |
typedef ome::compat::shared_ptr< TileBuffer > | value_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_type & | operator[] (key_type tileindex) |
Get a tile from the tile cache. More... | |
Private Member Functions | |
TileCache (const TileCache &) | |
Copy constructor (deleted). | |
TileCache & | operator= (const TileCache &) |
Assignment operator (deleted). | |
Private Attributes | |
std::map< key_type, value_type > | cache |
Mapping of tile number to tile buffer. | |
Tile cache.
This is a collection of TileBuffer objects indexed by tile number.
void ome::bioformats::TileCache::erase | ( | key_type | tileindex | ) |
TileCache::value_type ome::bioformats::TileCache::find | ( | key_type | tileindex | ) |
Find a tile in the tile cache.
tileindex | the tile index to find. |
References cache.
const TileCache::value_type ome::bioformats::TileCache::find | ( | key_type | tileindex | ) | const |
Find a tile in the tile cache.
tileindex | the tile index to find. |
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.
tileindex | the tile index of the tile buffer. |
tilebuffer | the buffered tile pixel data. |
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.
tileindex | the tile index to get. |
References cache.
dimension_size_type ome::bioformats::TileCache::size | ( | ) | const |