Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
proper check for the -std=gnu++11 standard, and take in on clang too
[simgrid.git] / src / surf / vm_interface.cpp
index c72689d..872bdd3 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2013-2015. 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. */
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf,
                                 "Logging specific to the SURF VM module");
 
-VMModelPtr surf_vm_model = NULL;
+VMModel *surf_vm_model = NULL;
 
 /*************
  * Callbacks *
  *************/
 
-surf_callback(void, VMPtr) VMCreatedCallbacks;
-surf_callback(void, VMPtr) VMDestructedCallbacks;
-surf_callback(void, VMPtr) VMStateChangedCallbacks;
+surf_callback(void, VM*) VMCreatedCallbacks;
+surf_callback(void, VM*) VMDestructedCallbacks;
+surf_callback(void, VM*) VMStateChangedCallbacks;
 
 /*********
  * Model *
  *********/
 
-VMModel::VMModel() : HostModel("Virtual Machine") {
-  p_cpuModel = surf_cpu_model_vm;
-}
-
 VMModel::vm_list_t VMModel::ws_vms;
 
 /************
  * Resource *
  ************/
 
-VM::VM(ModelPtr model, const char *name, xbt_dict_t props,
-                       RoutingEdgePtr netElm, CpuPtr cpu)
+VM::VM(Model *model, const char *name, xbt_dict_t props,
+                       RoutingEdge *netElm, Cpu *cpu)
 : Host(model, name, props, NULL, netElm, cpu)
 {
   VMModel::ws_vms.push_back(*this);
@@ -43,14 +38,13 @@ VM::VM(ModelPtr model, const char *name, xbt_dict_t props,
 }
 
 /*
- * A physical host does not disapper in the current SimGrid code, but a VM may
- * disapper during a simulation.
+ * A physical host does not disappear in the current SimGrid code, but a VM may
+ * disappear during a simulation.
  */
 VM::~VM()
 {
   surf_callback_emit(VMDestructedCallbacks, this);
-  VMModel::ws_vms.erase(VMModel::
-                                   vm_list_t::s_iterator_to(*this));
+  VMModel::ws_vms.erase(VMModel::vm_list_t::s_iterator_to(*this));
 }
 
 void VM::setState(e_surf_resource_state_t state){
@@ -59,7 +53,7 @@ void VM::setState(e_surf_resource_state_t state){
 }
 
 /*
- * A surf level object will be useless in the upper layer. Returing the
+ * A surf level object will be useless in the upper layer. Returning the
  * dict_elm of the host.
  **/
 surf_resource_t VM::getPm()