blob: 720ee8739ff85a43c4b3eb8589075845ca54ec78 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#pragma once
#include <mbgl/tile/tile_observer.hpp>
using namespace mbgl;
/**
* An implementation of TileObserver that forwards all methods to dynamically-settable lambas.
*/
class StubTileObserver : public TileObserver {
public:
void onTileChanged(Tile& tile) override {
if (tileChanged) tileChanged(tile);
}
void onTileError(Tile& tile, std::exception_ptr error, EventSeverity) override {
if (tileError) tileError(tile, error);
}
std::function<void (Tile&)> tileChanged;
std::function<void (Tile&, std::exception_ptr)> tileError;
};
|