Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'wifi_clean' into 'master'
[simgrid.git] / src / instr / instr_paje_values.hpp
1 /* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef INSTR_PAJE_VALUES_HPP
7 #define INSTR_PAJE_VALUES_HPP
8
9 #include "src/instr/instr_private.hpp"
10 #include <string>
11
12 namespace simgrid::instr {
13
14 class EntityValue {
15   long long int id_ = new_paje_id();
16   std::string name_;
17   std::string color_;
18   Type* parent_;
19
20   static xbt::signal<void(const EntityValue&)> on_creation;
21
22 public:
23   static void on_creation_cb(const std::function<void(const EntityValue&)>& cb) { on_creation.connect(cb); }
24   explicit EntityValue(const std::string& name, const std::string& color, Type* parent);
25
26   long long int get_id() const { return id_; }
27   std::string get_name() const { return name_; }
28   const char* get_cname() const { return name_.c_str(); }
29   std::string get_color() const { return color_; }
30   Type* get_parent() const { return parent_; }
31 };
32 } // namespace simgrid::instr
33
34 #endif