Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reindent.
[simgrid.git] / src / surf / network_cm02.cpp
index 30e3b08..e7b27ac 100644 (file)
@@ -9,7 +9,7 @@
 #include "network_cm02.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/sg_config.h"
-#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
@@ -165,7 +165,7 @@ NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(lmm_system_t self))
   maxminSystem_->solve_fun = specificSolveFun;
 }
 
-LinkImpl* NetworkCm02Model::createLink(const char* name, double bandwidth, double latency,
+LinkImpl* NetworkCm02Model::createLink(const std::string& name, double bandwidth, double latency,
                                        e_surf_link_sharing_policy_t policy)
 {
   return new NetworkCm02Link(this, name, bandwidth, latency, policy, maxminSystem_);
@@ -204,8 +204,7 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
         // assume that flows that reached max_duration have remaining of 0
       XBT_DEBUG("Action %p finished", action);
       action->setRemains(0);
-      action->finish();
-      action->setState(Action::State::done);
+      action->finish(Action::State::done);
       action->heapRemove(actionHeap_);
     }
   }
@@ -259,8 +258,7 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta)
 
     if (((action->getRemains() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) ||
         ((action->getMaxDuration() > NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) {
-      action->finish();
-      action->setState(Action::State::done);
+      action->finish(Action::State::done);
     }
   }
 }
@@ -358,7 +356,7 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
 /************
  * Resource *
  ************/
-NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const char* name, double bandwidth, double latency,
+NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
                                  e_surf_link_sharing_policy_t policy, lmm_system_t system)
     : LinkImpl(model, name, lmm_constraint_new(system, this, sg_bandwidth_factor * bandwidth))
 {
@@ -492,8 +490,7 @@ void NetworkCm02Action::updateRemainingLazy(double now)
 
   if ((remains_ <= 0 && (lmm_get_variable_weight(getVariable()) > 0)) ||
       ((maxDuration_ > NO_MAX_DURATION) && (maxDuration_ <= 0))) {
-    finish();
-    setState(Action::State::done);
+    finish(Action::State::done);
     heapRemove(getModel()->getActionHeap());
   }