diff --git a/attributes.hpp b/attributes.hpp index 85d4a0d..8f1da15 100644 --- a/attributes.hpp +++ b/attributes.hpp @@ -21,15 +21,15 @@ #include -class abstract_setter { +class abstract_attribute { public: virtual void set_value(const std::string &value) = 0; }; template -class setter: public abstract_setter { +class attribute : public abstract_attribute { public: - explicit setter(T &object) + explicit attribute(T &object) : reference(object) { } @@ -46,27 +46,27 @@ public: class attributes { public: void set_attribute(const std::string &attr, const std::string &value) { - setters_map::iterator it = setters.find(attr); + attributes_map::iterator it = attributes.find(attr); - if (it != setters.end()) { + if (it != attributes.end()) { it->second->set_value(value); } } template - void register_attribute(const std::string &name, T &ptr) { - typedef setter specific_setter; + void register_attribute(const std::string &name, T &object) { + typedef attribute specific_attribute; - setter_ptr setter(new specific_setter(ptr)); + attribute_ptr attribute(new specific_attribute(object)); - setters.insert(std::make_pair(name, setter)); + attributes.insert(std::make_pair(name, attribute)); } private: - typedef boost::shared_ptr setter_ptr; - typedef std::map setters_map; + typedef boost::shared_ptr attribute_ptr; + typedef std::map attributes_map; - setters_map setters; + attributes_map attributes; }; #endif /* SETTABLE_HPP */