#ifndef MBGL_STYLE_CLASS_PROPERTIES #define MBGL_STYLE_CLASS_PROPERTIES #include #include #include #include #include namespace mbgl { class ClassProperties { public: inline void set(PropertyKey key, const PropertyValue &value) { properties.emplace(key, value); } inline void set(PropertyKey key, const PropertyTransition &transition) { transitions.emplace(key, transition); } PropertyTransition getTransition(PropertyKey key) const; // Route-through iterable interface so that you can iterate on the object as is. inline std::map::const_iterator begin() const { return properties.begin(); } inline std::map::const_iterator end() const { return properties.end(); } template void calculate(PropertyKey key, T& target, const float z) const { auto it = properties.find(key); if (it != properties.end()) { target = mapbox::util::apply_visitor(PropertyEvaluator(StyleCalculationParameters(z)), it->second); } } public: std::map properties; std::map transitions; }; } #endif