ome-files 0.2.2

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

Tile cache. More...

`#include <ome/files/TileCache.h>`

Collaboration diagram for ome::files::TileCache:
[legend]

## 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.

## Detailed Description

Tile cache.

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

## Member Function Documentation

## § erase()

void ome::files::TileCache::erase | ( | key_type | tileindex | ) |

Remove a tile from the tile cache.

Parameters

  tileindex | the tile to remove.

References cache.

## § find() [1/2]

TileCache::value_type ome::files::TileCache::find | ( | key_type | tileindex | ) |

Find a tile in the tile cache.

Parameters

  tileindex | the 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.

## § find() [2/2]

const TileCache::value_type ome::files::TileCache::find | ( | key_type | tileindex | ) | const

Find a tile in the tile cache.

Parameters

  tileindex | the 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.

## § insert()

bool ome::files::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

  tileindex | the tile index of the tile buffer.
  tilebuffer | the buffered tile pixel data.

Returns
  `true` if the insert succeeded, `false` otherwise.

References cache.

## § operator[]()

TileCache::value_type & ome::files::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

  tileindex | the 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.

## § size()

dimension_size_type ome::files::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:

- ome/files/TileCache.h
- ome/files/TileCache.cpp