Remove indirection

This commit is contained in:
John Firebaugh
2015-06-04 19:07:48 -07:00
parent 217c376291
commit 875ef979be
4 changed files with 17 additions and 68 deletions

View File

@@ -14,20 +14,18 @@ LiveTileData::LiveTileData(const TileID& id_,
const SourceInfo& source_,
float angle_,
bool collisionDebug_)
: VectorTileData::VectorTileData(id_, style_, source_, angle_, collisionDebug_),
: VectorTileData(id_, style_, source_, angle_, collisionDebug_),
annotationManager(annotationManager_) {
// live features are always ready
setState(State::loaded);
// live features are always loaded
state = State::loaded;
}
LiveTileData::~LiveTileData() {
// Cancel in most derived class destructor so that worker tasks are joined before
// any member data goes away.
cancel();
}
bool LiveTileData::reparse(Worker&, std::function<void()> callback) {
if (!mayStartParsing()) {
if (parsing.test_and_set(std::memory_order_acquire)) {
return false;
}
@@ -39,7 +37,7 @@ bool LiveTileData::reparse(Worker&, std::function<void()> callback) {
const LiveTile* tile = annotationManager.getTile(id);
if (!tile) {
setState(State::parsed);
state = State::parsed;
return;
}
@@ -56,12 +54,13 @@ bool LiveTileData::reparse(Worker&, std::function<void()> callback) {
if (getState() == TileData::State::obsolete) {
return;
} else if (result.is<State>()) {
setState(result.get<State>());
state = result.get<State>();
} else {
setError(result.get<std::string>());
error = result.get<std::string>();
state = State::obsolete;
}
endParsing();
parsing.clear(std::memory_order_release);
}, callback);
return true;