1 #ifndef GDE_ATTRIBUTE_HPP
2 #define GDE_ATTRIBUTE_HPP
9 friend class AttributesService;
10 friend class GDESession;
13 Attribute(const std::string& name, const std::string& type, const std::string& value, bool mandatory)
14 : _id(0), _name(name), _type(type), _value(value), _groupId(0), _mandatory(mandatory)
18 inline int getId() const { return _id; }
19 inline void setId(int id) { this->_id = id; }
21 inline std::string getName() const { return _name; }
22 inline void setName(const std::string& name) { this->_name = name; }
24 inline std::string getType() const { return _type; }
25 inline void setType(const std::string& type) { this->_type = type; }
27 inline std::string getValue() const { return _value; }
28 inline void setValue(const std::string& value) { this->_value = value; }
30 inline int getGroupId() const { return _groupId; }
31 inline void setGroupId(int groupId) { this->_groupId = groupId; }
33 inline bool getMandatory() const { return _mandatory; }
34 inline void setMandatory(bool mandatory) { this->_mandatory = mandatory; }
36 const std::string toJson() const;
37 static Attribute fromJson(const std::string& json);
40 Attribute(int id=0, const std::string& name="", const std::string& type="", const std::string& value="", int groupId=0, bool mandatory=false)
41 : _id(id), _name(name), _type(type), _value(value), _groupId(groupId), _mandatory(mandatory)
43 //Attribute(const Attribute&); // non copyable
44 //Attribute& operator=(const Attribute&); // non copyable