27 #include <boost/thread/mutex.hpp> 28 #include <boost/unordered_map.hpp> 29 #include <boost/filesystem.hpp> 50 typedef std::pair<shared_ptr<Tile>, TileList::iterator>
CacheElement;
60 typedef boost::unordered_map<string, shared_ptr<CacheOfOneStylesheet> >
CacheContainer;
65 TESTABLE shared_ptr<Tile>
getTile(
const shared_ptr<TileIdentifier>& tl);
76 void writeFile(shared_ptr<Tile> tile,
const boost::filesystem::path& filename);
77 const boost::filesystem::path
getTilePath(
const shared_ptr<TileIdentifier>& ti);
void readFile(const Tile::ImageType &image, const boost::filesystem::path &filename)
Cache(const shared_ptr< Configuration > &config)
This file is part of alaCarte.
A Stylesheet parses a given MapCSS Stylesheet file and stores the defined rules.
const boost::filesystem::path getTilePath(const shared_ptr< TileIdentifier > &ti)
boost::unordered_map< TileIdentifier, CacheElement > CacheOfOneStylesheet
HashMap with TileIdentifier as key and shared_ptr to Tiles as value.
shared_ptr< Tile > DefaultTile
TileList RecentlyUsedList
TESTABLE shared_ptr< Tile > getDefaultTile()
Get the default tile used for error and such.
std::list< shared_ptr< Tile > > TileList
A list that will store the last recently used tiles.
TESTABLE void deleteTiles(const string path)
Deletes all cached Tiles of the Stylesheet with the given path.
boost::unordered_map< string, shared_ptr< CacheOfOneStylesheet > > CacheContainer
HashMap with path to MapCSS as key and shared_ptr to CacheOfOneStylesheet as value.
static const char * config
Option to get the configuration filename (type: string)
shared_ptr< Configuration > Config
Represents a set of options accessible via strings.
shared_ptr< std::vector< uint8_t > > ImageType
std::pair< shared_ptr< Tile >, TileList::iterator > CacheElement
An element stored in the cache.
boost::mutex GlobalCacheLock
void writeFile(shared_ptr< Tile > tile, const boost::filesystem::path &filename)
TESTABLE shared_ptr< Tile > getTile(const shared_ptr< TileIdentifier > &tl)
Gets a Tile where the image data can be stored.