Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplification: inline a virtual function that is never derivated
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 17 Oct 2016 07:10:44 +0000 (09:10 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 17 Oct 2016 07:10:51 +0000 (09:10 +0200)
src/surf/HostImpl.cpp
src/surf/HostImpl.hpp
src/surf/sg_platf.cpp

index c425691..6e97afd 100644 (file)
@@ -29,14 +29,6 @@ simgrid::xbt::Extension<simgrid::s4u::Host, HostImpl> HostImpl::EXTENSION_ID;
 /*********
  * Model *
  *********/
-HostImpl* HostModel::createHost(const char* name, Cpu* cpu, kernel::routing::NetCard* netcard, xbt_dynar_t storageList)
-{
-  HostImpl *host = new simgrid::surf::HostImpl(surf_host_model, name, storageList, cpu);
-  xbt_lib_set(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL, (void*)storageList);
-
-  XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->storage_));
-  return host;
-}
 
 /* Each VM has a dummy CPU action on the PM layer. This CPU action works as the
  * constraint (capacity) of the VM in the PM layer. If the VM does not have any
index a032f6c..6734180 100644 (file)
@@ -51,8 +51,6 @@ class HostModel : public Model {
 public:
   HostModel() : Model() {}
 
-  HostImpl* createHost(const char* name, Cpu* cpu, kernel::routing::NetCard* net, xbt_dynar_t storageList);
-
   virtual void adjustWeightOfDummyCpuActions();
   virtual Action *executeParallelTask(int host_nb, sg_host_t *host_list,
       double *flops_amount, double *bytes_amount, double rate);
index 1d9ddd0..7693e7c 100644 (file)
@@ -19,6 +19,7 @@
 #include "src/include/simgrid/sg_config.h"
 #include "src/surf/xml/platf_private.hpp"
 
+#include "src/surf/HostImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
 #include "surf/surf_routing.h" // FIXME: brain dead public header
@@ -110,7 +111,10 @@ void sg_platf_new_host(sg_platf_host_cbarg_t host)
   if (host->speed_trace)
     cpu->setSpeedTrace(host->speed_trace);
 
-  surf_host_model->createHost(host->id, cpu, netcard, mount_list)->attach(h);
+  simgrid::surf::HostImpl* hi = new simgrid::surf::HostImpl(surf_host_model, host->id, mount_list, cpu);
+  hi->attach(h);
+  xbt_lib_set(storage_lib, host->id, ROUTING_STORAGE_HOST_LEVEL, (void*)mount_list);
+
   mount_list = nullptr;
 
   if (host->properties) {