use util::ptr as a wrapper around std::shared_ptr that asserts nonemptiness

This commit is contained in:
Konstantin Käfer
2014-09-16 16:38:32 +02:00
parent 6c526e5637
commit f26bb724dc
60 changed files with 237 additions and 214 deletions

View File

@@ -14,7 +14,7 @@ VectorTileData::VectorTileData(Tile::ID id, Map &map, const SourceInfo &source)
}
VectorTileData::~VectorTileData() {
std::shared_ptr<GlyphAtlas> glyphAtlas = map.getGlyphAtlas();
util::ptr<GlyphAtlas> glyphAtlas = map.getGlyphAtlas();
if (glyphAtlas) {
glyphAtlas->removeGlyphs(id.to_uint64());
}
@@ -52,7 +52,7 @@ void VectorTileData::afterParse() {
parser.reset();
}
void VectorTileData::render(Painter &painter, std::shared_ptr<StyleLayer> layer_desc, const mat4 &matrix) {
void VectorTileData::render(Painter &painter, util::ptr<StyleLayer> layer_desc, const mat4 &matrix) {
if (state == State::parsed && layer_desc->bucket) {
auto databucket_it = buckets.find(layer_desc->bucket->name);
if (databucket_it != buckets.end()) {
@@ -62,7 +62,7 @@ void VectorTileData::render(Painter &painter, std::shared_ptr<StyleLayer> layer_
}
}
bool VectorTileData::hasData(std::shared_ptr<StyleLayer> layer_desc) const {
bool VectorTileData::hasData(util::ptr<StyleLayer> layer_desc) const {
if (state == State::parsed && layer_desc->bucket) {
auto databucket_it = buckets.find(layer_desc->bucket->name);
if (databucket_it != buckets.end()) {