Commit 03a65cdb authored by Mathieu Faverge's avatar Mathieu Faverge

Support new naming convention in Paje, the old one is still supported

parent 205d4f05
......@@ -82,23 +82,32 @@
* the need of the user.
*/
#define FIELDNAME_SIZEMAX 32
#define FIELDNAME_SIZE 16
#define FIELDNAME_SIZE 14
#define _PajeFN_Time 0
#define _PajeFN_Name 1
#define _PajeFN_Alias 2
#define _PajeFN_Type 3
#define _PajeFN_Container 4
#define _PajeFN_StartContainerType 5
#define _PajeFN_EndContainerType 6
#define _PajeFN_StartContainer 7
#define _PajeFN_EndContainer 8
#define _PajeFN_Color 9
#define _PajeFN_Value 10
#define _PajeFN_Key 11
#define _PajeFN_File 12
#define _PajeFN_Line 13
/*
* Former type that are no longer used in Paje Format.
* Kept here for compatibility
*/
#define _PajeFN_ContainerType 3
#define _PajeFN_EntityType 4
#define _PajeFN_Type 5
#define _PajeFN_Container 6
#define _PajeFN_SourceContainerType 7
#define _PajeFN_DestContainerType 8
#define _PajeFN_SourceContainer 9
#define _PajeFN_DestContainer 10
#define _PajeFN_Color 11
#define _PajeFN_Value 12
#define _PajeFN_Key 13
#define _PajeFN_File 14
#define _PajeFN_Line 15
#define _PajeFN_EntityType 3
#define _PajeFN_SourceContainerType 5
#define _PajeFN_DestContainerType 6
#define _PajeFN_SourceContainer 7
#define _PajeFN_DestContainer 8
/*!
* \brief Types for the fields
......
......@@ -135,14 +135,12 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
INSERT_FNAME(Time, _FieldType_Date );
INSERT_FNAME(Name, _FieldType_Int | _FieldType_String );
INSERT_FNAME(Alias, _FieldType_Int | _FieldType_String );
INSERT_FNAME(ContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(EntityType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(Type, _FieldType_Int | _FieldType_String );
INSERT_FNAME(Container, _FieldType_Int | _FieldType_String );
INSERT_FNAME(SourceContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(DestContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(SourceContainer, _FieldType_Int | _FieldType_String );
INSERT_FNAME(DestContainer, _FieldType_Int | _FieldType_String );
INSERT_FNAME(StartContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(EndContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(StartContainer, _FieldType_Int | _FieldType_String );
INSERT_FNAME(EndContainer, _FieldType_Int | _FieldType_String );
INSERT_FNAME(Color, _FieldType_Color );
INSERT_FNAME(Value, _FieldType_Int | _FieldType_String | _FieldType_Double);
INSERT_FNAME(Key, _FieldType_Int | _FieldType_String );
......@@ -155,17 +153,25 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
_FNameStr2Id.insert(pair<string, int>(_FieldNames[i]._name, i));
}
// Former types no longer used in Paje format
_FNameStr2Id.insert(pair<string, int>("ContainerType" , _PajeFN_ContainerType ));
_FNameStr2Id.insert(pair<string, int>("EntityType" , _PajeFN_EntityType ));
_FNameStr2Id.insert(pair<string, int>("SourceContainerType", _PajeFN_SourceContainerType ));
_FNameStr2Id.insert(pair<string, int>("DestContainerType" , _PajeFN_DestContainerType ));
_FNameStr2Id.insert(pair<string, int>("SourceContainer" , _PajeFN_SourceContainer ));
_FNameStr2Id.insert(pair<string, int>("DestContainer" , _PajeFN_DestContainer ));
// Initialize the list of Events available
i = 0;
_EventDefs.resize(PAJE_EVENTDEF_SIZE);
INSERT_EVENT(PajeDefineContainerType, CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) );
INSERT_EVENT(PajeDefineEventType , CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) );
INSERT_EVENT(PajeDefineStateType , CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) );
INSERT_EVENT(PajeDefineVariableType , CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) );
INSERT_EVENT(PajeDefineEntityValue , CODE2(Name) | CODE2(Alias) | CODE2(EntityType) );
INSERT_EVENT(PajeDefineContainerType, CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDefineEventType , CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDefineStateType , CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDefineVariableType , CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDefineEntityValue , CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDestroyContainer , CODE2(Name) | CODE2(Alias) | CODE2(Time) | CODE2(Type) );
INSERT_EVENT(PajeCreateContainer , CODE2(Name) | CODE2(Alias) | CODE2(Time) | CODE2(Type) | CODE2(Container) );
INSERT_EVENT(PajeDefineLinkType , CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) | CODE2(SourceContainerType) | CODE2(DestContainerType) );
INSERT_EVENT(PajeDefineLinkType , CODE2(Name) | CODE2(Alias) | CODE2(Type) | CODE2(StartContainerType) | CODE2(EndContainerType) );
INSERT_EVENT(PajePopState , CODE2(Time) | CODE2(Type) | CODE2(Container) );
INSERT_EVENT(PajeSetState , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
INSERT_EVENT(PajePushState , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
......@@ -173,9 +179,8 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
INSERT_EVENT(PajeSetVariable , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
INSERT_EVENT(PajeAddVariable , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
INSERT_EVENT(PajeSubVariable , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
INSERT_EVENT(PajeStartLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(SourceContainer) );
INSERT_EVENT(PajeEndLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(DestContainer) );
INSERT_EVENT(PajeStartLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(StartContainer) );
INSERT_EVENT(PajeEndLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(EndContainer) );
}
ParserDefinitionPaje::~ParserDefinitionPaje() {
......@@ -411,5 +416,3 @@ int ParserDefinitionPaje::definitions_number() const {
const vector<PajeFieldName> *ParserDefinitionPaje::get_FieldNames() const {
return &_FieldNames;
}
This diff is collapsed.
......@@ -146,20 +146,12 @@ int mt_ParserEventPaje::store_event(const PajeLine *line,
name = fvalue;
break;
case _PajeFN_ContainerType :
tb_struct->container_type = fvalue;
case _PajeFN_StartContainerType :
tb_struct->start_container_type = fvalue;
break;
case _PajeFN_SourceContainerType :
tb_struct->source_container_type = fvalue;
break;
case _PajeFN_DestContainerType :
tb_struct->dest_container_type = fvalue;
break;
case _PajeFN_EntityType :
tb_struct->entity_type = fvalue;
case _PajeFN_EndContainerType :
tb_struct->end_container_type = fvalue;
break;
case _PajeFN_Time :
......@@ -196,12 +188,12 @@ int mt_ParserEventPaje::store_event(const PajeLine *line,
}
break;
case _PajeFN_SourceContainer :
tb_struct->source_container = fvalue;
case _PajeFN_StartContainer :
tb_struct->start_container = fvalue;
break;
case _PajeFN_DestContainer :
tb_struct->dest_container = fvalue;
case _PajeFN_EndContainer :
tb_struct->end_container = fvalue;
break;
case _PajeFN_Key :
......@@ -377,4 +369,3 @@ int mt_ParserEventPaje::store_event(const PajeLine *line,
}
return 0;
}
......@@ -265,4 +265,3 @@ float mt_ParserPaje::get_percent_loaded() const {
else
return 0.;
}
This diff is collapsed.
......@@ -41,16 +41,14 @@ typedef struct Trace_builder_struct{
void (*func)(Trace_builder_struct*);
Date time;
Name alias;
String container_type;
String source_container_type;
String dest_container_type;
String entity_type;
String type;
String start_container_type;
String end_container_type;
String container;
String value_string;
Double value_double;
String source_container;
String dest_container;
String start_container;
String end_container;
String key;
std::map<std::string, Value *> extra_fields;
//std::map<std::string, Value *> *extra_fields;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment