Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / instr / instr_paje_values.hpp
index ee9d3f9..b080129 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2023. 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. */
@@ -9,8 +9,7 @@
 #include "src/instr/instr_private.hpp"
 #include <string>
 
-namespace simgrid {
-namespace instr {
+namespace simgrid::instr {
 
 class EntityValue {
   long long int id_ = new_paje_id();
@@ -18,8 +17,10 @@ class EntityValue {
   std::string color_;
   Type* parent_;
 
-public:
   static xbt::signal<void(const EntityValue&)> on_creation;
+
+public:
+  static void on_creation_cb(const std::function<void(const EntityValue&)>& cb) { on_creation.connect(cb); }
   explicit EntityValue(const std::string& name, const std::string& color, Type* parent);
 
   long long int get_id() const { return id_; }
@@ -28,7 +29,6 @@ public:
   std::string get_color() const { return color_; }
   Type* get_parent() const { return parent_; }
 };
-} // namespace instr
-} // namespace simgrid
+} // namespace simgrid::instr
 
 #endif