-value* value::get_or_new(const char* name, const char* color, Type* father)
-{
- value* ret = 0;
- try {
- ret = value::get(name, father);
- }
- catch(xbt_ex& e) {
- value rett(name, color, father);
- ret = rett.ret;
- }
- return ret;
-}
-
-value* value::get(const char* name, Type* father)
-{
- if (name == nullptr || father == nullptr){
- THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)");
- }
-
- if (father->kind == TYPE_VARIABLE)
- THROWF(tracing_error, 0, "variables can't have different values (%s)", father->name);
- value* ret = (value*)xbt_dict_get_or_null(father->values, name);
- if (ret == nullptr) {
- THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name, father->name);
- }
- return ret;
-}