Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make initialization order match declaration order.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 21 Jan 2014 21:07:49 +0000 (22:07 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 21 Jan 2014 21:45:49 +0000 (22:45 +0100)
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp

index c21635b..fd6d090 100644 (file)
@@ -471,8 +471,8 @@ void surf_exit(void)
  *********/
 
 Model::Model(const char *name)
  *********/
 
 Model::Model(const char *name)
-  : p_name(name)
-  , p_maxminSystem(NULL)
+  : p_maxminSystem(NULL)
+  , p_name(name)
 {
   p_readyActionSet = new ActionList();
   p_runningActionSet = new ActionList();
 {
   p_readyActionSet = new ActionList();
   p_runningActionSet = new ActionList();
@@ -663,18 +663,21 @@ Resource::Resource()
 {}
 
 Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props)
 {}
 
 Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props)
- : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
- , m_running(true), m_stateCurrent(SURF_RESOURCE_ON)
+  : m_stateCurrent(SURF_RESOURCE_ON)
+  , p_name(xbt_strdup(name)), p_properties(props), p_model(model)
+  , m_running(true)
 {}
 
 Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props, lmm_constraint_t constraint)
 {}
 
 Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props, lmm_constraint_t constraint)
- : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
- , m_running(true), m_stateCurrent(SURF_RESOURCE_ON), p_constraint(constraint)
+  : m_stateCurrent(SURF_RESOURCE_ON)
+  , p_name(xbt_strdup(name)), p_properties(props), p_model(model)
+  , m_running(true), p_constraint(constraint)
 {}
 
 Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit)
 {}
 
 Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit)
- : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
- , m_running(true), m_stateCurrent(stateInit)
+  : m_stateCurrent(stateInit)
+  , p_name(xbt_strdup(name)), p_properties(props), p_model(model)
+  , m_running(true)
 {}
 
 Resource::~Resource() {
 {}
 
 Resource::~Resource() {
@@ -746,18 +749,19 @@ Action::Action()
 
 Action::Action(ModelPtr model, double cost, bool failed)
  : m_priority(1.0)
 
 Action::Action(ModelPtr model, double cost, bool failed)
  : m_priority(1.0)
- , m_failed(failed)
- , m_start(surf_get_clock()), m_finish(-1.0)
+ , m_refcount(1)
  , m_remains(cost)
  , m_maxDuration(NO_MAX_DURATION)
  , m_remains(cost)
  , m_maxDuration(NO_MAX_DURATION)
+ , m_finish(-1.0)
+ , m_failed(failed)
+ , m_start(surf_get_clock())
  , m_cost(cost)
  , m_cost(cost)
- , p_data(NULL)
  , p_model(model)
  , p_model(model)
- , m_refcount(1)
+ , p_data(NULL)
+ , p_variable(NULL)
  , m_lastValue(0)
  , m_lastUpdate(0)
  , m_suspended(false)
  , m_lastValue(0)
  , m_lastUpdate(0)
  , m_suspended(false)
- , p_variable(NULL)
 {
   #ifdef HAVE_TRACING
     p_category = NULL;
 {
   #ifdef HAVE_TRACING
     p_category = NULL;
@@ -774,18 +778,19 @@ Action::Action(ModelPtr model, double cost, bool failed)
 
 Action::Action(ModelPtr model, double cost, bool failed, lmm_variable_t var)
  : m_priority(1.0)
 
 Action::Action(ModelPtr model, double cost, bool failed, lmm_variable_t var)
  : m_priority(1.0)
- , m_failed(failed)
- , m_start(surf_get_clock()), m_finish(-1.0)
+ , m_refcount(1)
  , m_remains(cost)
  , m_maxDuration(NO_MAX_DURATION)
  , m_remains(cost)
  , m_maxDuration(NO_MAX_DURATION)
+ , m_finish(-1.0)
+ , m_failed(failed)
+ , m_start(surf_get_clock())
  , m_cost(cost)
  , m_cost(cost)
- , p_data(NULL)
  , p_model(model)
  , p_model(model)
- , m_refcount(1)
+ , p_data(NULL)
+ , p_variable(var)
  , m_lastValue(0)
  , m_lastUpdate(0)
  , m_suspended(false)
  , m_lastValue(0)
  , m_lastUpdate(0)
  , m_suspended(false)
- , p_variable(var)
 {
   #ifdef HAVE_TRACING
     p_category = NULL;
 {
   #ifdef HAVE_TRACING
     p_category = NULL;
index cd55b2a..06ae981 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2013. The SimGrid Team.
+/* Copyright (c) 2004-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -364,9 +364,9 @@ protected:
   e_surf_resource_state_t m_stateCurrent;
 
 private:
   e_surf_resource_state_t m_stateCurrent;
 
 private:
-  ModelPtr p_model;
   const char *p_name;
   xbt_dict_t p_properties;
   const char *p_name;
   xbt_dict_t p_properties;
+  ModelPtr p_model;
   void *p_resource;
   bool m_running;
 
   void *p_resource;
   bool m_running;
 
@@ -681,7 +681,6 @@ private:
   ActionLmmListPtr p_modifiedSet;
   xbt_heap_t p_actionHeap;
   int m_selectiveUpdate;
   ActionLmmListPtr p_modifiedSet;
   xbt_heap_t p_actionHeap;
   int m_selectiveUpdate;
-  ModelPtr p_model;
   double m_bound;   /**< the capping of the CPU use  */
   bool m_failed;
   double m_start; /**< start time  */
   double m_bound;   /**< the capping of the CPU use  */
   bool m_failed;
   double m_start; /**< start time  */
@@ -691,6 +690,7 @@ private:
   int m_latencyLimited;               /**< Set to 1 if is limited by latency, 0 otherwise */
   #endif
   int    m_cost;
   int m_latencyLimited;               /**< Set to 1 if is limited by latency, 0 otherwise */
   #endif
   int    m_cost;
+  ModelPtr p_model;
   void *p_data; /**< for your convenience */
 
   /* LMM */
   void *p_data; /**< for your convenience */
 
   /* LMM */
@@ -708,8 +708,8 @@ public:
 
 protected:
   lmm_variable_t p_variable;
 
 protected:
   lmm_variable_t p_variable;
-  double m_lastUpdate;
   double m_lastValue;
   double m_lastValue;
+  double m_lastUpdate;
   int m_suspended;
   int m_indexHeap;
   enum heap_action_type m_hat;
   int m_suspended;
   int m_indexHeap;
   enum heap_action_type m_hat;