summaryrefslogtreecommitdiff
path: root/src/mbgl/style/source_impl.hpp
blob: 2514ec5120b72fbd7b044df646c5179d812ef90a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once

#include <mbgl/style/source.hpp>
#include <mbgl/util/noncopyable.hpp>

namespace mbgl {

class FileSource;
class RenderSource;

namespace style {

class SourceObserver;

class Source::Impl : private util::noncopyable {
public:
    Impl(SourceType, std::string id, Source&);
    virtual ~Impl() = default;

    virtual void loadDescription(FileSource&) = 0;
    virtual std::unique_ptr<RenderSource> createRenderSource() const = 0;

    virtual optional<std::string> getAttribution() const { return {}; };

    const SourceType type;
    const std::string id;

    bool loaded = false;
    Source& base;

    void setObserver(SourceObserver*);
    SourceObserver* observer = nullptr;

    void dumpDebugLogs() const;
};

} // namespace style
} // namespace mbgl