[core] move TileData and dependents to new *TileID classes

This commit is contained in:
Konstantin Käfer
2016-05-10 11:47:54 +02:00
parent bdcbceff80
commit ec70125e41
43 changed files with 181 additions and 155 deletions

View File

@@ -15,11 +15,9 @@ void TileCache::setSize(size_t size_) {
}
assert(orderedKeys.size() <= size);
tiles.reserve(size);
}
void TileCache::add(uint64_t key, std::shared_ptr<TileData> data) {
void TileCache::add(const OverscaledTileID& key, std::shared_ptr<TileData> data) {
// insert new or query existing data
if (tiles.emplace(key, data).second) {
@@ -38,7 +36,7 @@ void TileCache::add(uint64_t key, std::shared_ptr<TileData> data) {
assert(orderedKeys.size() <= size);
};
std::shared_ptr<TileData> TileCache::get(uint64_t key) {
std::shared_ptr<TileData> TileCache::get(const OverscaledTileID& key) {
std::shared_ptr<TileData> data;
@@ -53,7 +51,7 @@ std::shared_ptr<TileData> TileCache::get(uint64_t key) {
return data;
};
bool TileCache::has(uint64_t key) {
bool TileCache::has(const OverscaledTileID& key) {
return tiles.find(key) != tiles.end();
}