summaryrefslogtreecommitdiff
path: root/src/mbgl/style/source_impl.cpp
blob: 1e9405abbb1f61edc4fc47fb4010b9141d732aa1 (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
#include <mbgl/style/source_impl.hpp>
#include <mbgl/style/source_observer.hpp>
#include <mbgl/util/logging.hpp>

namespace mbgl {
namespace style {

static SourceObserver nullObserver;

Source::Impl::Impl(SourceType type_, std::string id_, Source& base_)
    : type(type_),
      id(std::move(id_)),
      base(base_),
      observer(&nullObserver) {
}

void Source::Impl::dumpDebugLogs() const {
    Log::Info(Event::General, "Source::id: %s", base.getID().c_str());
    Log::Info(Event::General, "Source::loaded: %d", loaded);
}

void Source::Impl::setObserver(SourceObserver* observer_) {
    observer = observer_ ? observer_ : &nullObserver;
}

} // namespace style
} // namespace mbgl