diff options
Diffstat (limited to 'include/mbgl/style/source.hpp')
-rw-r--r-- | include/mbgl/style/source.hpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/include/mbgl/style/source.hpp b/include/mbgl/style/source.hpp index 4c82e472a6..cec9619451 100644 --- a/include/mbgl/style/source.hpp +++ b/include/mbgl/style/source.hpp @@ -1,19 +1,25 @@ #pragma once -#include <mbgl/util/feature.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/optional.hpp> -#include <mbgl/util/range.hpp> #include <mbgl/util/any.hpp> +#include <mbgl/util/immutable.hpp> #include <mbgl/style/types.hpp> #include <memory> #include <string> -#include <vector> namespace mbgl { + +class FileSource; + namespace style { +class VectorSource; +class RasterSource; +class GeoJSONSource; +class SourceObserver; + /** * The runtime representation of a [source](https://www.mapbox.com/mapbox-gl-style-spec/#sources) from the Mapbox Style * Specification. @@ -49,21 +55,28 @@ public: return is<T>() ? reinterpret_cast<const T*>(this) : nullptr; } - const std::string& getID() const; + SourceType getType() const; + std::string getID() const; optional<std::string> getAttribution() const; // Private implementation class Impl; - const std::unique_ptr<Impl> baseImpl; + Immutable<Impl> baseImpl; + + Source(Immutable<Impl>); + + void setObserver(SourceObserver*); + SourceObserver* observer = nullptr; + + virtual void loadDescription(FileSource&) = 0; + void dumpDebugLogs() const; + + bool loaded = false; // For use in SDK bindings, which store a reference to a platform-native peer // object here, so that separately-obtained references to this object share // identical platform-native peers. any peer; - -protected: - const SourceType type; - Source(SourceType, std::unique_ptr<Impl>); }; } // namespace style |