PhoenixProtocolBuffer  1.0.1
Set of tools to decode offset from protocol buffer
Loading...
Searching...
No Matches
AbtractField Class Reference

Abtract field to be read from a protocol buffer message. More...

#include <AbtractField.h>

Public Member Functions

 AbtractField ()
 Constructor of class AbtractField.
 
 AbtractField (const AbtractField &other)
 Copy Constructor of class AbtractField.
 
void **& getArrayPtr ()
 Gets the arrayPtr of the AbtractField.
 
void ** getArrayPtr () const
 Gets the arrayPtr of the AbtractField.
 
size_t & getId ()
 Gets the id of the AbtractField.
 
size_t getId () const
 Gets the id of the AbtractField.
 
bool & getIsArray ()
 Gets the isArray of the AbtractField.
 
bool getIsArray () const
 Gets the isArray of the AbtractField.
 
bool & getIsOffsetReady ()
 Gets the isOffsetReady of the AbtractField.
 
bool getIsOffsetReady () const
 Gets the isOffsetReady of the AbtractField.
 
PString & getName ()
 Gets the name of the AbtractField.
 
const PString & getName () const
 Gets the name of the AbtractField.
 
size_t *& getNbElement ()
 Gets the nbElement of the AbtractField.
 
size_t * getNbElement () const
 Gets the nbElement of the AbtractField.
 
size_t & getOffset ()
 Gets the offset of the AbtractField.
 
size_t getOffset () const
 Gets the offset of the AbtractField.
 
FieldType::FieldTypegetType ()
 Gets the type of the AbtractField.
 
const FieldType::FieldTypegetType () const
 Gets the type of the AbtractField.
 
size_t & getTypeSize ()
 Gets the typeSize of the AbtractField.
 
size_t getTypeSize () const
 Gets the typeSize of the AbtractField.
 
void *& getVarPtr ()
 Gets the varPtr of the AbtractField.
 
void * getVarPtr () const
 Gets the varPtr of the AbtractField.
 
AbtractFieldoperator= (const AbtractField &other)
 Operator = of class AbtractField.
 
void setArrayPtr (void **arrayPtr)
 Sets the arrayPtr of the AbtractField.
 
void setId (size_t id)
 Sets the id of the AbtractField.
 
void setIsArray (bool isArray)
 Sets the isArray of the AbtractField.
 
void setIsOffsetReady (bool isOffsetReady)
 Sets the isOffsetReady of the AbtractField.
 
void setName (const PString &name)
 Sets the name of the AbtractField.
 
void setNbElement (size_t *nbElement)
 Sets the nbElement of the AbtractField.
 
void setOffset (size_t offset)
 Sets the offset of the AbtractField.
 
void setType (const FieldType::FieldType &type)
 Sets the type of the AbtractField.
 
void setTypeSize (size_t typeSize)
 Sets the typeSize of the AbtractField.
 
void setVarPtr (void *varPtr)
 Sets the varPtr of the AbtractField.
 
virtual ~AbtractField ()
 Destructor of class AbtractField.
 

Protected Member Functions

void copyAbtractField (const AbtractField &other)
 Copy Function of class AbtractField.
 

Private Member Functions

void initialisationAbtractField ()
 Initialisation Function of class AbtractField.
 

Private Attributes

void ** p_arrayPtr
 Pointer to the array to be updated.
 
size_t p_id
 Id of the field.
 
bool p_isArray
 True if the Field contains an array of value, false if not.
 
bool p_isOffsetReady
 True if the offset is computed and can be used on the next read.
 
PString p_name
 Name of the Field.
 
size_t * p_nbElement
 Number of element of the field (NULL for scalar)
 
size_t p_offset
 Offset to get the data on the next read.
 
FieldType::FieldType p_type
 Type of the Field.
 
size_t p_typeSize
 Expected size of the variable type.
 
void * p_varPtr
 Pointer to the variable to be updated.
 

Detailed Description

Abtract field to be read from a protocol buffer message.

Definition at line 16 of file AbtractField.h.

Constructor & Destructor Documentation

◆ AbtractField() [1/2]

AbtractField::AbtractField ( )

Constructor of class AbtractField.

Definition at line 13 of file AbtractField.cpp.

13 {
15}
void initialisationAbtractField()
Initialisation Function of class AbtractField.

References initialisationAbtractField().

Referenced by AbtractField(), copyAbtractField(), and operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AbtractField() [2/2]

AbtractField::AbtractField ( const AbtractField & other)

Copy Constructor of class AbtractField.

Parameters
other: AbtractField we want ot copy

Definition at line 20 of file AbtractField.cpp.

20 {
21 copyAbtractField(other);
22}
void copyAbtractField(const AbtractField &other)
Copy Function of class AbtractField.

References AbtractField(), and copyAbtractField().

+ Here is the call graph for this function:

