PhoenixProtocolBuffer  1.0.1
Set of tools to decode offset from protocol buffer
Loading...
Searching...
No Matches
AbtractField.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
9
10#include "AbtractField.h"
11
16
18
23
28
30
34 copyAbtractField(other);
35 return *this;
36}
37
39
41void AbtractField::setName(const PString & name){
42 p_name = name;
43}
44
46
48void AbtractField::setId(size_t id){
49 p_id = id;
50}
51
53
56 p_type = type;
57}
58
60
62void AbtractField::setTypeSize(size_t typeSize){
63 p_typeSize = typeSize;
64}
65
67
69void AbtractField::setIsArray(bool isArray){
70 p_isArray = isArray;
71}
72
74
76void AbtractField::setNbElement(size_t * nbElement){
77 p_nbElement = nbElement;
78}
79
81
83void AbtractField::setVarPtr(void * varPtr){
84 p_varPtr = varPtr;
85}
86
88
90void AbtractField::setArrayPtr(void ** arrayPtr){
91 p_arrayPtr = arrayPtr;
92}
93
95
97void AbtractField::setIsOffsetReady(bool isOffsetReady){
98 p_isOffsetReady = isOffsetReady;
99}
100
102
104void AbtractField::setOffset(size_t offset){
105 p_offset = offset;
106}
107
109
111const PString & AbtractField::getName() const{
112 return p_name;
113}
114
116
119 return p_name;
120}
121
123
125size_t AbtractField::getId() const{
126 return p_id;
127}
128
130
133 return p_id;
134}
135
137
140 return p_type;
141}
142
144
149
151
154 return p_typeSize;
155}
156
158
161 return p_typeSize;
162}
163
165
168 return p_isArray;
169}
170
172
175 return p_isArray;
176}
177
179
182 return p_nbElement;
183}
184
186
189 return p_nbElement;
190}
191
193
196 return p_varPtr;
197}
198
200
203 return p_varPtr;
204}
205
207
210 return p_arrayPtr;
211}
212
214
217 return p_arrayPtr;
218}
219
221
224 return p_isOffsetReady;
225}
226
228
233
235
238 return p_offset;
239}
240
242
245 return p_offset;
246}
247
249
252 p_name = other.p_name;
253 p_id = other.p_id;
254 p_type = other.p_type;
255 p_typeSize = other.p_typeSize;
256 p_isArray = other.p_isArray;
257 p_nbElement = other.p_nbElement;
258 p_varPtr = other.p_varPtr;
259 p_arrayPtr = other.p_arrayPtr;
261 p_offset = other.p_offset;
262}
263
266 p_name = "";
267 p_id = 0lu;
268 p_typeSize = 0lu;
269 p_isArray = false;
270 p_nbElement = NULL;
271 p_varPtr = NULL;
272 p_arrayPtr = NULL;
273 p_isOffsetReady = false;
274 p_offset = 0lu;
275}
276
281
283
286 copyFieldConfig(other);
287}
288
293
295
299 copyFieldConfig(other);
300 return *this;
301}
302
304
306void FieldConfig::setName(const PString & name){
307 p_name = name;
308}
309
311
313void FieldConfig::setId(size_t id){
314 p_id = id;
315}
316
318
321 p_type = type;
322}
323
325
327void FieldConfig::setIsArray(bool isArray){
328 p_isArray = isArray;
329}
330
332
334void FieldConfig::setVecChildren(const std::map<PString, FieldConfig> & vecChildren){
335 p_vecChildren = vecChildren;
336}
337
339
341const PString & FieldConfig::getName() const{
342 return p_name;
343}
344
346
349 return p_name;
350}
351
353
355size_t FieldConfig::getId() const{
356 return p_id;
357}
358
360
363 return p_id;
364}
365
367
370 return p_type;
371}
372
374
379
381
384 return p_isArray;
385}
386
388
391 return p_isArray;
392}
393
395
397const std::map<PString, FieldConfig> & FieldConfig::getVecChildren() const{
398 return p_vecChildren;
399}
400
402
404std::map<PString, FieldConfig> & FieldConfig::getVecChildren(){
405 return p_vecChildren;
406}
407
409
412 p_name = other.p_name;
413 p_id = other.p_id;
414 p_type = other.p_type;
415 p_isArray = other.p_isArray;
417}
418
421 p_name = "";
422 p_id = 0lu;
423 p_isArray = false;
424}
425
void * p_varPtr
Pointer to the variable to be updated.
size_t p_offset
Offset to get the data on the next read.
void ** p_arrayPtr
Pointer to the array to be updated.
void ** getArrayPtr() const
Gets the arrayPtr of the AbtractField.
void initialisationAbtractField()
Initialisation Function of class AbtractField.
void setType(const FieldType::FieldType &type)
Sets the type of the AbtractField.
AbtractField()
Constructor of class AbtractField.
bool getIsArray() const
Gets the isArray of the AbtractField.
const PString & getName() const
Gets the name of the AbtractField.
size_t p_id
Id of the field.
void setVarPtr(void *varPtr)
Sets the varPtr of the AbtractField.
void setIsOffsetReady(bool isOffsetReady)
Sets the isOffsetReady of the AbtractField.
size_t p_typeSize
Expected size of the variable type.
void setArrayPtr(void **arrayPtr)
Sets the arrayPtr of the AbtractField.
FieldType::FieldType p_type
Type of the Field.
size_t * getNbElement() const
Gets the nbElement of the AbtractField.
size_t * p_nbElement
Number of element of the field (NULL for scalar)
size_t getOffset() const
Gets the offset of the AbtractField.
bool getIsOffsetReady() const
Gets the isOffsetReady of the AbtractField.
void copyAbtractField(const AbtractField &other)
Copy Function of class AbtractField.
PString p_name
Name of the Field.
size_t getId() const
Gets the id of the AbtractField.
AbtractField & operator=(const AbtractField &other)
Operator = of class AbtractField.
const FieldType::FieldType & getType() const
Gets the type of the AbtractField.
size_t getTypeSize() const
Gets the typeSize of the AbtractField.
void setName(const PString &name)
Sets the name of the AbtractField.
void setId(size_t id)
Sets the id of the AbtractField.
void setNbElement(size_t *nbElement)
Sets the nbElement of the AbtractField.
void setIsArray(bool isArray)
Sets the isArray of the AbtractField.
bool p_isOffsetReady
True if the offset is computed and can be used on the next read.
bool p_isArray
True if the Field contains an array of value, false if not.
void setOffset(size_t offset)
Sets the offset of the AbtractField.
void setTypeSize(size_t typeSize)
Sets the typeSize of the AbtractField.
virtual ~AbtractField()
Destructor of class AbtractField.
void * getVarPtr() const
Gets the varPtr of the AbtractField.
PString p_name
Name of the Field.
const PString & getName() const
Gets the name of the FieldConfig.
void setVecChildren(const std::map< PString, FieldConfig > &vecChildren)
Sets the vecChildren of the FieldConfig.
void copyFieldConfig(const FieldConfig &other)
Copy Function of class FieldConfig.
size_t p_id
Id of the field.
void setType(const FieldType::FieldType &type)
Sets the type of the FieldConfig.
void initialisationFieldConfig()
Initialisation Function of class FieldConfig.
size_t getId() const
Gets the id of the FieldConfig.
virtual ~FieldConfig()
Destructor of class FieldConfig.
std::map< PString, FieldConfig > p_vecChildren
Vector of children of the FieldConfig.
const FieldType::FieldType & getType() const
Gets the type of the FieldConfig.
void setId(size_t id)
Sets the id of the FieldConfig.
bool getIsArray() const
Gets the isArray of the FieldConfig.
const std::map< PString, FieldConfig > & getVecChildren() const
Gets the vecChildren of the FieldConfig.
FieldType::FieldType p_type
Type of the Field.
bool p_isArray
True if the Field contains an array of value, false if not.
FieldConfig()
Constructor of class FieldConfig.
FieldConfig & operator=(const FieldConfig &other)
Operator = of class FieldConfig.
void setName(const PString &name)
Sets the name of the FieldConfig.
void setIsArray(bool isArray)
Sets the isArray of the FieldConfig.
FieldType
Type of the Field.
Definition FieldType.h:14