Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
let's do standard C++ here
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 15 Nov 2016 23:16:23 +0000 (00:16 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 15 Nov 2016 23:16:23 +0000 (00:16 +0100)
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp

index b2cedc1..1d3c71e 100644 (file)
@@ -591,14 +591,13 @@ void surf_action_lmm_update_index_heap(void *action, int i) {
 namespace simgrid {
 namespace surf {
 
-void Action::initialize(simgrid::surf::Model *model, double cost, bool failed,
-                        lmm_variable_t var)
-{
-  remains_ = cost;
-  start_ = surf_get_clock();
-  cost_ = cost;
-  model_ = model;
-  variable_ = var;
+Action::Action(simgrid::surf::Model* model, double cost, bool failed) : Action(model, cost, failed, nullptr)
+{
+}
+
+Action::Action(simgrid::surf::Model* model, double cost, bool failed, lmm_variable_t var)
+    : remains_(cost), start_(surf_get_clock()), cost_(cost), model_(model), variable_(var)
+{
   if (failed)
     stateSet_ = getModel()->getFailedActionSet();
   else
@@ -607,16 +606,6 @@ void Action::initialize(simgrid::surf::Model *model, double cost, bool failed,
   stateSet_->push_back(*this);
 }
 
-Action::Action(simgrid::surf::Model *model, double cost, bool failed)
-{
-  initialize(model, cost, failed);
-}
-
-Action::Action(simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var)
-{
-  initialize(model, cost, failed, var);
-}
-
 Action::~Action() {
   xbt_free(category_);
 }
index 998d260..cdd4d58 100644 (file)
@@ -114,13 +114,6 @@ public:
     not_in_the_system /**< Not in the system anymore. Why did you ask ? */
   };
 
-private:
-  /**
-   * @brief Common initializations for the constructors
-   */
-  void initialize(simgrid::surf::Model *model, double cost, bool failed,
-                  lmm_variable_t var = nullptr);
-
 public:
   /**
    * @brief Action constructor