PhoenixProtocolBuffer  1.0.1
Set of tools to decode offset from protocol buffer
Loading...
Searching...
No Matches
phoenix_field.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 __PHOENIX_FIELD_H__
8#define __PHOENIX_FIELD_H__
9
10#include <iostream>
11#include "PPath.h"
12
13#include "parser_yml.h"
14#include "AbtractField.h"
15
16void phoenix_field(size_t & fieldId, size_t & fieldType, char*& iter);
17void phoenix_fieldSkip(char*& iter, size_t fieldType);
18void phoenix_fieldPrint(char*& iter, size_t fieldType, const char * message);
19
21
24template<typename T>
25T phoenix_readValue(char*& iter){
26 T val;
27 memcpy(&val, iter, sizeof(val));
28 iter += sizeof(val);
29 return val;
30}
31
32FieldConfig phoenix_createField(FieldType::FieldType type, size_t id, const PString & name, bool isArray = false);
33
34bool phoenix_parseFieldConfig(FieldConfig & field, const PPath & fileName, const PString & fieldConfigKey = "field_config");
35bool phoenix_parseFieldConfig(FieldConfig & field, const DicoValue & dico, const PString & fieldConfigKey);
36bool phoenix_parseFieldConfig(FieldConfig & field, const DicoValue & dico);
37
38void phoenix_printFieldMessage(const char * message, size_t nbByte);
39void phoenix_printFieldMessage(const char * message, size_t nbByte, size_t offset);
40
41
42#endif
Configuration to be used to create a field from a yml file.
FieldType
Type of the Field.
Definition FieldType.h:14
FieldConfig phoenix_createField(FieldType::FieldType type, size_t id, const PString &name, bool isArray=false)
Create a FieldConfig.
bool phoenix_parseFieldConfig(FieldConfig &field, const PPath &fileName, const PString &fieldConfigKey="field_config")
Parse a yml file and search for a field_config key.
void phoenix_printFieldMessage(const char *message, size_t nbByte)
Print the Fields in a message.
T phoenix_readValue(char *&iter)
Read a value.
void phoenix_field(size_t &fieldId, size_t &fieldType, char *&iter)
Reads a Field header.
void phoenix_fieldPrint(char *&iter, size_t fieldType, const char *message)
Print the current field.
void phoenix_fieldSkip(char *&iter, size_t fieldType)
Skip the current field.