- e_entity_types kind_;
- Type* father_;
- xbt_dict_t children_;
- xbt_dict_t values_; // valid for all types except variable and container
- Type(const char* typeNameBuff, const char* key, const char* color, e_entity_types kind, Type* father);
- ~Type();
- Type* getChild(const char* name);
- Type* getChildOrNull(const char* name);
-
- static Type* containerNew(const char* name, Type* father);
- static Type* eventNew(const char* name, Type* father);
- static Type* variableNew(const char* name, const char* color, Type* father);
- static Type* linkNew(const char* name, Type* father, Type* source, Type* dest);
- static Type* stateNew(const char* name, Type* father);
+ Type(std::string name, std::string alias, std::string color, Type* father);
+ virtual ~Type();
+
+ std::string getName() { return name_; }
+ const char* getCname() { return name_.c_str(); }
+ long long int getId() { return id_; }
+ bool isColored() { return not color_.empty(); }
+
+ Type* byName(std::string name);
+
+ ContainerType* getOrCreateContainerType(std::string name);
+ EventType* getOrCreateEventType(std::string name);
+ LinkType* getOrCreateLinkType(std::string name, Type* source, Type* dest);
+ StateType* getOrCreateStateType(std::string name);
+ VariableType* getOrCreateVariableType(std::string name, std::string color);
+
+ void logDefinition(e_event_type event_type);
+ void logDefinition(Type* source, Type* dest);
+
+ static ContainerType* createRootType();
+ static ContainerType* getRootType();
+};
+
+class ContainerType : public Type {
+public:
+ ContainerType(std::string name, Type* father);
+};
+
+class VariableType : public Type {
+public:
+ VariableType(std::string name, std::string color, Type* father);
+};
+
+class ValueType : public Type {
+public:
+ std::map<std::string, Value*> values_;
+ ValueType(std::string name, std::string alias, Type* father) : Type(name, alias, "", father){};
+ ValueType(std::string name, Type* father) : Type(name, name, "", father){};
+ virtual ~ValueType();
+ void addEntityValue(std::string name, std::string color);
+ void addEntityValue(std::string name);
+ Value* getEntityValue(std::string name);
+};
+
+class LinkType : public ValueType {
+public:
+ LinkType(std::string name, std::string alias, Type* father);
+};
+
+class EventType : public ValueType {
+public:
+ EventType(std::string name, Type* father);
+};
+
+class StateType : public ValueType {
+public:
+ StateType(std::string name, Type* father);