Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a few more simplifications
[simgrid.git] / src / instr / instr_paje_types.hpp
index f1d24c2..6d9a9bf 100644 (file)
@@ -7,6 +7,9 @@
 #define INSTR_PAJE_TYPES_HPP
 
 #include "src/instr/instr_private.hpp"
+#include <string>
+#include <vector>
+
 namespace simgrid {
 namespace instr {
 enum e_event_type : unsigned int;
@@ -16,6 +19,8 @@ class EventType;
 class LinkType;
 class StateType;
 class VariableType;
+class StateEvent;
+class VariableEvent;
 
 class Type {
   long long int id_;
@@ -35,11 +40,13 @@ public:
   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);
+  StateType* getState(std::string name);
+
   VariableType* getOrCreateVariableType(std::string name, std::string color);
 
   void logDefinition(e_event_type event_type);
@@ -51,12 +58,19 @@ public:
 
 class ContainerType : public Type {
 public:
+  explicit ContainerType(std::string name) : Type(name, name, "", nullptr){};
   ContainerType(std::string name, Type* father);
 };
 
 class VariableType : public Type {
+  std::vector<VariableEvent*> events_;
+
 public:
   VariableType(std::string name, std::string color, Type* father);
+  ~VariableType();
+  void setEvent(double timestamp, Container* container, double value);
+  void addEvent(double timestamp, Container* container, double value);
+  void subEvent(double timestamp, Container* container, double value);
 };
 
 class ValueType : public Type {
@@ -73,6 +87,10 @@ public:
 class LinkType : public ValueType {
 public:
   LinkType(std::string name, std::string alias, Type* father);
+  void startEvent(Container* source_container, Container* sourceContainer, std::string value, std::string key);
+  void startEvent(Container* source_container, Container* sourceContainer, std::string value, std::string key,
+                  int size);
+  void endEvent(Container* source_container, Container* destContainer, std::string value, std::string key);
 };
 
 class EventType : public ValueType {
@@ -81,8 +99,17 @@ public:
 };
 
 class StateType : public ValueType {
+  std::vector<StateEvent*> events_;
+  Container* issuer_ = nullptr;
+
 public:
   StateType(std::string name, Type* father);
+  ~StateType();
+  void setCallingContainer(Container* container) { issuer_ = container; }
+  void setEvent(std::string value_name);
+  void pushEvent(std::string value_name);
+  void pushEvent(std::string value_name, void* extra);
+  void popEvent();
 };
 }
 }