#pragma once #include #include "storage/model/properties/property.hpp" class Properties { public: using sptr = std::shared_ptr; auto begin() const { return props.begin(); } auto cbegin() const { return props.cbegin(); } auto end() const { return props.end(); } auto cend() const { return props.cend(); } size_t size() const { return props.size(); } const Property& at(const std::string& key) const; template void set(const std::string& key, Args&&... args); void set(const std::string& key, Property::sptr value); void clear(const std::string& key); template void accept(Handler& handler) const { for(auto& kv : props) handler.handle(kv.first, *kv.second); handler.finish(); } private: using props_t = std::map; props_t props; };