libosmscout  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
osmscout::MapTileCache< T > Class Template Reference

#include <MapTileCache.h>

Public Types

typedef std::shared_ptr< T > TRef
 

Public Member Functions

void CleanupCache ()
 Cleanup the cache. More...
 
MapTileCache< T >::TRef GetCachedTile (const TileId &id) const
 Return the cache tiles with the given id. More...
 
MapTileCache< T >::TRef GetTile (const TileId &id) const
 Return the tile with the given id. More...
 
void GetTilesForBoundingBox (const Magnification &magnification, const GeoBox &boundingBox, std::list< typename MapTileCache< T >::TRef > &tiles) const
 Return all tile necessary for covering the given boundingbox using the given magnification. More...
 
 MapTileCache (size_t cacheSize)
 Create a new tile cache with the given cache size. More...
 
void SetSize (size_t cacheSize)
 Change the size of the cache. More...
 

Member Typedef Documentation

template<class T>
typedef std::shared_ptr<T> osmscout::MapTileCache< T >::TRef

Constructor & Destructor Documentation

template<class T >
osmscout::MapTileCache< T >::MapTileCache ( size_t  cacheSize)

Create a new tile cache with the given cache size.

Member Function Documentation

template<class T >
void osmscout::MapTileCache< T >::CleanupCache ( )

Cleanup the cache.

Free least recently used tiles until the given maximum cache size is reached again.

template<class T >
MapTileCache< T >::TRef osmscout::MapTileCache< T >::GetCachedTile ( const TileId id) const

Return the cache tiles with the given id.

If the tiles is not cache, an empty reference will be returned.

template<class T >
MapTileCache< T >::TRef osmscout::MapTileCache< T >::GetTile ( const TileId id) const

Return the tile with the given id.

If the tile is not currently cached return an empty and unassigned tile and move it to the front of the cache.

template<class T >
void osmscout::MapTileCache< T >::GetTilesForBoundingBox ( const Magnification magnification,
const GeoBox &  boundingBox,
std::list< typename MapTileCache< T >::TRef > &  tiles 
) const

Return all tile necessary for covering the given boundingbox using the given magnification.

References osmscout::cellDimension, osmscout::Magnification::GetLevel(), osmscout::CellDimension::height, and osmscout::CellDimension::width.

template<class T >
void osmscout::MapTileCache< T >::SetSize ( size_t  cacheSize)

Change the size of the cache.

Cache will be cleaned immediately.


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