libosmscout 0.1
Loading...
Searching...
No Matches
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.
 
MapTileCache< T >::TRef GetCachedTile (const TileKey &key) const
 Return the cache tiles with the given id.
 
MapTileCache< T >::TRef GetTile (const TileKey &key) const
 Return the tile with the given id.
 
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.
 
 MapTileCache (size_t cacheSize)
 Create a new tile cache with the given cache size.
 
void SetSize (size_t cacheSize)
 Change the size of the cache.
 

Member Typedef Documentation

◆ TRef

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

Constructor & Destructor Documentation

◆ MapTileCache()

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

Create a new tile cache with the given cache size.

Member Function Documentation

◆ CleanupCache()

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.

◆ GetCachedTile()

template<class T >
MapTileCache< T >::TRef osmscout::MapTileCache< T >::GetCachedTile ( const TileKey &  key) const

Return the cache tiles with the given id.

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

◆ GetTile()

template<class T >
MapTileCache< T >::TRef osmscout::MapTileCache< T >::GetTile ( const TileKey &  key) 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.

◆ GetTilesForBoundingBox()

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::GeoBox::GetMaxCoord(), osmscout::GeoBox::GetMinCoord(), and osmscout::TileId::GetTile().

◆ SetSize()

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: