Commit c02006ff authored by Olivier Lagrasse's avatar Olivier Lagrasse
Browse files

compilation marche

parent 402845ab
......@@ -17,10 +17,11 @@ DIR_INTERFACE = interface
DIR_TRACE = trace/src
all:
@(cd $(DIR_TRACE) && make)
@(cd $(DIR_INTERFACE) && make)
@(cd $(DIR_PARSER) && make)
@(cd $(DIR_INTERFACE) && make)
@echo " "
@echo "Compilation completed! File created in 'bin' folder."
@echo " "
......
......@@ -183,10 +183,11 @@ void Interface_graphic::on_open_triggered(){
// _trace = new Trace();
ParserPaje parser();
parser.parse(filename.toStdString(), Trace());
Trace trace;
ParserPaje parser;
parser.parse(filename.toStdString(), trace);
if (build(_trace)==false)
if (build(&trace)==false)
error("Open file : an error occured with wait screen releasing.");
......
......@@ -16,6 +16,13 @@ HEADERS += interface.hpp \
interface_graphic.hpp \
render_area.hpp \
resource.hpp \
../../parser/src/Definition.hpp \
../../parser/src/Line.hpp \
../../parser/src/Parser.hpp \
../../parser/src/ParserDefinitionDecoder.hpp \
../../parser/src/ParserEventDecoder.hpp \
../../parser/src/ParserPaje.hpp \
../../parser/src/TokenSource.hpp \
../../trace/src/Container.hpp \
../../trace/src/ContainerType.hpp \
../../trace/src/Entity.hpp \
......@@ -36,6 +43,12 @@ HEADERS += interface.hpp \
FORMS += info_window.ui main_window.ui maquette.ui
SOURCES += interface_console.cpp interface_graphic.cpp render_area.cpp \
../../parser/src/Definition.cpp \
../../parser/src/Line.cpp \
../../parser/src/ParserDefinitionDecoder.cpp \
../../parser/src/ParserEventDecoder.cpp \
../../parser/src/ParserPaje.cpp \
../../parser/src/TokenSource.cpp \
../../trace/src/Container.cpp \
../../trace/src/ContainerType.cpp \
../../trace/src/Entity.cpp \
......
......@@ -65,6 +65,7 @@ class Render_area;
#include "trace/src/Trace.hpp"
#include "parser/src/ParserPaje.hpp"
#include "interface/src/interface.hpp"
#include "interface/src/interface_console.hpp"
#include "interface/src/interface_graphic.hpp"
......
......@@ -185,7 +185,7 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
}
else if(event_name == "PajeDestroyContainer") {
trace.destroy_container(time, alias_name, trace.search_container_type(type), extra_fields);
trace.destroy_container(time, trace.search_container(alias_name.to_String()), trace.search_container_type(type), extra_fields);
}
else if(event_name == "PajeDefineEventType") {
......@@ -236,12 +236,12 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
trace.sub_variable(time, trace.search_variable_type(type), trace.search_container(container), value_double, extra_fields);
}
else if(event_name == "PajeStartLink") {
trace.start_link(time, trace.search_link_type(type), trace.search_container(container), trace.search_container(source_container), trace.search_entity_value(value_string), key, extra_fields);
else if(event_name == "PajeStartLink") { // key a la place de Integer() mais fautle mettre dans le bon type...
trace.start_link(time, trace.search_link_type(type), trace.search_container(container), trace.search_container(source_container), trace.search_entity_value(value_string), Integer(), extra_fields);
}
else if(event_name == "PajeEndLink") {
trace.end_link(time, trace.search_link_type(type), trace.search_container(container), trace.search_container(dest_container), trace.search_entity_value(value_string), key, extra_fields);
else if(event_name == "PajeEndLink") { // key a la place de Integer() mais fautle mettre dans le bon type...
trace.end_link(time, trace.search_link_type(type), trace.search_container(container), trace.search_container(dest_container), trace.search_entity_value(value_string), Integer(), extra_fields);
}
else {
......
......@@ -12,8 +12,7 @@
#include "../../trace/src/values/Integer.hpp"
#include "../../trace/src/values/Name.hpp"
#include "../../trace/src/values/String.hpp"
#include "../tests/stub/trace.hpp"
//#include "../../trace/src/Trace.hpp"
#include "../../trace/src/Trace.hpp"
/**
* \class ParserEventDecoder
......
#include "Trace.hpp"
Trace::~Trace() {
}
void Trace::define_container_type(Name name, ContainerType *parent, const vector<Value> &opt) {
void Trace::define_container_type(Name &name, ContainerType *parent, const vector<Value *> &opt) {
ContainerType *type = new ContainerType(name, parent);
if (parent)
parent->add_child(type);
......@@ -12,7 +11,7 @@ void Trace::define_container_type(Name name, ContainerType *parent, const vector
_root_container_types.push_back(type);
}
void Trace::create_container(Date time, Name name, ContainerType *type, Container *parent, const vector<Value> &opt) {
void Trace::create_container(Date &time, Name &name, ContainerType *type, Container *parent, const vector<Value *> &opt) {
Container *cont = new Container(name, time, type, parent);
if (parent)
parent->add_child(cont);
......@@ -20,63 +19,63 @@ void Trace::create_container(Date time, Name name, ContainerType *type, Containe
_root_containers.push_back(cont);
}
void Trace::destroy_container(Date time, Container *cont, ContainerType *type, const vector<Value> &opt) {
void Trace::destroy_container(Date &time, Container *cont, ContainerType *type, const vector<Value *> &opt) {
cont->destroy(time);
}
void Trace::define_event_type(Name name, ContainerType *container_type, const vector<Value> &opt) {
void Trace::define_event_type(Name &name, ContainerType *container_type, const vector<Value *> &opt) {
}
void Trace::define_state_type(Name name, ContainerType *container_type, const vector<Value> &opt) {
void Trace::define_state_type(Name &name, ContainerType *container_type, const vector<Value *> &opt) {
_state_types.push_back(new StateType(name, container_type));
}
void Trace::define_variable_type(Name name, ContainerType *container_type, const vector<Value> &opt) {
void Trace::define_variable_type(Name &name, ContainerType *container_type, const vector<Value *> &opt) {
}
void Trace::define_link_type(Name name, ContainerType *ancestor, ContainerType *source, ContainerType *destination, const vector<Value> &opt) {
void Trace::define_link_type(Name &name, ContainerType *ancestor, ContainerType *source, ContainerType *destination, const vector<Value *> &opt) {
}
void Trace::define_entity_value(Name name, EntityType *entity_type, const vector<Value> &opt) {
void Trace::define_entity_value(Name &name, EntityType *entity_type, const vector<Value *> &opt) {
entity_type->add_value(new EntityValue(name, entity_type));
}
void Trace::set_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value> &opt) {
void Trace::set_state(Date &time, StateType *type, Container *container, EntityValue *value, const vector<Value *> &opt) {
container->set_state(time, type, value);
}
void Trace::push_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value> &opt) {
void Trace::push_state(Date &time, StateType *type, Container *container, EntityValue *value, const vector<Value *> &opt) {
container->push_state(time, type, value);
}
void Trace::pop_state(Date time, StateType *type, Container *container, const vector<Value> &opt) {
void Trace::pop_state(Date &time, StateType *type, Container *container, const vector<Value *> &opt) {
container->pop_state(time);
}
void Trace::new_event(Date time, EventType *type, Container *container, EntityValue *value, const vector<Value> &opt) {
void Trace::new_event(Date &time, EventType *type, Container *container, EntityValue *value, const vector<Value *> &opt) {
}
void Trace::set_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value> &opt) {
void Trace::set_variable(Date &time, VariableType *type, Container *container, Double value, const vector<Value *> &opt) {
}
void Trace::add_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value> &opt) {
void Trace::add_variable(Date &time, VariableType *type, Container *container, Double value, const vector<Value *> &opt) {
}
void Trace::sub_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value> &opt) {
void Trace::sub_variable(Date &time, VariableType *type, Container *container, Double value, const vector<Value *> &opt) {
}
void Trace::start_link(Date time, LinkType *type, Container *ancestor, Container *source, EntityValue *value, Integer key, const vector<Value> &opt) {
void Trace::start_link(Date &time, LinkType *type, Container *ancestor, Container *source, EntityValue *value, Integer key, const vector<Value *> &opt) {
}
void Trace::end_link(Date time, LinkType *type, Container *ancestor, Container *destination, EntityValue *value, Integer key, const vector<Value> &opt) {
void Trace::end_link(Date &time, LinkType *type, Container *ancestor, Container *destination, EntityValue *value, Integer key, const vector<Value *> &opt) {
}
......
......@@ -54,18 +54,18 @@ public :
/*!
*
*\fn define_container_type(Name alias, ContainerType *container_type_parent, const vector<Value> &opt)
*\fn define_container_type(Name alias, ContainerType *container_type_parent, const vector<Value *> &opt)
*\brief This function is to define a container type
*
*\param alias the type of his parent container
*\param container_type_parent an object that can contain a name, an alias or both
*
*/
void define_container_type(Name alias, ContainerType *container_type_parent, const vector<Value> &opt);
void define_container_type(Name &alias, ContainerType *container_type_parent, const vector<Value *> &opt);
/*!
*
*\fn create_container(Date time, Name alias, ContainerType *type, Container *parent, const vector<Value> &opt)
*\fn create_container(Date time, Name alias, ContainerType *type, Container *parent, const vector<Value *> &opt)
*\brief This function is to create a container
*
*
......@@ -75,11 +75,11 @@ public :
*\param String : the parent of the container
*
*/
void create_container(Date time, Name alias, ContainerType *type, Container *parent, const vector<Value> &opt);
void create_container(Date &time, Name &alias, ContainerType *type, Container *parent, const vector<Value *> &opt);
/*!
*
*\fn destroy_container(Date time, Container *cont, ContainerType *type, const vector<Value> &opt)
*\fn destroy_container(Date time, Container *cont, ContainerType *type, const vector<Value *> &opt)
*\brief This function is to destroy a container
*
*\param time When the container is destroyed
......@@ -87,24 +87,24 @@ public :
*\param type the type of the container
*
*/
void destroy_container(Date time, Container *cont, ContainerType *type, const vector<Value> &opt);
void destroy_container(Date &time, Container *cont, ContainerType *type, const vector<Value *> &opt);
/*!
*
*\fn define_event_type(Name alias, ContainerType *container_type, const vector<Value> &opt)
*\fn define_event_type(Name alias, ContainerType *container_type, const vector<Value *> &opt)
*\brief This function is to define a type of event
*
*\param alias an object that can contain a name, an alias or both
*\param container_type the type of the container
*
*/
void define_event_type(Name alias, ContainerType *container_type, const vector<Value> &opt);
void define_event_type(Name &alias, ContainerType *container_type, const vector<Value *> &opt);
/*!
*
*\fn define_state_type(Name alias, ContainerType *container_type, const vector<Value> &opt)
*\fn define_state_type(Name alias, ContainerType *container_type, const vector<Value *> &opt)
*\brief This function is to define a type of state
*
*\param alias an object that can contain a name, an alias or both
......@@ -112,24 +112,24 @@ public :
*
*
*/
void define_state_type(Name alias, ContainerType *container_type, const vector<Value> &opt);
void define_state_type(Name &alias, ContainerType *container_type, const vector<Value *> &opt);
/*!
*
*\fn define_variable_type(Name alias, ContainerType *container_type, const vector<Value> &opt)
*\fn define_variable_type(Name alias, ContainerType *container_type, const vector<Value *> &opt)
*\brief This function is to define a type of variable
*
*\param alias an object that can contain a name, an alias or both
*\param container_type the type of the container
*
*/
void define_variable_type(Name alias, ContainerType *container_type, const vector<Value> &opt);
void define_variable_type(Name &alias, ContainerType *container_type, const vector<Value *> &opt);
/*!
*
*\fn define_link_type(Name alias, ContainerType *ancestor, ContainerType *source, ContainerType *destination, const vector<Value> &opt)
*\fn define_link_type(Name alias, ContainerType *ancestor, ContainerType *source, ContainerType *destination, const vector<Value *> &opt)
*\brief This function is to define a type of link
*
*\param alias an object that can contain a name, an alias or both
......@@ -138,24 +138,24 @@ public :
*\param destination the type of the container where the link goes
*
*/
void define_link_type(Name alias, ContainerType *ancestor, ContainerType *source, ContainerType *destination, const vector<Value> &opt);
void define_link_type(Name &alias, ContainerType *ancestor, ContainerType *source, ContainerType *destination, const vector<Value *> &opt);
/*!
*
*\fn define_entity_value(Name alias, EntityType *entity_type, const vector<Value> &opt)
*\fn define_entity_value(Name alias, EntityType *entity_type, const vector<Value *> &opt)
*\brief This function is to define_entity_value
*
*\param alias an object that can contain a name, an alias or both
*\param entity_type the type of the entity
*
*/
void define_entity_value(Name alias, EntityType *entity_type, const vector<Value> &opt);
void define_entity_value(Name &alias, EntityType *entity_type, const vector<Value *> &opt);
/*!
*
*\fn set_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value> &opt)
*\fn set_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value *> &opt)
*\brief This function is to set a state
*
*\param time Moment when it changes of state
......@@ -164,12 +164,12 @@ public :
*\param value the new value of the state
*
*/
void set_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value> &opt);
void set_state(Date &time, StateType *type, Container *container, EntityValue *value, const vector<Value *> &opt);
/*!
*
*\fn push_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value> &opt)
*\fn push_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value *> &opt)
*\brief This function is to push a state on the stack
*
*\param Date : Moment when the state is pushed
......@@ -178,12 +178,12 @@ public :
*\param String : the new value of the state
*
*/
void push_state(Date time, StateType *type, Container *container, EntityValue *value, const vector<Value> &opt);
void push_state(Date &time, StateType *type, Container *container, EntityValue *value, const vector<Value *> &opt);
/*!
*
*\fn pop_state(Date time, StateType *type, Container *container, const vector<Value> &opt)
*\fn pop_state(Date time, StateType *type, Container *container, const vector<Value *> &opt)
*\brief This function is to pop a state from the stack
*
*\param time Moment when the state is popped
......@@ -191,12 +191,12 @@ public :
*\param container the container
*
*/
void pop_state(Date time, StateType *type, Container *container, const vector<Value> &opt);
void pop_state(Date &time, StateType *type, Container *container, const vector<Value *> &opt);
/*!
*
*\fn new_event(Date time, EventType *type, Container *container, EntityValue *value, const vector<Value> &opt)
*\fn new_event(Date time, EventType *type, Container *container, EntityValue *value, const vector<Value *> &opt)
*\brief This function is to create a new event
*
*\param time When the new event arrives
......@@ -205,12 +205,12 @@ public :
*\param value the value of the event
*
*/
void new_event(Date time, EventType *type, Container *container, EntityValue *value, const vector<Value> &opt);
void new_event(Date &time, EventType *type, Container *container, EntityValue *value, const vector<Value *> &opt);
/*!
*
*\fn set_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value> &opt)
*\fn set_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value *> &opt)
*\brief This function is to set a value to the variable
*
*\param time When the variable is set
......@@ -219,12 +219,12 @@ public :
*\param value the value of the variable
*
*/
void set_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value> &opt);
void set_variable(Date &time, VariableType *type, Container *container, Double value, const vector<Value *> &opt);
/*!
*
*\fn add_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value> &opt)
*\fn add_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value *> &opt)
*\brief This function is to add a new variable
*
*\param time When th variable is incremented
......@@ -233,12 +233,12 @@ public :
*\param value the value of the variable
*
*/
void add_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value> &opt);
void add_variable(Date &time, VariableType *type, Container *container, Double value, const vector<Value *> &opt);
/*!
*
*\fn sub_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value> &opt)
*\fn sub_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value *> &opt)
*\brief This function is to substract a value to the variable
*
*\param time When the variable is decremented
......@@ -247,12 +247,12 @@ public :
*\param value the value of the variable
*
*/
void sub_variable(Date time, VariableType *type, Container *container, Double value, const vector<Value> &opt);
void sub_variable(Date &time, VariableType *type, Container *container, Double value, const vector<Value *> &opt);
/*!
*
*\fn start_link(Date time, LinkType *type, Container *ancestor, Container *source, EntityValue *value, Integer key, const vector<Value> &opt)
*\fn start_link(Date time, LinkType *type, Container *ancestor, Container *source, EntityValue *value, Integer key, const vector<Value *> &opt)
*\brief This function is to start a link
*
*\param time When the link starts
......@@ -262,12 +262,12 @@ public :
*\param value the value of the variable
*
*/
void start_link(Date time, LinkType *type, Container *ancestor, Container *source, EntityValue *value, Integer key, const vector<Value> &opt);
void start_link(Date &time, LinkType *type, Container *ancestor, Container *source, EntityValue *value, Integer key, const vector<Value *> &opt);
/*!
*
*\fn end_link(Date time, LinkType *type, Container *ancestor, Container *destination, EntityValue *value, Integer key, const vector<Value> &opt)
*\fn end_link(Date time, LinkType *type, Container *ancestor, Container *destination, EntityValue *value, Integer key, const vector<Value *> &opt)
*\brief This function is to end a link
*
*\param time When the link ends
......@@ -277,7 +277,7 @@ public :
*\param value the value of the variable
*
*/
void end_link(Date time, LinkType *type, Container *ancestor, Container *destination, EntityValue *value, Integer key, const vector<Value> &opt);
void end_link(Date &time, LinkType *type, Container *ancestor, Container *destination, EntityValue *value, Integer key, const vector<Value *> &opt);
/*!
......
......@@ -26,6 +26,13 @@ Name::Name(const Name &name) : Value(name){
_alias = name._alias;
}
String Name::to_String() const{
if (!_name.empty())
return String(_name);
else
return String(_alias);
}
std::string Name::to_string() const {
if (!_name.empty())
return _name;
......
......@@ -70,6 +70,14 @@ public:
*/
std::string to_string() const;
/*!
*
* \fn to_String() const
* \return The name of the object, if it exists, the alias otherwise
*
*/
String to_String() const;
/*!
*
* \fn operator== (String &) const
......
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