Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
document the update mechanisms
[simgrid.git] / include / simgrid / Host.hpp
index 6e1f6c0..50e1fa1 100644 (file)
@@ -16,6 +16,7 @@
 #include <xbt/dict.h>
 #include <xbt/swag.h>
 #include <xbt/string.hpp>
+#include <xbt/signal.hpp>
 #include <xbt/Extendable.hpp>
 
 #include <simgrid/datatypes.h>
@@ -30,8 +31,8 @@ public:
        int getCoreAmount();
 
        /* FIXME: these should be protected, but it leads to many errors */
-       surf::Cpu     *p_cpu = nullptr;
-       surf::NetCard *p_netcard = nullptr;
+       surf::Cpu     *pimpl_cpu = nullptr;
+       surf::NetCard *pimpl_netcard = nullptr;
 private:
   simgrid::xbt::string name_ = "noname";
 public:
@@ -48,8 +49,6 @@ public:
   double getPowerPeakAt(int pstate_index);
   void setPState(int pstate_index);
   int getPState();
-  double getWattMinAt(int pstate);
-  double getWattMaxAt(int pstate);
   void getParams(vm_params_t params);
   void setParams(vm_params_t params);
   xbt_dict_t getMountedStorageList();
@@ -57,6 +56,13 @@ public:
 
   static Host* by_name_or_null(const char* name);
   static Host* by_name_or_create(const char* name);
+
+  /*** Called on each newly created object */
+  static simgrid::xbt::signal<void(Host&)> onCreation;
+  /*** Called just before destructing an object */
+  static simgrid::xbt::signal<void(Host&)> onDestruction;
+  /*** Called when the machine is turned on or off */
+  static simgrid::xbt::signal<void(Host&)> onStateChange;
 };
 
 }