Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit a01dd8c7 authored by Arthur Redondy's avatar Arthur Redondy
Browse files

avancement parser d evenements

parent 39d7ebde
#include "ParserEventDecoder.hpp"
//#define INSTANCIATE(nom_de_champPaje,type,nom_variable,nom_variable_is_initialized) if (fields[i-1].name == nom_de_champPaje) { \
// if(!String::instanciate(current_value, nom_variable)) { \
// cout << "warning : incompatible value" << endl; \
// return; \
// } \
// nom_variable_is_initialized = true; \
// }
ParserEventDecoder::ParserEventDecoder(){
......@@ -8,46 +15,46 @@ ParserEventDecoder::ParserEventDecoder(){
void ParserEventDecoder::store_event(const Definition &definition,Line &line, Trace &trace){
String alias;
bool alias_is_initialized;
bool alias_is_initialized = false;
String name;
bool name_is_initialized;
bool name_is_initialized = false;
String container_type;
bool container_type_is_initialized;
bool container_type_is_initialized = false;
String source_container_type;
bool source_container_type_is_initialized;
bool source_container_type_is_initialized = false;
String dest_container_type;
bool dest_container_type_is_initialized;
bool dest_container_type_is_initialized = false;
String entity_type;
bool entity_type_is_initialized;
bool entity_type_is_initialized = false;
Date time;
bool time_is_initialized;
bool time_is_initialized = false;
String type;
bool type_is_initialized;
bool type_is_initialized = false;
String container;
bool container_is_initialized;
bool container_is_initialized = false;
String value_string;
bool value_string_is_initialized;
bool value_string_is_initialized = false;
Double value_double;
bool value_double_is_initialized;
bool value_double_is_initialized = false;
String source_container;
bool source_container_is_initialized;
bool source_container_is_initialized = false;
String dest_container;
bool dest_container_is_initialized;
bool dest_container_is_initialized = false;
String key;
bool key_is_initialized;
bool key_is_initialized = false;
int i=1;
vector<field> fields = definition.get_fields();
......@@ -62,18 +69,46 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
}
if (fields[i-1].name == "Alias") {
if((fields[i-1].type != "string") || (fields[i-1].type != "integer")) {
cout << "warning : type not suitable" << endl;
if(!String::instanciate(current_value, alias)) {
cout << "warning : incompatible value" << endl;
return;
}
if(!Date::instanciate(current_value, alias)) {
alias_is_initialized = true;
}
if (fields[i-1].name == "Name") {
if(!String::instanciate(current_value, name)) {
cout << "warning : incompatible value" << endl;
return;
}
name_is_initialized = true;
}
if (fields[i-1].name == "ContainerType") {
if(!String::instanciate(current_value, container_type)) {
cout << "warning : incompatible value" << endl;
return;
}
container_type_is_initialized = true;
}
i++;
}
if(line.size > i) {
cout << "warning : extra value(s)" << endl;
}
string event_name = definition.get_event_name();
if(event_name == "PajeDefineContainerType") {
if(container_type_is_initialized&&alias_name_is_initialized) {
trace.define_container_type(container_type, alias_name);
}
else {
cout << "warning : incompatible evenement" << endl;
return;
}
}
}
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