Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Compile trace_mgr with g++. Next step: objectification
[simgrid.git] / src / surf / cpu_ti.cpp
index f3feb36..6a1d618 100644 (file)
@@ -5,8 +5,9 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "cpu_ti.hpp"
-#include "trace_mgr_private.h"
 #include "xbt/heap.h"
+#include "src/surf/trace_mgr.hpp"
+#include "src/surf/platform.hpp"
 
 #ifndef SURF_MODEL_CPUTI_H_
 #define SURF_MODEL_CPUTI_H_
@@ -390,7 +391,9 @@ int CpuTiTrace::binarySearch(double *array, double a, int low, int high)
 
 static void cpu_ti_define_callbacks()
 {
-  sg_platf_postparse_add_cb(simgrid::surf::cpu_add_traces);
+  simgrid::surf::on_postparse.connect([]() {
+    surf_cpu_model_pm->addTraces();
+  });
 }
 
 /*********
@@ -434,7 +437,7 @@ CpuTiModel::~CpuTiModel()
   xbt_heap_free(p_tiActionHeap);
 }
 
-Cpu *CpuTiModel::createCpu(simgrid::Host *host,
+Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host,
                               xbt_dynar_t speedPeak,
                               int pstate,
                            double speedScale,
@@ -547,7 +550,7 @@ void CpuTiModel::addTraces()
 /************
  * Resource *
  ************/
-CpuTi::CpuTi(CpuTiModel *model, simgrid::Host *host, xbt_dynar_t speedPeak,
+CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
         int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
         int initiallyOn, tmgr_trace_t stateTrace)
   : Cpu(model, host, NULL, pstate, core, 0, speedScale, initiallyOn)
@@ -585,7 +588,7 @@ CpuTi::~CpuTi()
   delete p_actionSet;
 }
 
-void CpuTi::updateState(tmgr_trace_event_t event_type,
+void CpuTi::updateState(tmgr_trace_iterator_t event_type,
                         double value, double date)
 {
   CpuTiAction *action;