summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/source_state.hpp
blob: 7217302630c5e5c69c2f9d37759771bfed664ab6 (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
#pragma once

#include <mbgl/style/conversion.hpp>
#include <mbgl/util/feature.hpp>

namespace mbgl {

class RenderTile;

class SourceFeatureState {
public:
    SourceFeatureState() = default;
    ~SourceFeatureState() = default;

    void updateState(const optional<std::string>& sourceLayerID, const std::string& featureID,
                     const FeatureState& newState);
    void getState(FeatureState& result, const optional<std::string>& sourceLayerID, const std::string& featureID) const;
    void removeState(const optional<std::string>& sourceLayerID, const optional<std::string>& featureID,
                     const optional<std::string>& stateKey);

    void coalesceChanges(std::vector<RenderTile>& tiles);

private:
    LayerFeatureStates currentStates;
    LayerFeatureStates stateChanges;
    LayerFeatureStates deletedStates;
};

} // namespace mbgl