diff --git a/include/llmr/style/class_properties.hpp b/include/llmr/style/class_properties.hpp index 92f7fa3f4..f355ede22 100644 --- a/include/llmr/style/class_properties.hpp +++ b/include/llmr/style/class_properties.hpp @@ -84,24 +84,6 @@ public: inline ClassProperties(ClassProperties &&properties) : properties(std::move(properties.properties)) {} - template - inline const T *get(ClassPropertyKey key) const { - const auto it = properties.find(key); - if (it != properties.end() && it->second.is()) { - return ::std::addressof(it->second.get()); - } else { - return nullptr; - } - } - inline const ClassPropertyTransition *getTransition(ClassPropertyKey key) const { - const auto it = transitions.find(key); - if (it != transitions.end()) { - return ::std::addressof(it->second); - } else { - return nullptr; - } - } - template inline void set(Args&& ...args) { properties.emplace(::std::forward(args)...); @@ -111,6 +93,23 @@ public: transitions.emplace(::std::forward(args)...); } + inline const ClassPropertyTransition &getTransition(ClassPropertyKey key, const ClassPropertyTransition &defaultTransition) const { + auto it = transitions.find(key); + if (it == transitions.end()) { + return defaultTransition; + } else { + return it->second; + } + } + + // 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(); + } + public: std::map properties; std::map transitions;