Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics in AsCluster and friends
[simgrid.git] / src / surf / virtual_machine.cpp
index cc11586..75017d8 100644 (file)
@@ -7,8 +7,7 @@
 #include "cpu_cas01.hpp"
 #include "virtual_machine.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf,
-                                "Logging specific to the SURF VM module");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf, "Logging specific to the SURF VM module");
 
 simgrid::surf::VMModel *surf_vm_model = NULL;
 
@@ -19,9 +18,9 @@ namespace surf {
  * Callbacks *
  *************/
 
-simgrid::surf::signal<void(simgrid::surf::VirtualMachine*)> VMCreatedCallbacks;
-simgrid::surf::signal<void(simgrid::surf::VirtualMachine*)> VMDestructedCallbacks;
-simgrid::surf::signal<void(simgrid::surf::VirtualMachine*)> VMStateChangedCallbacks;
+simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> VMCreatedCallbacks;
+simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> VMDestructedCallbacks;
+simgrid::xbt::signal<void(simgrid::surf::VirtualMachine*)> VMStateChangedCallbacks;
 
 /*********
  * Model *
@@ -33,24 +32,23 @@ VMModel::vm_list_t VMModel::ws_vms;
  * Resource *
  ************/
 
-VirtualMachine::VirtualMachine(Model *model, const char *name, xbt_dict_t props, simgrid::Host *hostPM)
-: Host(model, name, props, NULL, NULL, NULL)
-, p_hostPM(hostPM)
+VirtualMachine::VirtualMachine(HostModel *model, const char *name, simgrid::s4u::Host *hostPM)
+: HostImpl(model, name, NULL, NULL, NULL)
+, hostPM_(hostPM)
 {
   VMModel::ws_vms.push_back(*this);
-  simgrid::Host::by_name_or_create(name)->extension_set<simgrid::surf::Host>(this);
+  simgrid::s4u::Host::by_name_or_create(name)->extension_set<simgrid::surf::HostImpl>(this);
 }
 
 /*
- * A physical host does not disappear in the current SimGrid code, but a VM may
- * disappear during a simulation.
+ * A physical host does not disappear in the current SimGrid code, but a VM may disappear during a simulation.
  */
 VirtualMachine::~VirtualMachine()
 {
   VMDestructedCallbacks(this);
   VMModel::ws_vms.erase(VMModel::vm_list_t::s_iterator_to(*this));
   /* Free the cpu_action of the VM. */
-  XBT_ATTRIB_UNUSED int ret = p_action->unref();
+  XBT_ATTRIB_UNUSED int ret = action_->unref();
   xbt_assert(ret == 1, "Bug: some resource still remains");
 }
 
@@ -76,7 +74,7 @@ void VirtualMachine::turnOff() {
 
 /** @brief returns the physical machine on which the VM is running **/
 sg_host_t VirtualMachine::getPm() {
-  return p_hostPM;
+  return hostPM_;
 }
 
 }