summaryrefslogtreecommitdiff
path: root/include/mbgl/util/feature_state.hpp
blob: f63f3dcbffe33fb3f4564a37641cc5bb9cb4e1e3 (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
39
40
41
42
43
44
45
46
#pragma once

#include <mbgl/util/feature.hpp>
#include <mbgl/util/optional.hpp>

namespace mbgl {

using FeatureStates = std::unordered_map<FeatureIdentifier, PropertyMap>;
using FeatureStatesMap = std::unordered_map<std::string, FeatureStates>;

struct FeatureStateChange {
  enum class ChangeType {
    Insert,
    Clear
  };
    
  ChangeType type;
  std::string sourceLayer;
  FeatureIdentifier id;
  std::string key;
  optional<Value> value;
  FeatureStateChange(ChangeType type_,
             const std::string& sourceLayer_,
             const FeatureIdentifier& id_,
		     const std::string& key_,
		     optional<Value> value_) :
    type(type_),
    sourceLayer(sourceLayer_),
    id(std::move(id_)),
    key(std::move(key_)),
    value(std::move(value_)) {}
    
  FeatureStateChange(ChangeType type_,
             const FeatureIdentifier& id_,
             const std::string& key_,
             optional<Value> value_) :
    type(type_),
    id(std::move(id_)),
    key(std::move(key_)),
    value(std::move(value_)) {}

};

using FeatureStateChangeSet = std::vector<FeatureStateChange>;

} // namespace mbgl