-typedef struct s_container *container_t;
-typedef struct s_container {
- sg_routing_edge_t net_elm;
- char *name; /* Unique name of this container */
- char *id; /* Unique id of this container */
- type_t type; /* Type of this container */
- int level; /* Level in the hierarchy, root level is 0 */
- e_container_types kind; /* This container is of what kind */
- struct s_container *father;
- xbt_dict_t children;
-}s_container_t;
-
-extern xbt_dict_t created_categories;
-extern xbt_dict_t declared_marks;
-extern xbt_dict_t user_host_variables;
-extern xbt_dict_t user_vm_variables;
-extern xbt_dict_t user_link_variables;
-extern double TRACE_last_timestamp_to_dump;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+//--------------------------------------------------
+
+class Container {
+public:
+ Container(const char* name, simgrid::instr::e_container_types kind, Container* father);
+ virtual ~Container();
+
+ sg_netpoint_t netpoint_;
+ char* name_; /* Unique name of this container */
+ char* id_; /* Unique id of this container */
+ Type* type_; /* Type of this container */
+ int level_ = 0; /* Level in the hierarchy, root level is 0 */
+ e_container_types kind_; /* This container is of what kind */
+ Container* father_;
+ xbt_dict_t children_;
+};
+
+//--------------------------------------------------
+class PajeEvent {
+ public:
+ double timestamp_;
+ e_event_type eventType_;
+ virtual void print() = 0;
+ virtual ~PajeEvent();
+};
+
+//--------------------------------------------------
+class SetVariableEvent : public PajeEvent {
+ private:
+ Container* container;
+ Type* type;
+ double value;
+
+ public:
+ SetVariableEvent(double timestamp, Container* container, Type* type, double value);
+ void print() override;
+};
+
+class AddVariableEvent:public PajeEvent {
+ private:
+ Container* container;
+ Type* type;
+ double value;
+
+ public:
+ AddVariableEvent(double timestamp, Container* container, Type* type, double value);
+ void print() override;
+};
+//--------------------------------------------------
+
+
+class SubVariableEvent : public PajeEvent {
+ private:
+ Container* container;
+ Type* type;
+ double value;
+
+ public:
+ SubVariableEvent(double timestamp, Container* container, Type* type, double value);
+ void print() override;
+};
+//--------------------------------------------------
+
+class SetStateEvent : public PajeEvent {
+ private:
+ Container* container;
+ Type* type;
+ Value* val;
+ const char* filename;
+ int linenumber;
+
+ public:
+ SetStateEvent(double timestamp, Container* container, Type* type, Value* val);
+ void print() override;
+};
+
+
+class PushStateEvent : public PajeEvent {
+ public:
+ Container* container;
+ Type* type;
+ Value* val;
+ int size;
+ const char* filename;
+ int linenumber;
+ void* extra_;
+
+ public:
+ PushStateEvent(double timestamp, Container* container, Type* type, Value* val);
+ PushStateEvent(double timestamp, Container* container, Type* type, Value* val, void* extra);
+ void print() override;
+};
+
+class PopStateEvent : public PajeEvent {
+ Container* container;
+ Type* type;
+
+public:
+ PopStateEvent(double timestamp, Container* container, Type* type);
+ void print() override;
+};
+
+class ResetStateEvent : public PajeEvent {
+ Container* container;
+ Type* type;
+
+public:
+ ResetStateEvent(double timestamp, Container* container, Type* type);
+ void print() override;
+};
+
+class StartLinkEvent : public PajeEvent {
+ public:
+ Container* container;
+ Type* type;
+ Container* sourceContainer;
+ char* value;
+ char* key;
+ int size;
+
+ public:
+ ~StartLinkEvent();
+ StartLinkEvent(double timestamp, Container* container, Type* type, Container* sourceContainer, const char* value,
+ const char* key);
+ StartLinkEvent(double timestamp, Container* container, Type* type, Container* sourceContainer, const char* value,
+ const char* key, int size);
+ void print() override;
+};
+
+class EndLinkEvent : public PajeEvent {
+ Container* container;
+ Type* type;
+ Container* destContainer;
+ char *value;
+ char *key;
+ public:
+ EndLinkEvent(double timestamp, Container* container, Type* type, Container* destContainer, const char* value,
+ const char* key);
+ ~EndLinkEvent();
+ void print() override;
+};
+
+
+class NewEvent : public PajeEvent {
+ public:
+ Container* container;
+ Type* type;
+ Value* val;
+
+ public:
+ NewEvent(double timestamp, Container* container, Type* type, Value* val);
+ void print() override;
+};
+}
+} // namespace simgrid::instr
+typedef simgrid::instr::Container* container_t;
+
+SG_BEGIN_DECL()
+
+extern XBT_PRIVATE std::set<std::string> created_categories;
+extern XBT_PRIVATE std::set<std::string> declared_marks;
+extern XBT_PRIVATE std::set<std::string> user_host_variables;
+extern XBT_PRIVATE std::set<std::string> user_vm_variables;
+extern XBT_PRIVATE std::set<std::string> user_link_variables;
+extern XBT_PRIVATE double TRACE_last_timestamp_to_dump;