Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename the VM callbacks for uniformity
[simgrid.git] / src / surf / virtual_machine.hpp
index 4c64492..d5cc175 100644 (file)
@@ -4,6 +4,8 @@
 /* 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. */
 
+#include <boost/intrusive/list.hpp>
+
 #include <xbt/base.h>
 
 #include "src/surf/HostImpl.hpp"
@@ -31,17 +33,17 @@ class XBT_PRIVATE VirtualMachine;
 /** @ingroup SURF_callbacks
  * @brief Callbacks fired after VM creation. Signature: `void(VirtualMachine*)`
  */
-extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> VMCreatedCallbacks;
+extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> onVmCreation;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks fired after VM destruction. Signature: `void(VirtualMachine*)`
  */
-extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> VMDestructedCallbacks;
+extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> onVmDestruction;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks after VM State changes. Signature: `void(VirtualMachine*)`
  */
-extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> VMStateChangedCallbacks;
+extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> onVmStateChange;
 
 /************
  * Resource *
@@ -53,16 +55,7 @@ extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> VM
  */
 class VirtualMachine : public HostImpl {
 public:
-  /**
-   * @brief Constructor
-   *
-   * @param model VMModel associated to this VM
-   * @param name The name of the VM
-   * @param host The host
-   */
   VirtualMachine(simgrid::surf::HostModel *model, const char *name, simgrid::s4u::Host *host);
-
-  /** @brief Destructor */
   ~VirtualMachine();
 
   /** @brief Suspend the VM */
@@ -84,16 +77,16 @@ public:
   sg_host_t getPm();
 
   virtual void setBound(double bound)=0;
-  virtual void setAffinity(Cpu *cpu, unsigned long mask)=0;
 
   /* The vm object of the lower layer */
-  CpuAction *p_action;
-  simgrid::s4u::Host *p_hostPM;
+  CpuAction *action_;
+protected:
+  simgrid::s4u::Host *hostPM_;
 
+public:
   void turnOn() override;
   void turnOff() override;
 
-public:
   e_surf_vm_state_t getState();
   void setState(e_surf_vm_state_t state);
 protected:
@@ -121,7 +114,7 @@ public:
    * @param name The name of the new VM
    * @param host_PM The real machine hosting the VM
    */
-  virtual VirtualMachine *createVM(const char *name, sg_host_t host_PM)=0;
+  virtual s4u::Host *createVM(const char *name, sg_host_t host_PM)=0;
   void adjustWeightOfDummyCpuActions() {};
 
   typedef boost::intrusive::member_hook<