X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0c33ee7f67d9a69bef7396ef12bbccecbb0868b1..64578ee8e932a2a7e292514c0912f50fe4299220:/src/instr/instr_paje_types.hpp diff --git a/src/instr/instr_paje_types.hpp b/src/instr/instr_paje_types.hpp index 8306af0d35..75f38b5c99 100644 --- a/src/instr/instr_paje_types.hpp +++ b/src/instr/instr_paje_types.hpp @@ -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,20 +7,14 @@ #define INSTR_PAJE_TYPES_HPP #include "src/instr/instr_private.hpp" +#include #include #include namespace simgrid { namespace instr { -enum e_event_type : unsigned int; -class EntityValue; class ContainerType; class EventType; -class LinkType; -class StateType; -class VariableType; -class StateEvent; -class VariableEvent; class Type { long long int id_; @@ -30,45 +24,44 @@ class Type { public: std::map 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); - 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 setCallingContainer(Container* container) { issuer_ = container; } + 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(name, name, "", nullptr){}; + explicit ContainerType(std::string name) : Type(name, name, "", nullptr){}; ContainerType(std::string name, Type* father); }; class VariableType : public Type { std::vector 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); + void setEvent(double timestamp, double value); + void addEvent(double timestamp, double value); + void subEvent(double timestamp, double value); }; class ValueType : public Type { @@ -85,6 +78,9 @@ public: class LinkType : public ValueType { public: LinkType(std::string name, std::string alias, Type* father); + 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 { @@ -94,14 +90,14 @@ public: class StateType : public ValueType { std::vector events_; - public: StateType(std::string name, Type* father); ~StateType(); - void setEvent(double timestamp, Container* container, std::string value_name); - void pushEvent(double timestamp, Container* container, std::string value_name); - void pushEvent(double timestamp, Container* container, std::string value_name, void* extra); - void popEvent(double timestamp, Container* container); + void setEvent(std::string value_name); + void pushEvent(std::string value_name); + void pushEvent(std::string value_name, TIData* extra); + void popEvent(); + void popEvent(TIData* extra); }; } }