]> SALOME platform Git repositories - modules/gde.git/blob - projects/GDE_API_CPP/api/src/ProfileAttribute.hpp
Salome HOME
FileService
[modules/gde.git] / projects / GDE_API_CPP / api / src / ProfileAttribute.hpp
1 #ifndef GDE_PROFILE_ATTRIBUTE_HPP
2 #define GDE_PROFILE_ATTRIBUTE_HPP
3
4 #include <string>
5
6 namespace gde {
7
8   class ProfileAttribute {
9     friend class ProfilesService;
10     friend class GDESession;
11
12   public:
13     ProfileAttribute(const std::string& name, const std::string& type, bool mandatory)
14       : _id(0), _name(name), _type(type), _profileId(0), _mandatory(mandatory)
15     {}
16     ~ProfileAttribute() {}
17
18     inline int getId() const { return _id; }
19     inline void setId(int id) { this->_id = id; }
20
21     inline std::string getName() const { return _name; }
22     inline void setName(const std::string& name) { this->_name = name; }
23
24     inline std::string getType() const { return _type; }
25     inline void setType(const std::string& type) { this->_type = type; }
26
27     inline int getProfileId() const { return _profileId; }
28     inline void setProfileId(int profileId) { this->_profileId = profileId; }
29
30     inline bool getMandatory() const { return _mandatory; }
31     inline void setMandatory(bool mandatory) { this->_mandatory = mandatory; }
32
33     const std::string toJson() const;
34     static ProfileAttribute fromJson(const std::string& json);
35
36   private:
37     ProfileAttribute(int id=0, const std::string& name="", const std::string& type="", int profileId=0, bool mandatory=false)
38       : _id(id), _name(name), _type(type), _profileId(profileId), _mandatory(mandatory)
39     {}
40     //ProfileAttribute(const ProfileAttribute&); // non copyable
41     //ProfileAttribute& operator=(const ProfileAttribute&); // non copyable
42
43   private:
44     int _id;
45     std::string _name;
46     std::string _type;
47     int _profileId;
48     bool _mandatory;
49   };
50
51 };
52
53 #endif