PhoenixProtocolBuffer  1.0.1
Set of tools to decode offset from protocol buffer
Loading...
Searching...
No Matches
AbtractField.h
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#ifndef __ABTRACTFIELD_H__
8#define __ABTRACTFIELD_H__
9
10#include <vector>
11#include <map>
12#include "PString.h"
13#include "FieldType.h"
14
17 public:
19 AbtractField(const AbtractField & other);
20 virtual ~AbtractField();
21 AbtractField & operator = (const AbtractField & other);
22 void setName(const PString & name);
23 void setId(size_t id);
24 void setType(const FieldType::FieldType & type);
25 void setTypeSize(size_t typeSize);
26 void setIsArray(bool isArray);
27 void setNbElement(size_t * nbElement);
28 void setVarPtr(void * varPtr);
29 void setArrayPtr(void ** arrayPtr);
30 void setIsOffsetReady(bool isOffsetReady);
31 void setOffset(size_t offset);
32 const PString & getName() const;
33 PString & getName();
34 size_t getId() const;
35 size_t & getId();
36 const FieldType::FieldType & getType() const;
38 size_t getTypeSize() const;
39 size_t & getTypeSize();
40 bool getIsArray() const;
41 bool & getIsArray();
42 size_t * getNbElement() const;
43 size_t * & getNbElement();
44 void * getVarPtr() const;
45 void * & getVarPtr();
46 void ** getArrayPtr() const;
47 void ** & getArrayPtr();
48 bool getIsOffsetReady() const;
49 bool & getIsOffsetReady();
50 size_t getOffset() const;
51 size_t & getOffset();
52 protected:
53 void copyAbtractField(const AbtractField & other);
54 private:
57 PString p_name;
59 size_t p_id;
63 size_t p_typeSize;
67 size_t * p_nbElement;
69 void * p_varPtr;
71 void ** p_arrayPtr;
75 size_t p_offset;
76};
77
80 public:
82 FieldConfig(const FieldConfig & other);
83 virtual ~FieldConfig();
84 FieldConfig & operator = (const FieldConfig & other);
85 void setName(const PString & name);
86 void setId(size_t id);
87 void setType(const FieldType::FieldType & type);
88 void setIsArray(bool isArray);
89 void setVecChildren(const std::map<PString, FieldConfig> & vecChildren);
90 const PString & getName() const;
91 PString & getName();
92 size_t getId() const;
93 size_t & getId();
94 const FieldType::FieldType & getType() const;
96 bool getIsArray() const;
97 bool & getIsArray();
98 const std::map<PString, FieldConfig> & getVecChildren() const;
99 std::map<PString, FieldConfig> & getVecChildren();
100 protected:
101 void copyFieldConfig(const FieldConfig & other);
102 private:
105 PString p_name;
107 size_t p_id;
113 std::map<PString, FieldConfig> p_vecChildren;
114};
115
116
117
118#endif
119
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