◆ ~AbtractField()

AbtractField::~AbtractField ( )
virtual

Destructor of class AbtractField.

Definition at line 25 of file AbtractField.cpp.

25 {
26
27}

Member Function Documentation

◆ copyAbtractField()

void AbtractField::copyAbtractField ( const AbtractField & other)
protected

Copy Function of class AbtractField.

Parameters
other: AbtractField we want ot copy

Definition at line 251 of file AbtractField.cpp.

251 {
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}
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.
size_t p_id
Id of the field.
size_t p_typeSize
Expected size of the variable type.
FieldType::FieldType p_type
Type of the Field.
size_t * p_nbElement
Number of element of the field (NULL for scalar)
PString p_name
Name of the Field.
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.

References AbtractField(), p_arrayPtr, p_id, p_isArray, p_isOffsetReady, p_name, p_nbElement, p_offset, p_type, p_typeSize, and p_varPtr.

Referenced by AbtractField(), and operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getArrayPtr() [1/2]

void **& AbtractField::getArrayPtr ( )

Gets the arrayPtr of the AbtractField.

Returns
arrayPtr of the AbtractField

Definition at line 216 of file AbtractField.cpp.

216 {
217 return p_arrayPtr;
218}

References p_arrayPtr.

◆ getArrayPtr() [2/2]

void ** AbtractField::getArrayPtr ( ) const

Gets the arrayPtr of the AbtractField.

Returns
arrayPtr of the AbtractField

Definition at line 209 of file AbtractField.cpp.

209 {
210 return p_arrayPtr;
211}

References p_arrayPtr.

◆ getId() [1/2]

size_t & AbtractField::getId ( )

Gets the id of the AbtractField.

Returns
id of the AbtractField

Definition at line 132 of file AbtractField.cpp.

132 {
133 return p_id;
134}

References p_id.

◆ getId() [2/2]

size_t AbtractField::getId ( ) const

Gets the id of the AbtractField.

Returns
id of the AbtractField

Definition at line 125 of file AbtractField.cpp.

125 {
126 return p_id;
127}

References p_id.

◆ getIsArray() [1/2]

bool & AbtractField::getIsArray ( )

Gets the isArray of the AbtractField.

Returns
isArray of the AbtractField

Definition at line 174 of file AbtractField.cpp.

174 {
175 return p_isArray;
176}

References p_isArray.

◆ getIsArray() [2/2]

bool AbtractField::getIsArray ( ) const

Gets the isArray of the AbtractField.

Returns
isArray of the AbtractField

Definition at line 167 of file AbtractField.cpp.

167 {
168 return p_isArray;
169}

References p_isArray.

◆ getIsOffsetReady() [1/2]

bool & AbtractField::getIsOffsetReady ( )

Gets the isOffsetReady of the AbtractField.

Returns
isOffsetReady of the AbtractField

Definition at line 230 of file AbtractField.cpp.

230 {
231 return p_isOffsetReady;
232}

References p_isOffsetReady.

◆ getIsOffsetReady() [2/2]

bool AbtractField::getIsOffsetReady ( ) const

Gets the isOffsetReady of the AbtractField.

Returns
isOffsetReady of the AbtractField

Definition at line 223 of file AbtractField.cpp.

223 {
224 return p_isOffsetReady;
225}

References p_isOffsetReady.

◆ getName() [1/2]

PString & AbtractField::getName ( )

Gets the name of the AbtractField.

Returns
name of the AbtractField

Definition at line 118 of file AbtractField.cpp.

118 {
119 return p_name;
120}

References p_name.

◆ getName() [2/2]

const PString & AbtractField::getName ( ) const

Gets the name of the AbtractField.

Returns
name of the AbtractField

Definition at line 111 of file AbtractField.cpp.

111 {
112 return p_name;
113}

References p_name.

◆ getNbElement() [1/2]

size_t *& AbtractField::getNbElement ( )

Gets the nbElement of the AbtractField.

Returns
nbElement of the AbtractField

Definition at line 188 of file AbtractField.cpp.

188 {
189 return p_nbElement;
190}

References p_nbElement.

◆ getNbElement() [2/2]

size_t * AbtractField::getNbElement ( ) const

Gets the nbElement of the AbtractField.

Returns
nbElement of the AbtractField

Definition at line 181 of file AbtractField.cpp.

181 {
182 return p_nbElement;
183}

References p_nbElement.

◆ getOffset() [1/2]

size_t & AbtractField::getOffset ( )

Gets the offset of the AbtractField.

Returns
offset of the AbtractField

Definition at line 244 of file AbtractField.cpp.

244 {
245 return p_offset;
246}

References p_offset.

◆ getOffset() [2/2]

size_t AbtractField::getOffset ( ) const

Gets the offset of the AbtractField.

Returns
offset of the AbtractField

