Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move all VM+energy code into callbacks
[simgrid.git] / src / surf / plugins / energy.hpp
index 18af57f..f3d700c 100644 (file)
@@ -32,6 +32,10 @@ public:
   double total_energy;                                 /*< Total energy consumed by the host */
   double last_updated;                                 /*< Timestamp of the last energy update event*/
   Cpu *cpu;
+
+  void unref() {if (--refcount == 0) delete this;}
+  void ref() {refcount++;}
+  int refcount = 1;
 };
 
 #endif /* ENERGY_CALLBACK_HPP_ */