GCC Code Coverage Report


Directory: ./
File: src/Representation/PClassConfig.cpp
Date: 2025-12-15 11:32:44
Exec Total Coverage
Lines: 43 69 62.3%
Functions: 17 29 58.6%
Branches: 4 13 30.8%

Line Branch Exec Source
1 /***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5 ****************************************/
6
7
8 #include "PClassConfig.h"
9
10 ///Default constructeur of PClassConfig
11
1/1
✓ Branch 0 (3→4) taken 16 times.
16 PClassConfig::PClassConfig(){
12
1/1
✓ Branch 0 (7→8) taken 16 times.
16 initialisationPClassConfig();
13 16 }
14
15 ///Copy constructor of PClassConfig
16 /** @param other : class to copy
17 */
18
1/1
✓ Branch 0 (3→4) taken 30 times.
30 PClassConfig::PClassConfig(const PClassConfig & other){
19
1/1
✓ Branch 0 (7→8) taken 30 times.
30 copyPClassConfig(other);
20 30 }
21
22 ///Destructeur of PClassConfig
23 46 PClassConfig::~PClassConfig(){
24
25 46 }
26
27 ///Definition of equal operator of PClassConfig
28 /** @param other : class to copy
29 * @return copied class
30 */
31 5 PClassConfig & PClassConfig::operator = (const PClassConfig & other){
32 5 copyPClassConfig(other);
33 5 return *this;
34 }
35
36 ///Sets the class documentation
37 /** @param classDocumentation : class documentation
38 */
39 11 void PClassConfig::setClassDocumentation(const PString & classDocumentation){
40 11 p_classDocumentation = classDocumentation;
41 11 }
42
43 ///Sets the class name
44 /** @param name : name of the class
45 */
46 11 void PClassConfig::setName(const PString & name){
47 11 p_name = name;
48 11 }
49
50 ///Sets the list of attributes of the class
51 /** @param listAttribute : list of the attributes of the class
52 */
53 void PClassConfig::setListAttribute(const std::vector<PClassAttribute> & listAttribute){
54 p_listAttribute = listAttribute;
55 }
56
57 ///Sets the list of template of the class
58 /** @param listTemplate : list of the template of the class
59 */
60 4 void PClassConfig::setListTemplate(const PVecString & listTemplate){
61 4 p_listTemplate = listTemplate;
62 4 }
63
64 ///Adds an attribute to the class
65 /** @param attribute : attribute to add to the class
66 */
67 22 void PClassConfig::addAttribute(const PClassAttribute & attribute){
68 22 p_listAttribute.push_back(attribute);
69 22 }
70
71 ///Adds a list of attributes to the class
72 /** @param listAttribute : list of attributes to add to the class
73 */
74 void PClassConfig::addListAttribute(const std::vector<PClassAttribute> & listAttribute){
75 for(std::vector<PClassAttribute>::const_iterator it(listAttribute.begin()); it != listAttribute.end(); ++it){
76 addAttribute(*it);
77 }
78 }
79
80 ///Add a parent class to the PClassConfig
81 /** @param parentClass : parent class we want to add in the PClassConfig
82 */
83 void PClassConfig::addParentClass(const PString & parentClass){
84 p_listParentClass.push_back(parentClass);
85 }
86
87 ///Add a parent classes to the PClassConfig
88 /** @param listParentClass : list of parent classes we want to add in the PClassConfig
89 */
90 void PClassConfig::addListParentClass(const PVecString & listParentClass){
91 for(PVecString::const_iterator it(listParentClass.begin()); it != listParentClass.end(); ++it){
92 addParentClass(*it);
93 }
94 }
95
96 ///Add a template to the PClassConfig
97 /** @param defTemplate : template we want to add in the PClassConfig
98 */
99 void PClassConfig::addTemplate(const PString & defTemplate){
100 p_listTemplate.push_back(defTemplate);
101 }
102
103 ///Add a template to the PClassConfig
104 /** @param listTemplate : list of templates we want to add in the PClassConfig
105 */
106 void PClassConfig::addListTemplate(const PVecString & listTemplate){
107 for(PVecString::const_iterator it(listTemplate.begin()); it != listTemplate.end(); ++it){
108 addTemplate(*it);
109 }
110 }
111
112 ///Set if the current PClassConfig is an enum
113 /** @param isEnum : true if the current PClassConfig is an enum
114 */
115 3 void PClassConfig::setIsEnum(bool isEnum){
116 3 p_isEnum = isEnum;
117 3 }
118
119 ///Returns the class name
120 /** @return class name
121 */
122 312 const PString & PClassConfig::getName() const{return p_name;}
123
124 ///Returns the class name
125 /** @return class name
126 */
127 PString & PClassConfig::getName(){return p_name;}
128
129 ///Returns the class documentation
130 /** @return class documentation
131 */
132 20 const PString & PClassConfig::getClassDocumentation() const{return p_classDocumentation;}
133
134 ///Returns the class documentation
135 /** @return class documentation
136 */
137 PString & PClassConfig::getClassDocumentation(){return p_classDocumentation;}
138
139 ///Returns the list of attributes of the class
140 /** @return list of attributes of the class
141 */
142 101 const std::vector<PClassAttribute> & PClassConfig::getListAttribute() const{return p_listAttribute;}
143
144 ///Returns the list of attributes of the class
145 /** @return list of attributes of the class
146 */
147 std::vector<PClassAttribute> & PClassConfig::getListAttribute(){return p_listAttribute;}
148
149 ///Returns the list of the parents of the class
150 /** @return list of the parents of the class
151 */
152 10 const PVecString & PClassConfig::getListParentClass() const{return p_listParentClass;}
153
154 ///Returns the list of the parents of the class
155 /** @return list of the parents of the class
156 */
157 PVecString & PClassConfig::getListParentClass(){return p_listParentClass;}
158
159 ///Returns the list of the template of the class
160 /** @return list of the template of the class
161 */
162 36 const PVecString & PClassConfig::getListTemplate() const{return p_listTemplate;}
163
164 ///Returns the list of the template of the class
165 /** @return list of the template of the class
166 */
167 PVecString & PClassConfig::getListTemplate(){return p_listTemplate;}
168
169 ///Say if the current PClassConfig is an enum
170 /** @return true if the current PClassConfig is an enum, false otherwise
171 */
172 178 bool PClassConfig::getIsEnum() const{return p_isEnum;}
173
174 ///Copy function of PClassConfig
175 /** @param other : class to copy
176 */
177 35 void PClassConfig::copyPClassConfig(const PClassConfig & other){
178 35 p_listAttribute = other.p_listAttribute;
179 35 p_name = other.p_name;
180 35 p_classDocumentation = other.p_classDocumentation;
181 35 p_listParentClass = other.p_listParentClass;
182 35 p_listTemplate = other.p_listTemplate;
183 35 p_isEnum = other.p_isEnum;
184 35 }
185
186 ///Initialisation function of the class PClassConfig
187 16 void PClassConfig::initialisationPClassConfig(){
188 16 p_isEnum = false;
189 16 }
190
191
192
193
194
195