Definition at line 237 of file AbtractField.cpp.

237 {
238 return p_offset;
239}

References p_offset.

◆ getType() [1/2]

FieldType::FieldType & AbtractField::getType ( )

Gets the type of the AbtractField.

Returns
type of the AbtractField

Definition at line 146 of file AbtractField.cpp.

146 {
147 return p_type;
148}

References p_type.

◆ getType() [2/2]

const FieldType::FieldType & AbtractField::getType ( ) const

Gets the type of the AbtractField.

Returns
type of the AbtractField

Definition at line 139 of file AbtractField.cpp.

139 {
140 return p_type;
141}

References p_type.

◆ getTypeSize() [1/2]

size_t & AbtractField::getTypeSize ( )

Gets the typeSize of the AbtractField.

Returns
typeSize of the AbtractField

Definition at line 160 of file AbtractField.cpp.

160 {
161 return p_typeSize;
162}

References p_typeSize.

◆ getTypeSize() [2/2]

size_t AbtractField::getTypeSize ( ) const

Gets the typeSize of the AbtractField.

Returns
typeSize of the AbtractField

Definition at line 153 of file AbtractField.cpp.

153 {
154 return p_typeSize;
155}

References p_typeSize.

◆ getVarPtr() [1/2]

void *& AbtractField::getVarPtr ( )

Gets the varPtr of the AbtractField.

Returns
varPtr of the AbtractField

Definition at line 202 of file AbtractField.cpp.

202 {
203 return p_varPtr;
204}

References p_varPtr.

◆ getVarPtr() [2/2]

void * AbtractField::getVarPtr ( ) const

Gets the varPtr of the AbtractField.

Returns
varPtr of the AbtractField

Definition at line 195 of file AbtractField.cpp.

195 {
196 return p_varPtr;
197}

References p_varPtr.

◆ initialisationAbtractField()

void AbtractField::initialisationAbtractField ( )
private

Initialisation Function of class AbtractField.

Definition at line 265 of file AbtractField.cpp.

265 {
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}

References p_arrayPtr, p_id, p_isArray, p_isOffsetReady, p_name, p_nbElement, p_offset, p_typeSize, and p_varPtr.

Referenced by AbtractField().

+ Here is the caller graph for this function:

◆ operator=()

AbtractField & AbtractField::operator= ( const AbtractField & other)

Operator = of class AbtractField.

Parameters
other: AbtractField we want ot copy
Returns
copied class AbtractField

Definition at line 33 of file AbtractField.cpp.

33 {
34 copyAbtractField(other);
35 return *this;
36}

References AbtractField(), and copyAbtractField().

+ Here is the call graph for this function:

◆ setArrayPtr()

void AbtractField::setArrayPtr ( void ** arrayPtr)

Sets the arrayPtr of the AbtractField.

Parameters
arrayPtr: arrayPtr of the AbtractField

Definition at line 90 of file AbtractField.cpp.

90 {
91 p_arrayPtr = arrayPtr;
92}

References p_arrayPtr.

Referenced by FieldParser::addParseFieldArray().

+ Here is the caller graph for this function:

◆ setId()

void AbtractField::setId ( size_t id)

Sets the id of the AbtractField.

Parameters
id: id of the AbtractField

Definition at line 48 of file AbtractField.cpp.

48 {
49 p_id = id;
50}

References p_id.

◆ setIsArray()

void AbtractField::setIsArray ( bool isArray)

Sets the isArray of the AbtractField.

Parameters
isArray: isArray of the AbtractField

Definition at line 69 of file AbtractField.cpp.

69 {
70 p_isArray = isArray;
71}

References p_isArray.

Referenced by FieldParser::addParseFieldArray(), FieldParser::addParseFieldEnum(), and FieldParser::addParseFieldValue().

+ Here is the caller graph for this function:

◆ setIsOffsetReady()

void AbtractField::setIsOffsetReady ( bool isOffsetReady)

Sets the isOffsetReady of the AbtractField.

Parameters
isOffsetReady: isOffsetReady of the AbtractField

Definition at line 97 of file AbtractField.cpp.

97 {
98 p_isOffsetReady = isOffsetReady;
99}

References p_isOffsetReady.

Referenced by FieldParser::addParseFieldArray(), FieldParser::addParseFieldEnum(), and FieldParser::addParseFieldValue().

+ Here is the caller graph for this function:

◆ setName()

void AbtractField::setName ( const PString & name)

Sets the name of the AbtractField.

Parameters
name: name of the AbtractField

Definition at line 41 of file AbtractField.cpp.

41 {
42 p_name = name;
43}

References p_name.

◆ setNbElement()

void AbtractField::setNbElement ( size_t * nbElement)

Sets the nbElement of the AbtractField.

Parameters
nbElement: nbElement of the AbtractField

