Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill (inline) useless functions
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 15 Jan 2016 16:31:02 +0000 (17:31 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 15 Jan 2016 16:31:07 +0000 (17:31 +0100)
The whole addTraces() madness should be reworked and factorized.

src/surf/cpu_cas01.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/host_interface.cpp
src/surf/host_interface.hpp
src/surf/host_ptask_L07.cpp
src/surf/network_cm02.cpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp

index ff1f38b..e5c8500 100644 (file)
@@ -33,7 +33,9 @@ void surf_cpu_model_init_Cas01()
   surf_cpu_model_vm  = new simgrid::surf::CpuCas01Model();
   xbt_dynar_push(all_existing_models, &surf_cpu_model_vm);
 
-  simgrid::surf::on_postparse.connect(simgrid::surf::cpu_add_traces);
+  simgrid::surf::on_postparse.connect([]() {
+    surf_cpu_model_pm->addTraces();
+  });
 }
 
 namespace simgrid {
index c98acca..4be4445 100644 (file)
@@ -33,10 +33,6 @@ Cpu *getActionCpu(CpuAction *action) {
 
 simgrid::xbt::signal<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> cpuActionStateChangedCallbacks;
 
-void cpu_add_traces(){
-  surf_cpu_model_pm->addTraces();
-}
-
 /*********
  * Model *
  *********/
index 090d41a..066670c 100644 (file)
@@ -27,8 +27,6 @@ class CpuPlugin;
  *************/
 XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action);
 
-XBT_PUBLIC(void) cpu_add_traces();
-
 /*********
  * Model *
  *********/
index 564cd84..4847691 100644 (file)
@@ -391,7 +391,9 @@ int CpuTiTrace::binarySearch(double *array, double a, int low, int high)
 
 static void cpu_ti_define_callbacks()
 {
-  simgrid::surf::on_postparse.connect(simgrid::surf::cpu_add_traces);
+  simgrid::surf::on_postparse.connect([]() {
+    surf_cpu_model_pm->addTraces();
+  });
 }
 
 /*********
index dcacf52..dfaaa49 100644 (file)
@@ -20,10 +20,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf,
 
 simgrid::surf::HostModel *surf_host_model = NULL;
 
-void host_add_traces(){
-  surf_host_model->addTraces();
-}
-
 /*************
  * Callbacks *
  *************/
index ef36245..6ffdfa3 100644 (file)
@@ -35,7 +35,6 @@ class XBT_PRIVATE HostAction;
  *********/
 
 XBT_PUBLIC_DATA(simgrid::surf::HostModel*) surf_host_model;
-XBT_PUBLIC(void) host_add_traces();
 
 /*********
  * Model *
index 0c04470..6033a92 100644 (file)
@@ -35,7 +35,9 @@ void surf_host_model_init_ptask_L07(void)
 
   // Define the callbacks to parse the XML
   simgrid::surf::on_link.connect(ptask_netlink_parse_init);
-  simgrid::surf::on_postparse.connect(host_add_traces);
+  simgrid::surf::on_postparse.connect([](){
+      surf_host_model->addTraces();
+  });
 
   surf_host_model = new simgrid::surf::HostL07Model();
   xbt_dynar_push(all_existing_models, &surf_host_model);
index 5163c8c..719dd52 100644 (file)
@@ -29,7 +29,9 @@ void net_define_callbacks(void)
 {
   /* Figuring out the network links */
   simgrid::surf::on_link.connect(netlink_parse_init);
-  simgrid::surf::on_postparse.connect(net_add_traces);
+  simgrid::surf::on_postparse.connect([]() {
+    surf_network_model->addTraces();
+  });
 }
 
 /*********
index c7a81c5..bae76b8 100644 (file)
@@ -137,10 +137,6 @@ void netlink_parse_init(sg_platf_link_cbarg_t link){
   }
 }
 
-void net_add_traces(){
-  surf_network_model->addTraces();
-}
-
 /*********
  * Model *
  *********/
index a229068..b116ed6 100644 (file)
@@ -50,8 +50,6 @@ XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::NetworkAction*, simgrid
  *********/
 XBT_PUBLIC(void) netlink_parse_init(sg_platf_link_cbarg_t link);
 
-XBT_PUBLIC(void) net_add_traces();
-
 /*********
  * Model *
  *********/