* src/mbgl/annotation/annotation_manager.hpp * src/mbgl/algorithm/update_renderables.hpp * src/mbgl/geometry/glyph_atlas.hpp * src/mbgl/renderer/painter.cpp and src/mbgl/renderer/render_item.hpp * src/mbgl/renderer/symbol_bucket.hpp and src/mbgl/text/glyph_store.hpp * src/mbgl/sprite/sprite_atlas.hpp * include/mbgl/storage/network_status.hpp * src/mbgl/text/collision_tile.cpp * src/mbgl/style/update_batch.hpp * platform/default/mbgl/storage/offline_download.hpp * Add GlyphRangeSet typedef * Fix whitespace & unused imports
35 lines
599 B
C++
35 lines
599 B
C++
#pragma once
|
|
|
|
#include <atomic>
|
|
#include <mutex>
|
|
#include <unordered_set>
|
|
|
|
namespace mbgl {
|
|
|
|
namespace util {
|
|
class AsyncTask;
|
|
} // namespace util
|
|
|
|
class NetworkStatus {
|
|
public:
|
|
enum class Status : uint8_t {
|
|
Online,
|
|
Offline,
|
|
};
|
|
|
|
static Status Get();
|
|
static void Set(Status);
|
|
|
|
static void Reachable();
|
|
|
|
static void Subscribe(util::AsyncTask* async);
|
|
static void Unsubscribe(util::AsyncTask* async);
|
|
|
|
private:
|
|
static std::atomic<bool> online;
|
|
static std::mutex mtx;
|
|
static std::unordered_set<util::AsyncTask*> observers;
|
|
};
|
|
|
|
} // namespace mbgl
|