Definition at line 76 of file AbtractField.cpp.

76 {
77 p_nbElement = nbElement;
78}

References p_nbElement.

Referenced by FieldParser::addParseFieldArray(), FieldParser::addParseFieldEnum(), and FieldParser::addParseFieldValue().

+ Here is the caller graph for this function:

◆ setOffset()

void AbtractField::setOffset ( size_t offset)

Sets the offset of the AbtractField.

Parameters
offset: offset of the AbtractField

Definition at line 104 of file AbtractField.cpp.

104 {
105 p_offset = offset;
106}

References p_offset.

Referenced by FieldParser::addParseFieldArray(), FieldParser::addParseFieldEnum(), and FieldParser::addParseFieldValue().

+ Here is the caller graph for this function:

◆ setType()

void AbtractField::setType ( const FieldType::FieldType & type)

Sets the type of the AbtractField.

Parameters
type: type of the AbtractField

Definition at line 55 of file AbtractField.cpp.

55 {
56 p_type = type;
57}

References p_type.

Referenced by FieldParser::addParseFieldArray(), FieldParser::addParseFieldEnum(), FieldParser::addParseFieldValue(), and FieldParser::addSubMessage().

+ Here is the caller graph for this function:

◆ setTypeSize()

void AbtractField::setTypeSize ( size_t typeSize)

Sets the typeSize of the AbtractField.

Parameters
typeSize: typeSize of the AbtractField

Definition at line 62 of file AbtractField.cpp.

62 {
63 p_typeSize = typeSize;
64}

References p_typeSize.

Referenced by FieldParser::addParseFieldArray(), FieldParser::addParseFieldEnum(), and FieldParser::addParseFieldValue().

+ Here is the caller graph for this function:

◆ setVarPtr()

void AbtractField::setVarPtr ( void * varPtr)

Sets the varPtr of the AbtractField.

Parameters
varPtr: varPtr of the AbtractField

Definition at line 83 of file AbtractField.cpp.

83 {
84 p_varPtr = varPtr;
85}

References p_varPtr.

Referenced by FieldParser::addParseFieldEnum(), and FieldParser::addParseFieldValue().

+ Here is the caller graph for this function:

Member Data Documentation

◆ p_arrayPtr

void** AbtractField::p_arrayPtr
private

Pointer to the array to be updated.

Definition at line 71 of file AbtractField.h.

Referenced by copyAbtractField(), getArrayPtr(), getArrayPtr(), initialisationAbtractField(), and setArrayPtr().

◆ p_id

size_t AbtractField::p_id
private

Id of the field.

Definition at line 59 of file AbtractField.h.

Referenced by copyAbtractField(), getId(), getId(), initialisationAbtractField(), and setId().

◆ p_isArray

bool AbtractField::p_isArray
private

True if the Field contains an array of value, false if not.

Definition at line 65 of file AbtractField.h.

Referenced by copyAbtractField(), getIsArray(), getIsArray(), initialisationAbtractField(), and setIsArray().

◆ p_isOffsetReady

bool AbtractField::p_isOffsetReady
private

True if the offset is computed and can be used on the next read.

Definition at line 73 of file AbtractField.h.

Referenced by copyAbtractField(), getIsOffsetReady(), getIsOffsetReady(), initialisationAbtractField(), and setIsOffsetReady().

◆ p_name

PString AbtractField::p_name
private

Name of the Field.

Definition at line 57 of file AbtractField.h.

Referenced by copyAbtractField(), getName(), getName(), initialisationAbtractField(), and setName().

◆ p_nbElement

size_t* AbtractField::p_nbElement
private

Number of element of the field (NULL for scalar)

Definition at line 67 of file AbtractField.h.

Referenced by copyAbtractField(), getNbElement(), getNbElement(), initialisationAbtractField(), and setNbElement().

◆ p_offset

size_t AbtractField::p_offset
private

Offset to get the data on the next read.

Definition at line 75 of file AbtractField.h.

Referenced by copyAbtractField(), getOffset(), getOffset(), initialisationAbtractField(), and setOffset().

◆ p_type

FieldType::FieldType AbtractField::p_type
private

Type of the Field.

Definition at line 61 of file AbtractField.h.

Referenced by copyAbtractField(), getType(), getType(), and setType().

◆ p_typeSize

size_t AbtractField::p_typeSize
private

Expected size of the variable type.

Definition at line 63 of file AbtractField.h.

Referenced by copyAbtractField(), getTypeSize(), getTypeSize(), initialisationAbtractField(), and setTypeSize().

◆ p_varPtr

void* AbtractField::p_varPtr
private

Pointer to the variable to be updated.

Definition at line 69 of file AbtractField.h.

Referenced by copyAbtractField(), getVarPtr(), getVarPtr(), initialisationAbtractField(), and setVarPtr().


The documentation for this class was generated from the following files: