Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / instr / instr_paje_types.hpp
index a937a3d..75f38b5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,6 +7,7 @@
 #define INSTR_PAJE_TYPES_HPP
 
 #include "src/instr/instr_private.hpp"
+#include <sstream>
 #include <string>
 #include <vector>
 
@@ -23,13 +24,15 @@ class Type {
 
 public:
   std::map<std::string, Type*> children_;
+  Container* issuer_ = nullptr;
+  std::stringstream stream_;
 
   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_; }
+  std::string get_name() { return name_; }
+  const char* get_cname() { return name_.c_str(); }
+  long long int get_id() { return id_; }
   bool isColored() { return not color_.empty(); }
 
   Type* byName(std::string name);
@@ -39,6 +42,8 @@ public:
   StateType* getOrCreateStateType(std::string name);
   VariableType* getOrCreateVariableType(std::string name, std::string color);
 
+  void setCallingContainer(Container* container) { issuer_ = container; }
+
   void logDefinition(e_event_type event_type);
   void logDefinition(Type* source, Type* dest);
 };
@@ -51,12 +56,9 @@ public:
 
 class VariableType : public Type {
   std::vector<VariableEvent*> events_;
-  Container* issuer_ = nullptr;
-
 public:
   VariableType(std::string name, std::string color, Type* father);
   ~VariableType();
-  void setCallingContainer(Container* container) { issuer_ = container; }
   void setEvent(double timestamp, double value);
   void addEvent(double timestamp, double value);
   void subEvent(double timestamp, double value);
@@ -76,10 +78,9 @@ 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);
+  void startEvent(Container* startContainer, std::string value, std::string key);
+  void startEvent(Container* startContainer, std::string value, std::string key, int size);
+  void endEvent(Container* endContainer, std::string value, std::string key);
 };
 
 class EventType : public ValueType {
@@ -89,16 +90,14 @@ 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 pushEvent(std::string value_name, TIData* extra);
   void popEvent();
+  void popEvent(TIData* extra);
 };
 }
 }