Files
MapLibreParticleLab/src/mbgl/map/tile_data.cpp
John Firebaugh 16de579d7c [core] Rationalize error handling for resource loading
* Standardize on std::exception_ptr as the error representation
  (fixes #2854).
* Don't format textual strings at the error source; pass on the
  constituent data via observer method parameters instead.
* Use the null object pattern to simplify observer notification code.
* Further refactoring for ResourceLoading tests.
2015-12-23 12:50:42 -08:00

37 lines
1.1 KiB
C++

#include <mbgl/map/tile_data.hpp>
#include <mbgl/renderer/debug_bucket.hpp>
#include <mbgl/util/string.hpp>
namespace mbgl {
TileData::TileData(const TileID& id_)
: id(id_),
state(State::initial) {
}
TileData::~TileData() = default;
const char* TileData::StateToString(const State state) {
switch (state) {
case TileData::State::initial: return "initial";
case TileData::State::invalid : return "invalid";
case TileData::State::loading : return "loading";
case TileData::State::loaded : return "loaded";
case TileData::State::obsolete : return "obsolete";
case TileData::State::parsed : return "parsed";
case TileData::State::partial : return "partial";
default: return "<unknown>";
}
}
void TileData::dumpDebugLogs() const {
Log::Info(Event::General, "TileData::id: %s", std::string(id).c_str());
Log::Info(Event::General, "TileData::state: %s", TileData::StateToString(state));
if (error) {
Log::Info(Event::General, "TileData::error: %s", util::toString(error).c_str());
}
}
} // namespace mbgl