alaCarte Maps
Renderer for OpenStreetMap tiles
|
#include <cache.hpp>
Public Types | |
typedef std::list< shared_ptr< Tile > > | TileList |
A list that will store the last recently used tiles. More... | |
typedef std::pair< shared_ptr< Tile >, TileList::iterator > | CacheElement |
An element stored in the cache. More... | |
typedef boost::unordered_map< TileIdentifier, CacheElement > | CacheOfOneStylesheet |
HashMap with TileIdentifier as key and shared_ptr to Tiles as value. More... | |
typedef boost::unordered_map< string, shared_ptr< CacheOfOneStylesheet > > | CacheContainer |
HashMap with path to MapCSS as key and shared_ptr to CacheOfOneStylesheet as value. More... | |
Public Member Functions | |
Cache (const shared_ptr< Configuration > &config) | |
This file is part of alaCarte. More... | |
TESTABLE shared_ptr< Tile > | getTile (const shared_ptr< TileIdentifier > &tl) |
Gets a Tile where the image data can be stored. More... | |
TESTABLE shared_ptr< Tile > | getDefaultTile () |
Get the default tile used for error and such. More... | |
TESTABLE void | deleteTiles (const string path) |
Deletes all cached Tiles of the Stylesheet with the given path. More... | |
Private Member Functions | |
void | readFile (const Tile::ImageType &image, const boost::filesystem::path &filename) |
void | writeFile (shared_ptr< Tile > tile, const boost::filesystem::path &filename) |
const boost::filesystem::path | getTilePath (const shared_ptr< TileIdentifier > &ti) |
Private Attributes | |
shared_ptr< Configuration > | Config |
boost::mutex | GlobalCacheLock |
CacheContainer | AllCaches |
TileList | RecentlyUsedList |
shared_ptr< Tile > | DefaultTile |
typedef boost::unordered_map<string, shared_ptr<CacheOfOneStylesheet> > Cache::CacheContainer |
typedef std::pair<shared_ptr<Tile>, TileList::iterator> Cache::CacheElement |
typedef boost::unordered_map<TileIdentifier, CacheElement> Cache::CacheOfOneStylesheet |
HashMap with TileIdentifier as key and shared_ptr to Tiles as value.
typedef std::list<shared_ptr<Tile> > Cache::TileList |
Cache::Cache | ( | const shared_ptr< Configuration > & | config | ) |
This file is part of alaCarte.
alaCarte is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
alaCarte is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with alaCarte. If not, see http://www.gnu.org/licenses/.
Copyright alaCarte 2012-2013 Simon Dreher, Florian Jacob, Tobias Kahlert, Patrick Niklaus, Bernhard Scheirle, Lisa Winter Maintainer: Simon Dreher
void Cache::deleteTiles | ( | const string | path | ) |
Deletes all cached Tiles of the Stylesheet with the given path.
path | The path to the stylesheet. |
shared_ptr< Tile > Cache::getDefaultTile | ( | ) |
shared_ptr< Tile > Cache::getTile | ( | const shared_ptr< TileIdentifier > & | ti | ) |
|
private |
|
private |
|
private |
|
private |
|
private |