PhoenixGenerator  2.6.4
Set of tools to generate code
Loading...
Searching...
No Matches
PClassConfig.cpp
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
7
8#include "PClassConfig.h"
9
14
16
21
26
28
32 copyPClassConfig(other);
33 return *this;
34}
35
37
39void PClassConfig::setClassDocumentation(const PString & classDocumentation){
40 p_classDocumentation = classDocumentation;
41}
42
44
46void PClassConfig::setName(const PString & name){
47 p_name = name;
48}
49
51
53void PClassConfig::setNamespace(const PString & value){
54 p_namespace = value;
55}
56
58
60void PClassConfig::setListAttribute(const std::vector<PClassAttribute> & listAttribute){
61 p_listAttribute = listAttribute;
62}
63
65
67void PClassConfig::setListTemplate(const PVecString & listTemplate){
68 p_listTemplate = listTemplate;
69}
70
72
75 p_listAttribute.push_back(attribute);
76}
77
79
81void PClassConfig::addListAttribute(const std::vector<PClassAttribute> & listAttribute){
82 for(std::vector<PClassAttribute>::const_iterator it(listAttribute.begin()); it != listAttribute.end(); ++it){
83 addAttribute(*it);
84 }
85}
86
88
90void PClassConfig::addParentClass(const PString & parentClass){
91 p_listParentClass.push_back(parentClass);
92}
93
95
97void PClassConfig::addListParentClass(const PVecString & listParentClass){
98 for(PVecString::const_iterator it(listParentClass.begin()); it != listParentClass.end(); ++it){
99 addParentClass(*it);
100 }
101}
102
104
106void PClassConfig::addTemplate(const PString & defTemplate){
107 p_listTemplate.push_back(defTemplate);
108}
109
111
113void PClassConfig::addListTemplate(const PVecString & listTemplate){
114 for(PVecString::const_iterator it(listTemplate.begin()); it != listTemplate.end(); ++it){
115 addTemplate(*it);
116 }
117}
118
120
122void PClassConfig::setIsEnum(bool isEnum){
123 p_isEnum = isEnum;
124}
125
127
129const PString & PClassConfig::getName() const{return p_name;}
130
132
134PString & PClassConfig::getName(){return p_name;}
135
137
139const PString & PClassConfig::getNamespace() const{return p_namespace;}
140
142
145
147
150 if(p_namespace == "") return p_name;
151 return p_namespace + "::" + p_name;
152}
153
155
158
160
163
165
167const std::vector<PClassAttribute> & PClassConfig::getListAttribute() const{return p_listAttribute;}
168
170
172std::vector<PClassAttribute> & PClassConfig::getListAttribute(){return p_listAttribute;}
173
175
177const PVecString & PClassConfig::getListParentClass() const{return p_listParentClass;}
178
180
183
185
187const PVecString & PClassConfig::getListTemplate() const{return p_listTemplate;}
188
190
193
195
198
200
211
Describes a class attribute.
PString getFullName() const
Returns the full name of the class including the namespace.
void addAttribute(const PClassAttribute &attribute)
Adds an attribute to the class.
virtual ~PClassConfig()
Destructeur of PClassConfig.
void setClassDocumentation(const PString &classDocumentation)
Sets the class documentation.
const PString & getClassDocumentation() const
Returns the class documentation.
const std::vector< PClassAttribute > & getListAttribute() const
Returns the list of attributes of the class.
void setNamespace(const PString &value)
Sets the namespace of the class.
void setIsEnum(bool isEnum)
Set if the current PClassConfig is an enum.
void setListAttribute(const std::vector< PClassAttribute > &listAttribute)
Sets the list of attributes of the class.
PClassConfig()
Default constructeur of PClassConfig.
void addListTemplate(const PVecString &listTemplate)
Add a template to the PClassConfig.
const PVecString & getListTemplate() const
Returns the list of the template of the class.
const PString & getName() const
Returns the class name.
bool getIsEnum() const
Say if the current PClassConfig is an enum.
void setName(const PString &name)
Sets the class name.
PVecString p_listParentClass
List of the parent classes of the current class.
void addListAttribute(const std::vector< PClassAttribute > &listAttribute)
Adds a list of attributes to the class.
bool p_isEnum
True if it is an enum.
PString p_name
Name of the class.
void addParentClass(const PString &parentClass)
Add a parent class to the PClassConfig.
PClassConfig & operator=(const PClassConfig &other)
Definition of equal operator of PClassConfig.
void copyPClassConfig(const PClassConfig &other)
Copy function of PClassConfig.
void addTemplate(const PString &defTemplate)
Add a template to the PClassConfig.
PVecString p_listTemplate
List of the template definition of the current class.
const PVecString & getListParentClass() const
Returns the list of the parents of the class.
void initialisationPClassConfig()
Initialisation function of the class PClassConfig.
const PString & getNamespace() const
Returns the namespace of the class.
void setListTemplate(const PVecString &listTemplate)
Sets the list of template of the class.
PString p_namespace
Namespace of the class.
PString p_classDocumentation
Class documentation.
void addListParentClass(const PVecString &listParentClass)
Add a parent classes to the PClassConfig.
std::vector< PClassAttribute > p_listAttribute
List of the attribute of the class.