Commit 7fc3ab38 authored by Arthur Redondy's avatar Arthur Redondy

Ajout des messages d'erreurs lorsque certains conteneurs ou types de...

Ajout des messages d'erreurs lorsque certains conteneurs ou types de conteneurs ou autre n'existent pas + changement du comportement lorsque un entity value n'existe pas : creation
parent 79a4f119
......@@ -28,12 +28,10 @@ const string Error::_LINE_TOO_SHORT_EVENT = "missing field value(s) in an event"
const string Error::_UNKNOWN_CONTAINER_TYPE = "Unknown container type: ";
const string Error::_UNKNOWN_CONTAINER = "Unknown container: ";
const string Error::_UNKNOWN_EVENT_TYPE = "Unknown event type: ";
const string Error::_UNKNOWN_EVENT = "Unknown event: ";
const string Error::_UNKNOWN_STATE_TYPE = "Unknown state type: ";
const string Error::_UNKNOWN_VARIABLE_TYPE = "Unknown variable type: ";
const string Error::_UNKNOWN_LINK_TYPE = "Unknown link type: ";
const string Error::_UNKNOWN_ENTITY_TYPE = "Unknown entity type: ";
const string Error::_UNKNOWN_ENTITY_VALUE = "Unknown entity value: ";
int Error::_priority_printable_min;
......
......@@ -131,15 +131,34 @@ public:
/// Errors from undefined entities
//////
/*!
* \brief Define the error when a container type does not exist.
*/
const static std::string _UNKNOWN_CONTAINER_TYPE;
/*!
* \brief Define the error when a containere does not exist.
*/
const static std::string _UNKNOWN_CONTAINER;
/*!
* \brief Define the error when an event type does not exist.
*/
const static std::string _UNKNOWN_EVENT_TYPE;
const static std::string _UNKNOWN_EVENT;
/*!
* \brief Define the error when a state type does not exist.
*/
const static std::string _UNKNOWN_STATE_TYPE;
/*!
* \brief Define the error when a variable type does not exist.
*/
const static std::string _UNKNOWN_VARIABLE_TYPE;
/*!
* \brief Define the error when a link type does not exist.
*/
const static std::string _UNKNOWN_LINK_TYPE;
/*!
* \brief Define the error when a entity type does not exist.
*/
const static std::string _UNKNOWN_ENTITY_TYPE;
const static std::string _UNKNOWN_ENTITY_VALUE;
......
This diff is collapsed.
......@@ -256,7 +256,6 @@ ContainerType *Trace::search_container_type(String name) const {
return r;
}
// *Message::get_instance() << "Unknown container type: " << name.to_string() << Message::ende;
return 0;
}
......@@ -274,7 +273,6 @@ Container *Trace::search_container(String name) const {
return r;
}
//*Message::get_instance() << "Unknown container: " << name.to_string() << Message::ende;
return 0;
}
......@@ -286,7 +284,6 @@ EventType *Trace::search_event_type(String name) const {
return *it;
}
// *Message::get_instance() << "Unknown event: " << name.to_string() << Message::ende;
return 0;
}
......@@ -310,7 +307,6 @@ VariableType *Trace::search_variable_type(String name) const {
return *it;
}
// *Message::get_instance() << "Unknown variable type: " << name.to_string() << Message::ende;
return 0;
}
......@@ -322,7 +318,6 @@ LinkType *Trace::search_link_type(String name) const {
return *it;
}
// *Message::get_instance() << "Unknown link type: " << name.to_string() << Message::ende;
return 0;
}
......@@ -346,23 +341,20 @@ EntityType *Trace::search_entity_type(String name) const {
return *it;
}
// *Message::get_instance() << "Unknown entity type: " << name.to_string() << Message::ende;
return 0;
}
EntityValue *Trace::search_entity_value(String name) const {
for (list<StateType *>::const_iterator it1 = _state_types.begin();
it1 != _state_types.end();
it1++) {
for (list<EntityValue *>::const_iterator it2 = (*it1)->get_values()->begin();
it2 != (*it1)->get_values()->end();
it2++) {
if ((*it2)->get_name() == name)
return *it2;
}
EntityValue *Trace::search_entity_value(String name, EntityType *entity_type) const {
for (list<EntityValue *>::const_iterator it = entity_type->get_values()->begin();
it != entity_type->get_values()->end();
it++) {
if ((*it)->get_name() == name)
return *it;
}
// *Message::get_instance() << "Unknown entity value: " << name.to_string() << Message::ende;
return 0;
Name alias_name;
alias_name.set_name(name.to_string());
EntityValue *value = new EntityValue(alias_name, entity_type, map<std::string, Value*>());
entity_type->add_value(value);
return value;
}
......@@ -294,7 +294,7 @@ public :
* \fn search_entity_value(String name) const
* \brief Search a container by his name or alias
*/
EntityValue *search_entity_value(String name) const;
EntityValue *search_entity_value(String name, EntityType *entity_type) const;
};//end class
......
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