Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Get ride of ???Ptr types in C++: make pointers explicit
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 20 Jul 2015 08:31:24 +0000 (10:31 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 20 Jul 2015 08:33:07 +0000 (10:33 +0200)
Making pointers explicit is not what we did in C so far, but what we
did was a bad idea. It's easier to code when you know what is a
pointer and what is not.

Also:
- Convert a bunch of C-typecast into static_cast
- Kill some dead or dupplicated code

64 files changed:
include/simgrid/host.h
src/bindings/java/org/simgrid/surf/surfJAVA_wrap.cxx
src/bindings/java/surf.i
src/bindings/java/surf_swig.cpp
src/simgrid/host.cpp
src/surf/cpu_cas01.cpp
src/surf/cpu_cas01.hpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/host_clm03.cpp
src/surf/host_clm03.hpp
src/surf/host_interface.cpp
src/surf/host_interface.hpp
src/surf/host_ptask_L07.cpp
src/surf/host_ptask_L07.hpp
src/surf/maxmin.cpp
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_constant.cpp
src/surf/network_constant.hpp
src/surf/network_ib.cpp
src/surf/network_ib.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/network_smpi.cpp
src/surf/network_smpi.hpp
src/surf/plugins/energy.cpp
src/surf/plugins/energy.hpp
src/surf/storage_interface.cpp
src/surf/storage_interface.hpp
src/surf/storage_n11.cpp
src/surf/storage_n11.hpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp
src/surf/surf_routing.cpp
src/surf/surf_routing.hpp
src/surf/surf_routing_cluster.cpp
src/surf/surf_routing_cluster.hpp
src/surf/surf_routing_cluster_fat_tree.cpp
src/surf/surf_routing_cluster_fat_tree.hpp
src/surf/surf_routing_cluster_torus.cpp
src/surf/surf_routing_cluster_torus.hpp
src/surf/surf_routing_dijkstra.cpp
src/surf/surf_routing_dijkstra.hpp
src/surf/surf_routing_floyd.cpp
src/surf/surf_routing_floyd.hpp
src/surf/surf_routing_full.cpp
src/surf/surf_routing_full.hpp
src/surf/surf_routing_generic.cpp
src/surf/surf_routing_generic.hpp
src/surf/surf_routing_none.cpp
src/surf/surf_routing_none.hpp
src/surf/surf_routing_private.hpp
src/surf/surf_routing_vivaldi.cpp
src/surf/surf_routing_vivaldi.hpp
src/surf/vm_hl13.cpp
src/surf/vm_hl13.hpp
src/surf/vm_interface.cpp
src/surf/vm_interface.hpp

index 2a7af9a..fd0c576 100644 (file)
@@ -47,15 +47,14 @@ XBT_PUBLIC(void) sg_host_simix_destroy(sg_host_t host);
 // ========== SURF CPU ============
 DEFINE_EXTERNAL_CLASS(Cpu);
 typedef Cpu *surf_cpu_t;
 // ========== SURF CPU ============
 DEFINE_EXTERNAL_CLASS(Cpu);
 typedef Cpu *surf_cpu_t;
-typedef Cpu *CpuPtr;
 XBT_PUBLIC(surf_cpu_t) sg_host_surfcpu(sg_host_t host);
 XBT_PUBLIC(void) sg_host_surfcpu_set(sg_host_t host, surf_cpu_t cpu);
 XBT_PUBLIC(void) sg_host_surfcpu_destroy(sg_host_t host);
 
 // ========== RoutingEdge ============
 XBT_PUBLIC(surf_cpu_t) sg_host_surfcpu(sg_host_t host);
 XBT_PUBLIC(void) sg_host_surfcpu_set(sg_host_t host, surf_cpu_t cpu);
 XBT_PUBLIC(void) sg_host_surfcpu_destroy(sg_host_t host);
 
 // ========== RoutingEdge ============
-typedef struct RoutingEdge *RoutingEdgePtr;
-XBT_PUBLIC(RoutingEdgePtr) sg_host_edge(sg_host_t host);
-XBT_PUBLIC(void) sg_host_edge_set(sg_host_t host, RoutingEdgePtr edge);
+DEFINE_EXTERNAL_CLASS(RoutingEdge);
+XBT_PUBLIC(RoutingEdge*) sg_host_edge(sg_host_t host);
+XBT_PUBLIC(void) sg_host_edge_set(sg_host_t host, RoutingEdge* edge);
 XBT_PUBLIC(void) sg_host_edge_destroy(sg_host_t host, int do_callback);
 
 
 XBT_PUBLIC(void) sg_host_edge_destroy(sg_host_t host, int do_callback);
 
 
index be2e89b..4c0dfa4 100644 (file)
@@ -2226,7 +2226,7 @@ SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_ActionList_1getArray
     jlong *elts = jenv->GetLongArrayElements(jresult, NULL);
     l = 0;
     for(ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
     jlong *elts = jenv->GetLongArrayElements(jresult, NULL);
     l = 0;
     for(ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
-      elts[l++] = (jlong)static_cast<ActionPtr>(&*it);
+      elts[l++] = (jlong)static_cast<Action*>(&*it);
     }
     jenv->ReleaseLongArrayElements(jresult, elts, 0);
   }
     }
     jenv->ReleaseLongArrayElements(jresult, elts, 0);
   }
index a9e121e..68fc94d 100644 (file)
@@ -121,7 +121,7 @@ JAVA_ARRAYSOFCLASSES(Action);
   jlong *elts = jenv->GetLongArrayElements($result, NULL);
   l = 0;
   for(ActionList::iterator it($1->begin()), itend($1->end()); it != itend ; ++it) {
   jlong *elts = jenv->GetLongArrayElements($result, NULL);
   l = 0;
   for(ActionList::iterator it($1->begin()), itend($1->end()); it != itend ; ++it) {
-    elts[l++] = (jlong)static_cast<ActionPtr>(&*it);
+    elts[l++] = (jlong)static_cast<Action*>(&*it);
   }
   jenv->ReleaseLongArrayElements($result, elts, 0);
 }
   }
   jenv->ReleaseLongArrayElements($result, elts, 0);
 }
index b3066cd..b7f62f8 100644 (file)
@@ -43,7 +43,7 @@ LinkDynar getRoute(char *srcName, char *dstName) {
   RoutingEdge *dst = sg_host_edge(sg_host_by_name(dstName));
   xbt_assert(src,"Cannot get the route from a NULL source");
   xbt_assert(dst,"Cannot get the route to a NULL destination");
   RoutingEdge *dst = sg_host_edge(sg_host_by_name(dstName));
   xbt_assert(src,"Cannot get the route from a NULL source");
   xbt_assert(dst,"Cannot get the route to a NULL destination");
-  xbt_dynar_t route = xbt_dynar_new(sizeof(RoutingEdgePtr), NULL);
+  xbt_dynar_t route = xbt_dynar_new(sizeof(RoutingEdge*), NULL);
   routing_platf->getRouteAndLatency(src, dst, &route, NULL);
   return route;
 }
   routing_platf->getRouteAndLatency(src, dst, &route, NULL);
   return route;
 }
index af11f63..63655a9 100644 (file)
@@ -52,10 +52,10 @@ int SURF_CPU_LEVEL;
 #include "surf/surf_routing.hpp"
 
 static XBT_INLINE void surf_cpu_free(void *r) {
 #include "surf/surf_routing.hpp"
 
 static XBT_INLINE void surf_cpu_free(void *r) {
-  delete static_cast<CpuPtr>(r);
+  delete static_cast<Cpu*>(r);
 }
 static XBT_INLINE void routing_asr_host_free(void *p) {
 }
 static XBT_INLINE void routing_asr_host_free(void *p) {
-  delete static_cast<RoutingEdgePtr>(p);
+  delete static_cast<RoutingEdge*>(p);
 }
 
 
 }
 
 
@@ -111,10 +111,10 @@ void sg_host_surfcpu_destroy(sg_host_t host) {
        xbt_lib_unset(host_lib,host->key,SURF_CPU_LEVEL,1);
 }
 // ========== RoutingEdge ============
        xbt_lib_unset(host_lib,host->key,SURF_CPU_LEVEL,1);
 }
 // ========== RoutingEdge ============
-RoutingEdgePtr sg_host_edge(sg_host_t host) {
-       return (RoutingEdgePtr) xbt_lib_get_level(host, ROUTING_HOST_LEVEL);
+RoutingEdge *sg_host_edge(sg_host_t host) {
+       return (RoutingEdge*) xbt_lib_get_level(host, ROUTING_HOST_LEVEL);
 }
 }
-void sg_host_edge_set(sg_host_t host, RoutingEdgePtr edge) {
+void sg_host_edge_set(sg_host_t host, RoutingEdge *edge) {
        xbt_lib_set(host_lib, host->key, ROUTING_HOST_LEVEL, edge);
 }
 void sg_host_edge_destroy(sg_host_t host, int do_callback) {
        xbt_lib_set(host_lib, host->key, ROUTING_HOST_LEVEL, edge);
 }
 void sg_host_edge_destroy(sg_host_t host, int do_callback) {
index 564d49b..617e2da 100644 (file)
@@ -33,8 +33,8 @@ void surf_cpu_model_init_Cas01()
   sg_platf_host_add_cb(cpu_parse_init);
   sg_platf_postparse_add_cb(cpu_add_traces);
 
   sg_platf_host_add_cb(cpu_parse_init);
   sg_platf_postparse_add_cb(cpu_add_traces);
 
-  ModelPtr model_pm = surf_cpu_model_pm;
-  ModelPtr model_vm = surf_cpu_model_vm;
+  Model *model_pm = surf_cpu_model_pm;
+  Model *model_vm = surf_cpu_model_vm;
   xbt_dynar_push(model_list, &model_pm);
   xbt_dynar_push(model_list, &model_vm);
 }
   xbt_dynar_push(model_list, &model_pm);
   xbt_dynar_push(model_list, &model_vm);
 }
@@ -97,14 +97,14 @@ CpuCas01Model::~CpuCas01Model()
   delete p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
 }
 
   delete p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
 }
 
-CpuPtr CpuCas01Model::createCpu(const char *name, xbt_dynar_t power_peak,
+Cpu *CpuCas01Model::createCpu(const char *name, xbt_dynar_t power_peak,
                                  int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                           tmgr_trace_t state_trace,
                           xbt_dict_t cpu_properties)
 {
                                  int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                           tmgr_trace_t state_trace,
                           xbt_dict_t cpu_properties)
 {
-  CpuPtr cpu = NULL;
+  Cpu *cpu = NULL;
   sg_host_t host = sg_host_by_name(name);
   xbt_assert(!sg_host_surfcpu(host),
              "Host '%s' declared several times in the platform file",
   sg_host_t host = sg_host_by_name(name);
   xbt_assert(!sg_host_surfcpu(host),
              "Host '%s' declared several times in the platform file",
@@ -137,7 +137,7 @@ void CpuCas01Model::addTraces()
   /* connect all traces relative to hosts */
   xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
   /* connect all traces relative to hosts */
   xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
-    CpuCas01Ptr host = static_cast<CpuCas01Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
+    CpuCas01 *host = static_cast<CpuCas01*>(sg_host_surfcpu(sg_host_by_name(elm)));
 
     xbt_assert(host, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
     xbt_assert(host, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -147,7 +147,7 @@ void CpuCas01Model::addTraces()
 
   xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
 
   xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
-    CpuCas01Ptr host = static_cast<CpuCas01Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
+    CpuCas01 *host = static_cast<CpuCas01*>(sg_host_surfcpu(sg_host_by_name(elm)));
 
     xbt_assert(host, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
     xbt_assert(host, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -159,7 +159,7 @@ void CpuCas01Model::addTraces()
 /************
  * Resource *
  ************/
 /************
  * Resource *
  ************/
-CpuCas01::CpuCas01(CpuCas01ModelPtr model, const char *name, xbt_dynar_t powerPeak,
+CpuCas01::CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t powerPeak,
                          int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
                          e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
                          xbt_dict_t properties)
                          int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
                          e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
                          xbt_dict_t properties)
@@ -228,7 +228,7 @@ void CpuCas01::updateState(tmgr_trace_event_t event_type, double value, double d
                               m_powerPeak);
     while ((var = lmm_get_var_from_cnst
             (getModel()->getMaxminSystem(), getConstraint(), &elem))) {
                               m_powerPeak);
     while ((var = lmm_get_var_from_cnst
             (getModel()->getMaxminSystem(), getConstraint(), &elem))) {
-      CpuCas01ActionPtr action = static_cast<CpuCas01ActionPtr>(lmm_variable_id(var));
+      CpuCas01Action *action = static_cast<CpuCas01Action*>(lmm_variable_id(var));
 
       lmm_update_variable_bound(getModel()->getMaxminSystem(),
                                 action->getVariable(),
 
       lmm_update_variable_bound(getModel()->getMaxminSystem(),
                                 action->getVariable(),
@@ -250,7 +250,7 @@ void CpuCas01::updateState(tmgr_trace_event_t event_type, double value, double d
       setState(SURF_RESOURCE_OFF);
 
       while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), cnst, &elem))) {
       setState(SURF_RESOURCE_OFF);
 
       while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), cnst, &elem))) {
-        ActionPtr action = static_cast<ActionPtr>(lmm_variable_id(var));
+        Action *action = static_cast<Action*>(lmm_variable_id(var));
 
         if (action->getState() == SURF_ACTION_RUNNING ||
             action->getState() == SURF_ACTION_READY ||
 
         if (action->getState() == SURF_ACTION_RUNNING ||
             action->getState() == SURF_ACTION_READY ||
@@ -270,24 +270,24 @@ void CpuCas01::updateState(tmgr_trace_event_t event_type, double value, double d
   return;
 }
 
   return;
 }
 
-CpuActionPtr CpuCas01::execute(double size)
+CpuAction *CpuCas01::execute(double size)
 {
 
   XBT_IN("(%s,%g)", getName(), size);
 {
 
   XBT_IN("(%s,%g)", getName(), size);
-  CpuCas01ActionPtr action = new CpuCas01Action(getModel(), size, getState() != SURF_RESOURCE_ON,
+  CpuCas01Action *action = new CpuCas01Action(getModel(), size, getState() != SURF_RESOURCE_ON,
                                                              m_powerScale * m_powerPeak, getConstraint());
 
   XBT_OUT();
   return action;
 }
 
                                                              m_powerScale * m_powerPeak, getConstraint());
 
   XBT_OUT();
   return action;
 }
 
-CpuActionPtr CpuCas01::sleep(double duration)
+CpuAction *CpuCas01::sleep(double duration)
 {
   if (duration > 0)
     duration = MAX(duration, sg_surf_precision);
 
   XBT_IN("(%s,%g)", getName(), duration);
 {
   if (duration > 0)
     duration = MAX(duration, sg_surf_precision);
 
   XBT_IN("(%s,%g)", getName(), duration);
-  CpuCas01ActionPtr action = new CpuCas01Action(getModel(), 1.0, getState() != SURF_RESOURCE_ON,
+  CpuCas01Action *action = new CpuCas01Action(getModel(), 1.0, getState() != SURF_RESOURCE_ON,
                                                       m_powerScale * m_powerPeak, getConstraint());
 
 
                                                       m_powerScale * m_powerPeak, getConstraint());
 
 
@@ -298,7 +298,7 @@ CpuActionPtr CpuCas01::sleep(double duration)
     /* Move to the *end* of the corresponding action set. This convention
        is used to speed up update_resource_state  */
        action->getStateSet()->erase(action->getStateSet()->iterator_to(*action));
     /* Move to the *end* of the corresponding action set. This convention
        is used to speed up update_resource_state  */
        action->getStateSet()->erase(action->getStateSet()->iterator_to(*action));
-    action->p_stateSet = static_cast<CpuCas01ModelPtr>(getModel())->p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
+    action->p_stateSet = static_cast<CpuCas01Model*>(getModel())->p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
     action->getStateSet()->push_back(*action);
   }
 
     action->getStateSet()->push_back(*action);
   }
 
@@ -353,7 +353,7 @@ int CpuCas01::getPstate()
  * Action *
  **********/
 
  * Action *
  **********/
 
-CpuCas01Action::CpuCas01Action(ModelPtr model, double cost, bool failed, double power, lmm_constraint_t constraint)
+CpuCas01Action::CpuCas01Action(Model *model, double cost, bool failed, double power, lmm_constraint_t constraint)
  : CpuAction(model, cost, failed,
                     lmm_variable_new(model->getMaxminSystem(), this,
                     1.0, power, 1))
  : CpuAction(model, cost, failed,
                     lmm_variable_new(model->getMaxminSystem(), this,
                     1.0, power, 1))
index b40cd04..a763abf 100644 (file)
  * Classes *
  ***********/
 class CpuCas01Model;
  * Classes *
  ***********/
 class CpuCas01Model;
-typedef CpuCas01Model *CpuCas01ModelPtr;
-
 class CpuCas01;
 class CpuCas01;
-typedef CpuCas01 *CpuCas01Ptr;
-
 class CpuCas01Action;
 class CpuCas01Action;
-typedef CpuCas01Action *CpuCas01ActionPtr;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -29,7 +24,7 @@ public:
   double (CpuCas01Model::*shareResources)(double now);
   void (CpuCas01Model::*updateActionsState)(double now, double delta);
 
   double (CpuCas01Model::*shareResources)(double now);
   void (CpuCas01Model::*updateActionsState)(double now, double delta);
 
-  CpuPtr createCpu(const char *name, xbt_dynar_t power_peak, int pstate,
+  Cpu *createCpu(const char *name, xbt_dynar_t power_peak, int pstate,
                    double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                    double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
@@ -37,7 +32,7 @@ public:
                           xbt_dict_t cpu_properties);
   double shareResourcesFull(double now);
   void addTraces();
                           xbt_dict_t cpu_properties);
   double shareResourcesFull(double now);
   void addTraces();
-  ActionListPtr p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
+  ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
 };
 
 /************
 };
 
 /************
@@ -46,14 +41,14 @@ public:
 
 class CpuCas01 : public Cpu {
 public:
 
 class CpuCas01 : public Cpu {
 public:
-  CpuCas01(CpuCas01ModelPtr model, const char *name, xbt_dynar_t power_peak,
+  CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t power_peak,
         int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties) ;
   ~CpuCas01();
   void updateState(tmgr_trace_event_t event_type, double value, double date);
         int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties) ;
   ~CpuCas01();
   void updateState(tmgr_trace_event_t event_type, double value, double date);
-  CpuActionPtr execute(double size);
-  CpuActionPtr sleep(double duration);
+  CpuAction *execute(double size);
+  CpuAction *sleep(double duration);
 
   double getCurrentPowerPeak();
   double getPowerPeakAt(int pstate_index);
 
   double getCurrentPowerPeak();
   double getPowerPeakAt(int pstate_index);
@@ -78,10 +73,10 @@ private:
  * Action *
  **********/
 class CpuCas01Action: public CpuAction {
  * Action *
  **********/
 class CpuCas01Action: public CpuAction {
-  friend CpuActionPtr CpuCas01::execute(double size);
-  friend CpuActionPtr CpuCas01::sleep(double duration);
+  friend CpuAction *CpuCas01::execute(double size);
+  friend CpuAction *CpuCas01::sleep(double duration);
 public:
 public:
-  CpuCas01Action(ModelPtr model, double cost, bool failed, double power,
+  CpuCas01Action(Model *model, double cost, bool failed, double power,
                  lmm_constraint_t constraint);
 
   ~CpuCas01Action() {};
                  lmm_constraint_t constraint);
 
   ~CpuCas01Action() {};
index 906e07e..23929b0 100644 (file)
@@ -13,22 +13,22 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
 int autoload_surf_cpu_model = 1;
 void_f_void_t surf_cpu_model_init_preparse = NULL;
 
 int autoload_surf_cpu_model = 1;
 void_f_void_t surf_cpu_model_init_preparse = NULL;
 
-CpuModelPtr surf_cpu_model_pm;
-CpuModelPtr surf_cpu_model_vm;
+CpuModel *surf_cpu_model_pm;
+CpuModel *surf_cpu_model_vm;
 /*************
  * Callbacks *
  *************/
 
 /*************
  * Callbacks *
  *************/
 
-CpuPtr getActionCpu(CpuActionPtr action) {
-  return static_cast<CpuPtr>(lmm_constraint_id(lmm_get_cnst_from_var
+Cpu *getActionCpu(CpuAction *action) {
+  return static_cast<Cpu*>(lmm_constraint_id(lmm_get_cnst_from_var
                                         (action->getModel()->getMaxminSystem(),
                                         action->getVariable(), 0)));
 }
 
                                         (action->getModel()->getMaxminSystem(),
                                         action->getVariable(), 0)));
 }
 
-surf_callback(void, CpuPtr) cpuCreatedCallbacks;
-surf_callback(void, CpuPtr) cpuDestructedCallbacks;
-surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks;
-surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks;
+surf_callback(void, Cpu*) cpuCreatedCallbacks;
+surf_callback(void, Cpu*) cpuDestructedCallbacks;
+surf_callback(void, Cpu*, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks;
+surf_callback(void, CpuAction*, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks;
 
 void cpu_parse_init(sg_platf_host_cbarg_t host){
   surf_cpu_model_pm->createCpu(
 
 void cpu_parse_init(sg_platf_host_cbarg_t host){
   surf_cpu_model_pm->createCpu(
@@ -52,13 +52,13 @@ void cpu_add_traces(){
  *********/
 void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
 {
  *********/
 void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
 {
-  CpuActionPtr action;
+  CpuAction *action;
   while ((xbt_heap_size(getActionHeap()) > 0)
          && (double_equals(xbt_heap_maxkey(getActionHeap()), now, sg_surf_precision))) {
   while ((xbt_heap_size(getActionHeap()) > 0)
          && (double_equals(xbt_heap_maxkey(getActionHeap()), now, sg_surf_precision))) {
-    action = static_cast<CpuActionPtr>(xbt_heap_pop(getActionHeap()));
+    action = static_cast<CpuAction*>(xbt_heap_pop(getActionHeap()));
     XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
     if (TRACE_is_enabled()) {
     XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
     if (TRACE_is_enabled()) {
-      CpuPtr cpu = static_cast<CpuPtr>(lmm_constraint_id(lmm_get_cnst_from_var(getMaxminSystem(), action->getVariable(), 0)));
+      Cpu *cpu = static_cast<Cpu*>(lmm_constraint_id(lmm_get_cnst_from_var(getMaxminSystem(), action->getVariable(), 0)));
       TRACE_surf_host_set_utilization(cpu->getName(), action->getCategory(),
                                       lmm_variable_getvalue(action->getVariable()),
                                       action->getLastUpdate(),
       TRACE_surf_host_set_utilization(cpu->getName(), action->getCategory(),
                                       lmm_variable_getvalue(action->getVariable()),
                                       action->getLastUpdate(),
@@ -77,10 +77,10 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
     //defining the last timestamp that we can safely dump to trace file
     //without losing the event ascending order (considering all CPU's)
     double smaller = -1;
     //defining the last timestamp that we can safely dump to trace file
     //without losing the event ascending order (considering all CPU's)
     double smaller = -1;
-    ActionListPtr actionSet = getRunningActionSet();
+    ActionList *actionSet = getRunningActionSet();
     for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
        ; it != itend ; ++it) {
     for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
        ; it != itend ; ++it) {
-      action = static_cast<CpuActionPtr>(&*it);
+      action = static_cast<CpuAction*>(&*it);
         if (smaller < 0) {
           smaller = action->getLastUpdate();
           continue;
         if (smaller < 0) {
           smaller = action->getLastUpdate();
           continue;
@@ -98,16 +98,15 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
 
 void CpuModel::updateActionsStateFull(double now, double delta)
 {
 
 void CpuModel::updateActionsStateFull(double now, double delta)
 {
-  CpuActionPtr action = NULL;
-  ActionListPtr running_actions = getRunningActionSet();
+  CpuAction *action = NULL;
+  ActionList *running_actions = getRunningActionSet();
 
   for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
      ; it != itend ; it=itNext) {
        ++itNext;
 
   for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
      ; it != itend ; it=itNext) {
        ++itNext;
-    action = static_cast<CpuActionPtr>(&*it);
+    action = static_cast<CpuAction*>(&*it);
     if (TRACE_is_enabled()) {
     if (TRACE_is_enabled()) {
-      CpuPtr x = (CpuPtr) lmm_constraint_id(lmm_get_cnst_from_var
-                              (getMaxminSystem(), action->getVariable(), 0));
+      Cpu *x = static_cast<Cpu*> (lmm_constraint_id(lmm_get_cnst_from_var(getMaxminSystem(), action->getVariable(), 0)) );
 
       TRACE_surf_host_set_utilization(x->getName(),
                                       action->getCategory(),
 
       TRACE_surf_host_set_utilization(x->getName(),
                                       action->getCategory(),
@@ -146,7 +145,7 @@ Cpu::Cpu(){
   surf_callback_emit(cpuCreatedCallbacks, this);
 }
 
   surf_callback_emit(cpuCreatedCallbacks, this);
 }
 
-Cpu::Cpu(ModelPtr model, const char *name, xbt_dict_t props,
+Cpu::Cpu(Model *model, const char *name, xbt_dict_t props,
                 int core, double powerPeak, double powerScale)
  : Resource(model, name, props)
  , m_core(core)
                 int core, double powerPeak, double powerScale)
  : Resource(model, name, props)
  , m_core(core)
@@ -158,7 +157,7 @@ Cpu::Cpu(ModelPtr model, const char *name, xbt_dict_t props,
   surf_callback_emit(cpuCreatedCallbacks, this);
 }
 
   surf_callback_emit(cpuCreatedCallbacks, this);
 }
 
-Cpu::Cpu(ModelPtr model, const char *name, xbt_dict_t props,
+Cpu::Cpu(Model *model, const char *name, xbt_dict_t props,
                 lmm_constraint_t constraint, int core, double powerPeak, double powerScale)
  : Resource(model, name, props, constraint)
  , m_core(core)
                 lmm_constraint_t constraint, int core, double powerPeak, double powerScale)
  : Resource(model, name, props, constraint)
  , m_core(core)
@@ -246,7 +245,7 @@ void CpuAction::updateRemainingLazy(double now)
     double_update(&(m_remains), m_lastValue * delta, sg_maxmin_precision*sg_surf_precision);
 
     if (TRACE_is_enabled()) {
     double_update(&(m_remains), m_lastValue * delta, sg_maxmin_precision*sg_surf_precision);
 
     if (TRACE_is_enabled()) {
-      CpuPtr cpu = static_cast<CpuPtr>(lmm_constraint_id(lmm_get_cnst_from_var(getModel()->getMaxminSystem(), getVariable(), 0)));
+      Cpu *cpu = static_cast<Cpu*>(lmm_constraint_id(lmm_get_cnst_from_var(getModel()->getMaxminSystem(), getVariable(), 0)));
       TRACE_surf_host_set_utilization(cpu->getName(), getCategory(), m_lastValue, m_lastUpdate, now - m_lastUpdate);
     }
     XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, m_remains);
       TRACE_surf_host_set_utilization(cpu->getName(), getCategory(), m_lastValue, m_lastUpdate, now - m_lastUpdate);
     }
     XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, m_remains);
@@ -276,7 +275,7 @@ void CpuAction::updateRemainingLazy(double now)
  * action object does not have the information about the location where the
  * action is being executed.
  */
  * action object does not have the information about the location where the
  * action is being executed.
  */
-void CpuAction::setAffinity(CpuPtr cpu, unsigned long mask)
+void CpuAction::setAffinity(Cpu *cpu, unsigned long mask)
 {
   lmm_variable_t var_obj = getVariable();
   XBT_IN("(%p,%lx)", this, mask);
 {
   lmm_variable_t var_obj = getVariable();
   XBT_IN("(%p,%lx)", this, mask);
index 045e6fe..6375ce0 100644 (file)
  * Classes *
  ***********/
 class CpuModel;
  * Classes *
  ***********/
 class CpuModel;
-typedef CpuModel *CpuModelPtr;
-
 class Cpu;
 class Cpu;
-
 class CpuAction;
 class CpuAction;
-typedef CpuAction *CpuActionPtr;
-
 class CpuPlugin;
 class CpuPlugin;
-typedef CpuPlugin *CpuPluginPtr;
 
 /*************
  * Callbacks *
  *************/
 
 /*************
  * Callbacks *
  *************/
-XBT_PUBLIC(CpuPtr) getActionCpu(CpuActionPtr action);
+XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action);
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Cpu creation *
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Cpu creation *
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
-XBT_PUBLIC_DATA( surf_callback(void, CpuPtr)) cpuCreatedCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, Cpu*)) cpuCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Cpu destruction *
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Cpu destruction *
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
-XBT_PUBLIC_DATA( surf_callback(void, CpuPtr)) cpuDestructedCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, Cpu*)) cpuDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Cpu State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Cpu State changed *
- * @details Callback functions have the following signature: `void(CpuActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
  */
-XBT_PUBLIC_DATA( surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_resource_state_t)) cpuStateChangedCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, Cpu*, e_surf_resource_state_t, e_surf_resource_state_t)) cpuStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after CpuAction State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after CpuAction State changed *
- * @details Callback functions have the following signature: `void(CpuActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
+ * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_action_state_t old, e_surf_action_state_t current)`
  */
  */
-XBT_PUBLIC_DATA( surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t)) cpuActionStateChangedCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, CpuAction*, e_surf_action_state_t, e_surf_action_state_t)) cpuActionStateChangedCallbacks;
 
 XBT_PUBLIC(void) cpu_parse_init(sg_platf_host_cbarg_t host);
 
 
 XBT_PUBLIC(void) cpu_parse_init(sg_platf_host_cbarg_t host);
 
@@ -87,7 +81,7 @@ public:
    * @param state_trace [TODO]
    * @param cpu_properties Dictionary of properties associated to this Cpu
    */
    * @param state_trace [TODO]
    * @param cpu_properties Dictionary of properties associated to this Cpu
    */
-  virtual CpuPtr createCpu(const char *name, xbt_dynar_t power_peak,
+  virtual Cpu *createCpu(const char *name, xbt_dynar_t power_peak,
                       int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                       int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
@@ -124,7 +118,7 @@ public:
    * @param powerPeak The power peak of this Cpu
    * @param powerScale The power scale of this Cpu
    */
    * @param powerPeak The power peak of this Cpu
    * @param powerScale The power scale of this Cpu
    */
-  Cpu(ModelPtr model, const char *name, xbt_dict_t props,
+  Cpu(Model *model, const char *name, xbt_dict_t props,
          lmm_constraint_t constraint, int core, double powerPeak, double powerScale);
 
   /**
          lmm_constraint_t constraint, int core, double powerPeak, double powerScale);
 
   /**
@@ -137,7 +131,7 @@ public:
    * @param powerPeak The power peak of this Cpu in [TODO]
    * @param powerScale The power scale of this Cpu in [TODO]
    */
    * @param powerPeak The power peak of this Cpu in [TODO]
    * @param powerScale The power scale of this Cpu in [TODO]
    */
-  Cpu(ModelPtr model, const char *name, xbt_dict_t props,
+  Cpu(Model *model, const char *name, xbt_dict_t props,
          int core, double powerPeak, double powerScale);
 
   /**
          int core, double powerPeak, double powerScale);
 
   /**
@@ -151,7 +145,7 @@ public:
    * @param size The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    */
    * @param size The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    */
-  virtual CpuActionPtr execute(double size)=0;
+  virtual CpuAction *execute(double size)=0;
 
   /**
    * @brief Make a process sleep for duration (in seconds)
 
   /**
    * @brief Make a process sleep for duration (in seconds)
@@ -159,7 +153,7 @@ public:
    * @param duration The number of seconds to sleep
    * @return The CpuAction corresponding to the sleeping
    */
    * @param duration The number of seconds to sleep
    * @return The CpuAction corresponding to the sleeping
    */
-  virtual CpuActionPtr sleep(double duration)=0;
+  virtual CpuAction *sleep(double duration)=0;
 
   /**
    * @brief Get the number of cores of the current Cpu
 
   /**
    * @brief Get the number of cores of the current Cpu
@@ -222,7 +216,7 @@ public:
  * @details A CpuAction represent the execution of code on a Cpu
  */
 XBT_PUBLIC_CLASS CpuAction : public Action {
  * @details A CpuAction represent the execution of code on a Cpu
  */
 XBT_PUBLIC_CLASS CpuAction : public Action {
-friend XBT_PUBLIC(CpuPtr) getActionCpu(CpuActionPtr action);
+friend XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action);
 public:
   /**
    * @brief CpuAction constructor
 public:
   /**
    * @brief CpuAction constructor
@@ -231,7 +225,7 @@ public:
    * @param cost [TODO]
    * @param failed [TODO]
    */
    * @param cost [TODO]
    * @param failed [TODO]
    */
-  CpuAction(ModelPtr model, double cost, bool failed)
+  CpuAction(Model *model, double cost, bool failed)
     : Action(model, cost, failed) {} //FIXME:REMOVE
 
   /**
     : Action(model, cost, failed) {} //FIXME:REMOVE
 
   /**
@@ -242,7 +236,7 @@ public:
    * @param failed [TODO]
    * @param var The lmm variable associated to this CpuAction if it is part of a LMM component
    */
    * @param failed [TODO]
    * @param var The lmm variable associated to this CpuAction if it is part of a LMM component
    */
-  CpuAction(ModelPtr model, double cost, bool failed, lmm_variable_t var)
+  CpuAction(Model *model, double cost, bool failed, lmm_variable_t var)
     : Action(model, cost, failed, var) {}
 
   /**
     : Action(model, cost, failed, var) {}
 
   /**
@@ -252,7 +246,7 @@ public:
    * @param cpu [TODO]
    * @param mask [TODO]
    */
    * @param cpu [TODO]
    * @param mask [TODO]
    */
-  virtual void setAffinity(CpuPtr cpu, unsigned long mask);
+  virtual void setAffinity(Cpu *cpu, unsigned long mask);
 
   void setState(e_surf_action_state_t state);
 
 
   void setState(e_surf_action_state_t state);
 
index 5d3cbf3..160fa74 100644 (file)
@@ -395,11 +395,11 @@ void surf_cpu_model_init_ti()
   xbt_assert(!surf_cpu_model_vm,"CPU model already initialized. This should not happen.");
 
   surf_cpu_model_pm = new CpuTiModel();
   xbt_assert(!surf_cpu_model_vm,"CPU model already initialized. This should not happen.");
 
   surf_cpu_model_pm = new CpuTiModel();
-  surf_cpu_model_vm  = new CpuTiModel();
+  surf_cpu_model_vm = new CpuTiModel();
 
   cpu_ti_define_callbacks();
 
   cpu_ti_define_callbacks();
-  ModelPtr model_pm = static_cast<ModelPtr>(surf_cpu_model_pm);
-  ModelPtr model_vm = static_cast<ModelPtr>(surf_cpu_model_vm);
+  Model *model_pm = static_cast<Model*>(surf_cpu_model_pm);
+  Model *model_vm = static_cast<Model*>(surf_cpu_model_vm);
   xbt_dynar_push(model_list, &model_pm);
   xbt_dynar_push(model_list, &model_vm);
 }
   xbt_dynar_push(model_list, &model_pm);
   xbt_dynar_push(model_list, &model_vm);
 }
@@ -423,7 +423,7 @@ CpuTiModel::~CpuTiModel()
   xbt_heap_free(p_tiActionHeap);
 }
 
   xbt_heap_free(p_tiActionHeap);
 }
 
-CpuPtr CpuTiModel::createCpu(const char *name,
+Cpu *CpuTiModel::createCpu(const char *name,
                               xbt_dynar_t powerPeak,
                               int pstate,
                            double powerScale,
                               xbt_dynar_t powerPeak,
                               int pstate,
                            double powerScale,
@@ -440,7 +440,7 @@ CpuPtr CpuTiModel::createCpu(const char *name,
               name);
   xbt_assert(xbt_dynar_getfirst_as(powerPeak, double) > 0.0,
       "Power has to be >0.0. Did you forget to specify the mandatory power attribute?");
               name);
   xbt_assert(xbt_dynar_getfirst_as(powerPeak, double) > 0.0,
       "Power has to be >0.0. Did you forget to specify the mandatory power attribute?");
-  CpuTiPtr cpu = new CpuTi(this, name, powerPeak, pstate, powerScale, powerTrace,
+  CpuTi *cpu = new CpuTi(this, name, powerPeak, pstate, powerScale, powerTrace,
                           core, stateInitial, stateTrace, cpuProperties);
   sg_host_surfcpu_set(host, cpu);
   return cpu;
                           core, stateInitial, stateTrace, cpuProperties);
   sg_host_surfcpu_set(host, cpu);
   return cpu;
@@ -453,7 +453,7 @@ double CpuTiModel::shareResources(double now)
 /* iterates over modified cpus to update share resources */
   for(CpuTiList::iterator it(p_modifiedCpu->begin()), itend(p_modifiedCpu->end())
      ; it != itend ;) {
 /* iterates over modified cpus to update share resources */
   for(CpuTiList::iterator it(p_modifiedCpu->begin()), itend(p_modifiedCpu->end())
      ; it != itend ;) {
-    CpuTiPtr ti = &*it;
+    CpuTi *ti = &*it;
     ++it;
     ti->updateActionsFinishTime(now);
   }
     ++it;
     ti->updateActionsFinishTime(now);
   }
@@ -471,7 +471,7 @@ void CpuTiModel::updateActionsState(double now, double /*delta*/)
 {
   while ((xbt_heap_size(p_tiActionHeap) > 0)
          && (xbt_heap_maxkey(p_tiActionHeap) <= now)) {
 {
   while ((xbt_heap_size(p_tiActionHeap) > 0)
          && (xbt_heap_maxkey(p_tiActionHeap) <= now)) {
-    CpuTiActionPtr action = (CpuTiActionPtr) xbt_heap_pop(p_tiActionHeap);
+    CpuTiAction *action = (CpuTiAction*) xbt_heap_pop(p_tiActionHeap);
     XBT_DEBUG("Action %p: finish", action);
     action->finish();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     XBT_DEBUG("Action %p: finish", action);
     action->finish();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
@@ -496,7 +496,7 @@ void CpuTiModel::addTraces()
 /* connect all traces relative to hosts */
   xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
 /* connect all traces relative to hosts */
   xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
-    CpuTiPtr cpu = static_cast<CpuTiPtr>(sg_host_surfcpu(sg_host_by_name(elm)));
+    CpuTi *cpu = static_cast<CpuTi*>(sg_host_surfcpu(sg_host_by_name(elm)));
 
     xbt_assert(cpu, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
     xbt_assert(cpu, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -512,7 +512,7 @@ void CpuTiModel::addTraces()
 
   xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
 
   xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
-    CpuTiPtr cpu = static_cast<CpuTiPtr>(sg_host_surfcpu(sg_host_by_name(elm)));
+    CpuTi *cpu = static_cast<CpuTi*>(sg_host_surfcpu(sg_host_by_name(elm)));
 
     xbt_assert(cpu, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
     xbt_assert(cpu, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -542,7 +542,7 @@ void CpuTiModel::addTraces()
 /************
  * Resource *
  ************/
 /************
  * Resource *
  ************/
-CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak,
+CpuTi::CpuTi(CpuTiModel *model, const char *name, xbt_dynar_t powerPeak,
         int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties)
         int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties)
@@ -590,11 +590,11 @@ CpuTi::~CpuTi(){
 void CpuTi::updateState(tmgr_trace_event_t event_type,
                         double value, double date)
 {
 void CpuTi::updateState(tmgr_trace_event_t event_type,
                         double value, double date)
 {
-  CpuTiActionPtr action;
+  CpuTiAction *action;
 
   if (event_type == p_powerEvent) {
     tmgr_trace_t power_trace;
 
   if (event_type == p_powerEvent) {
     tmgr_trace_t power_trace;
-    CpuTiTgmrPtr trace;
+    CpuTiTgmr *trace;
     s_tmgr_event_t val;
 
     XBT_DEBUG("Finish trace date: %f value %f date %f", surf_get_clock(),
     s_tmgr_event_t val;
 
     XBT_DEBUG("Finish trace date: %f value %f date %f", surf_get_clock(),
@@ -637,8 +637,8 @@ void CpuTi::updateState(tmgr_trace_event_t event_type,
           action->setFinishTime(date);
           action->setState(SURF_ACTION_FAILED);
           if (action->m_indexHeap >= 0) {
           action->setFinishTime(date);
           action->setState(SURF_ACTION_FAILED);
           if (action->m_indexHeap >= 0) {
-            CpuTiActionPtr heap_act = (CpuTiActionPtr)
-                xbt_heap_remove(static_cast<CpuTiModelPtr>(getModel())->p_tiActionHeap, action->m_indexHeap);
+            CpuTiAction *heap_act = (CpuTiAction*)
+                xbt_heap_remove(static_cast<CpuTiModel*>(getModel())->p_tiActionHeap, action->m_indexHeap);
             if (heap_act != action)
               DIE_IMPOSSIBLE;
           }
             if (heap_act != action)
               DIE_IMPOSSIBLE;
           }
@@ -657,7 +657,7 @@ void CpuTi::updateState(tmgr_trace_event_t event_type,
 
 void CpuTi::updateActionsFinishTime(double now)
 {
 
 void CpuTi::updateActionsFinishTime(double now)
 {
-  CpuTiActionPtr action;
+  CpuTiAction *action;
   double sum_priority = 0.0, total_area, min_finish = -1;
 
 /* update remaning amount of actions */
   double sum_priority = 0.0, total_area, min_finish = -1;
 
 /* update remaning amount of actions */
@@ -716,13 +716,13 @@ updateRemainingAmount(now);
     /* add in action heap */
     XBT_DEBUG("action(%p) index %d", action, action->m_indexHeap);
     if (action->m_indexHeap >= 0) {
     /* add in action heap */
     XBT_DEBUG("action(%p) index %d", action, action->m_indexHeap);
     if (action->m_indexHeap >= 0) {
-      CpuTiActionPtr heap_act = (CpuTiActionPtr)
-          xbt_heap_remove(static_cast<CpuTiModelPtr>(getModel())->p_tiActionHeap, action->m_indexHeap);
+      CpuTiAction *heap_act = (CpuTiAction*)
+          xbt_heap_remove(static_cast<CpuTiModel*>(getModel())->p_tiActionHeap, action->m_indexHeap);
       if (heap_act != action)
         DIE_IMPOSSIBLE;
     }
     if (min_finish != NO_MAX_DURATION)
       if (heap_act != action)
         DIE_IMPOSSIBLE;
     }
     if (min_finish != NO_MAX_DURATION)
-      xbt_heap_push(static_cast<CpuTiModelPtr>(getModel())->p_tiActionHeap, action, min_finish);
+      xbt_heap_push(static_cast<CpuTiModel*>(getModel())->p_tiActionHeap, action, min_finish);
 
     XBT_DEBUG
         ("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f",
 
     XBT_DEBUG
         ("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f",
@@ -753,7 +753,7 @@ double CpuTi::getAvailableSpeed()
 void CpuTi::updateRemainingAmount(double now)
 {
   double area_total;
 void CpuTi::updateRemainingAmount(double now)
 {
   double area_total;
-  CpuTiActionPtr action;
+  CpuTiAction *action;
 
   /* already updated */
   if (m_lastUpdate >= now)
 
   /* already updated */
   if (m_lastUpdate >= now)
@@ -797,10 +797,10 @@ void CpuTi::updateRemainingAmount(double now)
   m_lastUpdate = now;
 }
 
   m_lastUpdate = now;
 }
 
-CpuActionPtr CpuTi::execute(double size)
+CpuAction *CpuTi::execute(double size)
 {
   XBT_IN("(%s,%g)", getName(), size);
 {
   XBT_IN("(%s,%g)", getName(), size);
-  CpuTiActionPtr action = new CpuTiAction(static_cast<CpuTiModelPtr>(getModel()), size, getState() != SURF_RESOURCE_ON, this);
+  CpuTiAction *action = new CpuTiAction(static_cast<CpuTiModel*>(getModel()), size, getState() != SURF_RESOURCE_ON, this);
 
   p_actionSet->push_back(*action);
 
 
   p_actionSet->push_back(*action);
 
@@ -809,13 +809,13 @@ CpuActionPtr CpuTi::execute(double size)
 }
 
 
 }
 
 
-CpuActionPtr CpuTi::sleep(double duration)
+CpuAction *CpuTi::sleep(double duration)
 {
   if (duration > 0)
     duration = MAX(duration, sg_surf_precision);
 
   XBT_IN("(%s,%g)", getName(), duration);
 {
   if (duration > 0)
     duration = MAX(duration, sg_surf_precision);
 
   XBT_IN("(%s,%g)", getName(), duration);
-  CpuTiActionPtr action = new CpuTiAction(static_cast<CpuTiModelPtr>(getModel()), 1.0, getState() != SURF_RESOURCE_ON, this);
+  CpuTiAction *action = new CpuTiAction(static_cast<CpuTiModel*>(getModel()), 1.0, getState() != SURF_RESOURCE_ON, this);
 
   action->m_maxDuration = duration;
   action->m_suspended = 2;
 
   action->m_maxDuration = duration;
   action->m_suspended = 2;
@@ -823,7 +823,7 @@ CpuActionPtr CpuTi::sleep(double duration)
    /* Move to the *end* of the corresponding action set. This convention
       is used to speed up update_resource_state  */
        action->getStateSet()->erase(action->getStateSet()->iterator_to(*action));
    /* Move to the *end* of the corresponding action set. This convention
       is used to speed up update_resource_state  */
        action->getStateSet()->erase(action->getStateSet()->iterator_to(*action));
-    action->p_stateSet = static_cast<CpuTiModelPtr>(getModel())->p_runningActionSetThatDoesNotNeedBeingChecked;
+    action->p_stateSet = static_cast<CpuTiModel*>(getModel())->p_runningActionSetThatDoesNotNeedBeingChecked;
     action->getStateSet()->push_back(*action);
   }
 
     action->getStateSet()->push_back(*action);
   }
 
@@ -834,7 +834,7 @@ CpuActionPtr CpuTi::sleep(double duration)
 }
 
 void CpuTi::modified(bool modified){
 }
 
 void CpuTi::modified(bool modified){
-  CpuTiListPtr modifiedCpu = static_cast<CpuTiModelPtr>(getModel())->p_modifiedCpu;
+  CpuTiList *modifiedCpu = static_cast<CpuTiModel*>(getModel())->p_modifiedCpu;
   if (modified) {
     if (!is_linked()) {
       modifiedCpu->push_back(*this);
   if (modified) {
     if (!is_linked()) {
       modifiedCpu->push_back(*this);
@@ -852,11 +852,11 @@ void CpuTi::modified(bool modified){
 
 static void cpu_ti_action_update_index_heap(void *action, int i)
 {
 
 static void cpu_ti_action_update_index_heap(void *action, int i)
 {
-((CpuTiActionPtr)action)->updateIndexHeap(i);
+((CpuTiAction*)action)->updateIndexHeap(i);
 }
 
 }
 
-CpuTiAction::CpuTiAction(CpuTiModelPtr model_, double cost, bool failed,
-                                CpuTiPtr cpu)
+CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed,
+                                CpuTi *cpu)
  : CpuAction(model_, cost, failed)
 {
   m_suspended = 0;        /* Should be useless because of the
  : CpuAction(model_, cost, failed)
 {
   m_suspended = 0;        /* Should be useless because of the
@@ -887,7 +887,7 @@ int CpuTiAction::unref()
     if (actionTiHook::is_linked())
       p_cpu->p_actionSet->erase(p_cpu->p_actionSet->iterator_to(*this));
     /* remove from heap */
     if (actionTiHook::is_linked())
       p_cpu->p_actionSet->erase(p_cpu->p_actionSet->iterator_to(*this));
     /* remove from heap */
-    xbt_heap_remove(static_cast<CpuTiModelPtr>(getModel())->p_tiActionHeap, this->m_indexHeap);
+    xbt_heap_remove(static_cast<CpuTiModel*>(getModel())->p_tiActionHeap, this->m_indexHeap);
     p_cpu->modified(true);
     delete this;
     return 1;
     p_cpu->modified(true);
     delete this;
     return 1;
@@ -950,7 +950,7 @@ void CpuTiAction::setMaxDuration(double duration)
 
 /* add in action heap */
   if (m_indexHeap >= 0) {
 
 /* add in action heap */
   if (m_indexHeap >= 0) {
-    CpuTiActionPtr heap_act = (CpuTiActionPtr)
+    CpuTiAction *heap_act = (CpuTiAction*)
         xbt_heap_remove(getModel()->getActionHeap(), m_indexHeap);
     if (heap_act != this)
       DIE_IMPOSSIBLE;
         xbt_heap_remove(getModel()->getActionHeap(), m_indexHeap);
     if (heap_act != this)
       DIE_IMPOSSIBLE;
index 80679ad..022e2ce 100644 (file)
  * Classes *
  ***********/
 class CpuTiTrace;
  * Classes *
  ***********/
 class CpuTiTrace;
-typedef CpuTiTrace *CpuTiTracePtr;
-
 class CpuTiTgmr;
 class CpuTiTgmr;
-typedef CpuTiTgmr *CpuTiTgmrPtr;
-
 class CpuTiModel;
 class CpuTiModel;
-typedef CpuTiModel *CpuTiModelPtr;
-
 class CpuTi;
 class CpuTi;
-typedef CpuTi *CpuTiPtr;
-
 class CpuTiAction;
 class CpuTiAction;
-typedef CpuTiAction *CpuTiActionPtr;
 
 typedef boost::intrusive::list<CpuTi> CpuTiList;
 
 typedef boost::intrusive::list<CpuTi> CpuTiList;
-typedef CpuTiList* CpuTiListPtr;
 typedef boost::intrusive::list_base_hook<> cpuTiHook;
 
 struct tiTag;
 typedef boost::intrusive::list<CpuTiAction, boost::intrusive::base_hook<boost::intrusive::list_base_hook<boost::intrusive::tag<tiTag> > > > ActionTiList;
 typedef boost::intrusive::list_base_hook<> cpuTiHook;
 
 struct tiTag;
 typedef boost::intrusive::list<CpuTiAction, boost::intrusive::base_hook<boost::intrusive::list_base_hook<boost::intrusive::tag<tiTag> > > > ActionTiList;
-typedef ActionTiList* ActionTiListPtr;
 typedef boost::intrusive::list_base_hook<boost::intrusive::tag<tiTag> > actionTiHook;
 
 /*********
 typedef boost::intrusive::list_base_hook<boost::intrusive::tag<tiTag> > actionTiHook;
 
 /*********
@@ -82,7 +71,7 @@ public:
   double m_lastTime;             /*< Integral interval last point (discret time) */
   double m_total;                 /*< Integral total between 0 and last_pointn */
 
   double m_lastTime;             /*< Integral interval last point (discret time) */
   double m_total;                 /*< Integral total between 0 and last_pointn */
 
-  CpuTiTracePtr p_trace;
+  CpuTiTrace *p_trace;
   tmgr_trace_t p_powerTrace;
 };
 
   tmgr_trace_t p_powerTrace;
 };
 
@@ -93,7 +82,7 @@ class CpuTiModel : public CpuModel {
 public:
   CpuTiModel();
   ~CpuTiModel();
 public:
   CpuTiModel();
   ~CpuTiModel();
-  CpuPtr createCpu(const char *name,  xbt_dynar_t powerPeak,
+  Cpu *createCpu(const char *name,  xbt_dynar_t powerPeak,
                           int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                           int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
@@ -103,17 +92,17 @@ public:
   void updateActionsState(double now, double delta);
   void addTraces();
 
   void updateActionsState(double now, double delta);
   void addTraces();
 
-  ActionListPtr p_runningActionSetThatDoesNotNeedBeingChecked;
-  CpuTiListPtr p_modifiedCpu;
+  ActionList *p_runningActionSetThatDoesNotNeedBeingChecked;
+  CpuTiList *p_modifiedCpu;
   xbt_heap_t p_tiActionHeap;
 
 protected:
   xbt_heap_t p_tiActionHeap;
 
 protected:
-  void NotifyResourceTurnedOn(ResourcePtr){};
-  void NotifyResourceTurnedOff(ResourcePtr){};
+  void NotifyResourceTurnedOn(Resource*){};
+  void NotifyResourceTurnedOff(Resource*){};
 
 
-  void NotifyActionCancel(ActionPtr){};
-  void NotifyActionResume(ActionPtr){};
-  void NotifyActionSuspend(ActionPtr){};
+  void NotifyActionCancel(Action*){};
+  void NotifyActionResume(Action*){};
+  void NotifyActionSuspend(Action*){};
 };
 
 /************
 };
 
 /************
@@ -122,7 +111,7 @@ protected:
 class CpuTi : public cpuTiHook, public Cpu {
 public:
   CpuTi() {};
 class CpuTi : public cpuTiHook, public Cpu {
 public:
   CpuTi() {};
-  CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak,
+  CpuTi(CpuTiModel *model, const char *name, xbt_dynar_t powerPeak,
         int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties) ;
         int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties) ;
@@ -132,8 +121,8 @@ public:
   void updateActionsFinishTime(double now);
   bool isUsed();
   void printCpuTiModel();
   void updateActionsFinishTime(double now);
   bool isUsed();
   void printCpuTiModel();
-  CpuActionPtr execute(double size);
-  CpuActionPtr sleep(double duration);
+  CpuAction *execute(double size);
+  CpuAction *sleep(double duration);
   double getAvailableSpeed();
 
   double getCurrentPowerPeak() {THROW_UNIMPLEMENTED;};
   double getAvailableSpeed();
 
   double getCurrentPowerPeak() {THROW_UNIMPLEMENTED;};
@@ -143,10 +132,10 @@ public:
   int  getPstate() { THROW_UNIMPLEMENTED;}
   void modified(bool modified);
 
   int  getPstate() { THROW_UNIMPLEMENTED;}
   void modified(bool modified);
 
-  CpuTiTgmrPtr p_availTrace;       /*< Structure with data needed to integrate trace file */
+  CpuTiTgmr *p_availTrace;       /*< Structure with data needed to integrate trace file */
   tmgr_trace_event_t p_stateEvent;       /*< trace file with states events (ON or OFF) */
   tmgr_trace_event_t p_powerEvent;       /*< trace file with availability events */
   tmgr_trace_event_t p_stateEvent;       /*< trace file with states events (ON or OFF) */
   tmgr_trace_event_t p_powerEvent;       /*< trace file with availability events */
-  ActionTiListPtr p_actionSet;        /*< set with all actions running on cpu */
+  ActionTiList *p_actionSet;        /*< set with all actions running on cpu */
   double m_sumPriority;          /*< the sum of actions' priority that are running on cpu */
   double m_lastUpdate;           /*< last update of actions' remaining amount done */
 
   double m_sumPriority;          /*< the sum of actions' priority that are running on cpu */
   double m_lastUpdate;           /*< last update of actions' remaining amount done */
 
@@ -160,14 +149,14 @@ public:
  **********/
 
 class CpuTiAction: public actionTiHook, public CpuAction {
  **********/
 
 class CpuTiAction: public actionTiHook, public CpuAction {
-  friend CpuActionPtr CpuTi::execute(double size);
-  friend CpuActionPtr CpuTi::sleep(double duration);
+  friend CpuAction *CpuTi::execute(double size);
+  friend CpuAction *CpuTi::sleep(double duration);
   friend void CpuTi::updateActionsFinishTime(double now);//FIXME
   friend void CpuTi::updateRemainingAmount(double now);//FIXME
 
 public:
   friend void CpuTi::updateActionsFinishTime(double now);//FIXME
   friend void CpuTi::updateRemainingAmount(double now);//FIXME
 
 public:
-  CpuTiAction(CpuTiModelPtr model, double cost, bool failed,
-                                CpuTiPtr cpu);
+  CpuTiAction(CpuTiModel *model, double cost, bool failed,
+                                CpuTi *cpu);
 
   void setState(e_surf_action_state_t state);
   int unref();
 
   void setState(e_surf_action_state_t state);
   int unref();
@@ -180,9 +169,9 @@ public:
   void setMaxDuration(double duration);
   void setPriority(double priority);
   double getRemains();
   void setMaxDuration(double duration);
   void setPriority(double priority);
   double getRemains();
-  void setAffinity(CpuPtr /*cpu*/, unsigned long /*mask*/) {};
+  void setAffinity(Cpu */*cpu*/, unsigned long /*mask*/) {};
 
 
-  CpuTiPtr p_cpu;
+  CpuTi *p_cpu;
   int m_indexHeap;
   int m_suspended;
 private:
   int m_indexHeap;
   int m_suspended;
 private:
index 0a34da9..345fd1a 100644 (file)
@@ -28,7 +28,7 @@ void surf_host_model_init_current_default(void)
   surf_network_model_init_LegrandVelho();
   surf_host_model->p_cpuModel = surf_cpu_model_pm;
 
   surf_network_model_init_LegrandVelho();
   surf_host_model->p_cpuModel = surf_cpu_model_pm;
 
-  ModelPtr model = surf_host_model;
+  Model *model = surf_host_model;
   xbt_dynar_push(model_list, &model);
   xbt_dynar_push(model_list_invoke, &model);
   sg_platf_host_add_cb(host_parse_init);
   xbt_dynar_push(model_list, &model);
   xbt_dynar_push(model_list_invoke, &model);
   sg_platf_host_add_cb(host_parse_init);
@@ -41,7 +41,7 @@ void surf_host_model_init_compound()
   xbt_assert(surf_network_model, "No network model defined yet!");
   surf_host_model = new HostCLM03Model();
 
   xbt_assert(surf_network_model, "No network model defined yet!");
   surf_host_model = new HostCLM03Model();
 
-  ModelPtr model = surf_host_model;
+  Model *model = surf_host_model;
   xbt_dynar_push(model_list, &model);
   xbt_dynar_push(model_list_invoke, &model);
   sg_platf_host_add_cb(host_parse_init);
   xbt_dynar_push(model_list, &model);
   xbt_dynar_push(model_list_invoke, &model);
   sg_platf_host_add_cb(host_parse_init);
@@ -55,9 +55,9 @@ HostCLM03Model::HostCLM03Model()
 HostCLM03Model::~HostCLM03Model()
 {}
 
 HostCLM03Model::~HostCLM03Model()
 {}
 
-HostPtr HostCLM03Model::createHost(const char *name){
+Host *HostCLM03Model::createHost(const char *name){
   sg_host_t sg_host = sg_host_by_name(name);
   sg_host_t sg_host = sg_host_by_name(name);
-  HostPtr host = new HostCLM03(surf_host_model, name, NULL,
+  Host *host = new HostCLM03(surf_host_model, name, NULL,
                  (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
                  sg_host_edge(sg_host),
                  sg_host_surfcpu(sg_host));
                  (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
                  sg_host_edge(sg_host),
                  sg_host_surfcpu(sg_host));
@@ -94,20 +94,20 @@ void HostCLM03Model::updateActionsState(double /*now*/, double /*delta*/){
   return;
 }
 
   return;
 }
 
-ActionPtr HostCLM03Model::executeParallelTask(int host_nb,
+Action *HostCLM03Model::executeParallelTask(int host_nb,
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
                                         double rate){
 #define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
                                         double rate){
 #define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
-  ActionPtr action =NULL;
+  Action *action =NULL;
   if ((host_nb == 1)
       && (cost_or_zero(bytes_amount, 0) == 0.0)){
   if ((host_nb == 1)
       && (cost_or_zero(bytes_amount, 0) == 0.0)){
-    action = ((HostCLM03Ptr)host_list[0])->execute(flops_amount[0]);
+    action = static_cast<HostCLM03*>(host_list[0])->execute(flops_amount[0]);
   } else if ((host_nb == 1)
            && (cost_or_zero(flops_amount, 0) == 0.0)) {
   } else if ((host_nb == 1)
            && (cost_or_zero(flops_amount, 0) == 0.0)) {
-    action = communicate((HostCLM03Ptr)host_list[0],
-        (HostCLM03Ptr)host_list[0],bytes_amount[0], rate);
+    action = communicate(static_cast<HostCLM03*>(host_list[0]),
+               static_cast<HostCLM03*>(host_list[0]),bytes_amount[0], rate);
   } else if ((host_nb == 2)
              && (cost_or_zero(flops_amount, 0) == 0.0)
              && (cost_or_zero(flops_amount, 1) == 0.0)) {
   } else if ((host_nb == 2)
              && (cost_or_zero(flops_amount, 0) == 0.0)
              && (cost_or_zero(flops_amount, 1) == 0.0)) {
@@ -121,17 +121,17 @@ ActionPtr HostCLM03Model::executeParallelTask(int host_nb,
       }
     }
     if (nb == 1){
       }
     }
     if (nb == 1){
-      action = communicate((HostCLM03Ptr)host_list[0],
-          (HostCLM03Ptr)host_list[1],value, rate);
+      action = communicate(static_cast<HostCLM03*>(host_list[0]),
+                 static_cast<HostCLM03*>(host_list[1]),value, rate);
     }
   } else
     THROW_UNIMPLEMENTED;      /* This model does not implement parallel tasks */
 #undef cost_or_zero
     }
   } else
     THROW_UNIMPLEMENTED;      /* This model does not implement parallel tasks */
 #undef cost_or_zero
-  xbt_free((HostCLM03Ptr)host_list);
+  xbt_free(host_list);
   return action;
 }
 
   return action;
 }
 
-ActionPtr HostCLM03Model::communicate(HostPtr src, HostPtr dst, double size, double rate){
+Action *HostCLM03Model::communicate(Host *src, Host *dst, double size, double rate){
   return surf_network_model->communicate(src->p_netElm, dst->p_netElm, size, rate);
 }
 
   return surf_network_model->communicate(src->p_netElm, dst->p_netElm, size, rate);
 }
 
@@ -140,7 +140,7 @@ ActionPtr HostCLM03Model::communicate(HostPtr src, HostPtr dst, double size, dou
 /************
  * Resource *
  ************/
 /************
  * Resource *
  ************/
-HostCLM03::HostCLM03(HostModelPtr model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu)
+HostCLM03::HostCLM03(HostModel *model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu)
   : Host(model, name, properties, storage, netElm, cpu) {}
 
 bool HostCLM03::isUsed(){
   : Host(model, name, properties, storage, netElm, cpu) {}
 
 bool HostCLM03::isUsed(){
@@ -152,11 +152,11 @@ void HostCLM03::updateState(tmgr_trace_event_t /*event_type*/, double /*value*/,
   THROW_IMPOSSIBLE;             /* This model does not implement parallel tasks */
 }
 
   THROW_IMPOSSIBLE;             /* This model does not implement parallel tasks */
 }
 
-ActionPtr HostCLM03::execute(double size) {
+Action *HostCLM03::execute(double size) {
   return p_cpu->execute(size);
 }
 
   return p_cpu->execute(size);
 }
 
-ActionPtr HostCLM03::sleep(double duration) {
+Action *HostCLM03::sleep(double duration) {
   return p_cpu->sleep(duration);
 }
 
   return p_cpu->sleep(duration);
 }
 
index b362a72..3a935eb 100644 (file)
  ***********/
 
 class HostCLM03Model;
  ***********/
 
 class HostCLM03Model;
-typedef HostCLM03Model *HostCLM03ModelPtr;
-
 class HostCLM03;
 class HostCLM03;
-typedef HostCLM03 *HostCLM03Ptr;
-
 class HostCLM03Action;
 class HostCLM03Action;
-typedef HostCLM03Action *HostCLM03ActionPtr;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -33,17 +28,17 @@ class HostCLM03Model : public HostModel {
 public:
   HostCLM03Model();
   ~HostCLM03Model();
 public:
   HostCLM03Model();
   ~HostCLM03Model();
-  HostPtr createHost(const char *name);
+  Host *createHost(const char *name);
   double shareResources(double now);
 
   void updateActionsState(double now, double delta);
 
   double shareResources(double now);
 
   void updateActionsState(double now, double delta);
 
-  ActionPtr executeParallelTask(int host_nb,
+  Action *executeParallelTask(int host_nb,
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
                                         double rate);
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
                                         double rate);
- ActionPtr communicate(HostPtr src, HostPtr dst, double size, double rate);
+ Action *communicate(Host *src, Host *dst, double size, double rate);
 };
 
 /************
 };
 
 /************
@@ -52,12 +47,12 @@ public:
 
 class HostCLM03 : public Host {
 public:
 
 class HostCLM03 : public Host {
 public:
-  HostCLM03(HostModelPtr model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu);
+  HostCLM03(HostModel *model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu);
 
   void updateState(tmgr_trace_event_t event_type, double value, double date);
 
 
   void updateState(tmgr_trace_event_t event_type, double value, double date);
 
-  virtual ActionPtr execute(double size);
-  virtual ActionPtr sleep(double duration);
+  virtual Action *execute(double size);
+  virtual Action *sleep(double duration);
   e_surf_resource_state_t getState();
 
   bool isUsed();
   e_surf_resource_state_t getState();
 
   bool isUsed();
index 40ba2fa..99ce613 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf,
                                 "Logging specific to the SURF host module");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf,
                                 "Logging specific to the SURF host module");
 
-HostModelPtr surf_host_model = NULL;
+HostModel *surf_host_model = NULL;
 
 /*************
  * Callbacks *
  *************/
 
 
 /*************
  * Callbacks *
  *************/
 
-surf_callback(void, HostPtr) hostCreatedCallbacks;
-surf_callback(void, HostPtr) hostDestructedCallbacks;
-surf_callback(void, HostPtr, e_surf_resource_state_t, e_surf_resource_state_t) hostStateChangedCallbacks;
-surf_callback(void, HostActionPtr, e_surf_action_state_t, e_surf_action_state_t) hostActionStateChangedCallbacks;
+surf_callback(void, Host*) hostCreatedCallbacks;
+surf_callback(void, Host*) hostDestructedCallbacks;
+surf_callback(void, Host*, e_surf_resource_state_t, e_surf_resource_state_t) hostStateChangedCallbacks;
+surf_callback(void, HostAction*, e_surf_action_state_t, e_surf_action_state_t) hostActionStateChangedCallbacks;
 
 void host_parse_init(sg_platf_host_cbarg_t host)
 {
 
 void host_parse_init(sg_platf_host_cbarg_t host)
 {
@@ -64,8 +64,8 @@ void HostModel::adjustWeightOfDummyCpuActions()
          VMModel::ws_vms.begin();
        iter !=  VMModel::ws_vms.end(); ++iter) {
 
          VMModel::ws_vms.begin();
        iter !=  VMModel::ws_vms.end(); ++iter) {
 
-    VMPtr ws_vm = &*iter;
-    CpuCas01Ptr cpu_cas01 = static_cast<CpuCas01Ptr>(ws_vm->p_cpu);
+    VM *ws_vm = &*iter;
+    CpuCas01 *cpu_cas01 = static_cast<CpuCas01*>(ws_vm->p_cpu);
     xbt_assert(cpu_cas01, "cpu-less host");
 
     int is_active = lmm_constraint_used(cpu_cas01->getModel()->getMaxminSystem(), cpu_cas01->getConstraint());
     xbt_assert(cpu_cas01, "cpu-less host");
 
     int is_active = lmm_constraint_used(cpu_cas01->getModel()->getMaxminSystem(), cpu_cas01->getConstraint());
@@ -91,8 +91,8 @@ void HostModel::adjustWeightOfDummyCpuActions()
 /************
  * Resource *
  ************/
 /************
  * Resource *
  ************/
-Host::Host(ModelPtr model, const char *name, xbt_dict_t props,
-                                xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu)
+Host::Host(Model *model, const char *name, xbt_dict_t props,
+                                xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu)
  : Resource(model, name, props)
  , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
 {
  : Resource(model, name, props)
  , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
 {
@@ -100,8 +100,8 @@ Host::Host(ModelPtr model, const char *name, xbt_dict_t props,
   surf_callback_emit(hostCreatedCallbacks, this);
 }
 
   surf_callback_emit(hostCreatedCallbacks, this);
 }
 
-Host::Host(ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint,
-                                        xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu)
+Host::Host(Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint,
+                                        xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu)
  : Resource(model, name, props, constraint)
  , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
 {
  : Resource(model, name, props, constraint)
  , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
 {
@@ -161,9 +161,9 @@ xbt_dict_t Host::getProperties()
   return p_cpu->getProperties();
 }
 
   return p_cpu->getProperties();
 }
 
-StoragePtr Host::findStorageOnMountList(const char* mount)
+Storage *Host::findStorageOnMountList(const char* mount)
 {
 {
-  StoragePtr st = NULL;
+  Storage *st = NULL;
   s_mount_t mnt;
   unsigned int cursor;
 
   s_mount_t mnt;
   unsigned int cursor;
 
@@ -172,7 +172,7 @@ StoragePtr Host::findStorageOnMountList(const char* mount)
   {
     XBT_DEBUG("See '%s'",mnt.name);
     if(!strcmp(mount,mnt.name)){
   {
     XBT_DEBUG("See '%s'",mnt.name);
     if(!strcmp(mount,mnt.name)){
-      st = static_cast<StoragePtr>(mnt.storage);
+      st = static_cast<Storage*>(mnt.storage);
       break;
     }
   }
       break;
     }
   }
@@ -188,7 +188,7 @@ xbt_dict_t Host::getMountedStorageList()
   char *storage_name = NULL;
 
   xbt_dynar_foreach(p_storage,i,mnt){
   char *storage_name = NULL;
 
   xbt_dynar_foreach(p_storage,i,mnt){
-    storage_name = (char *)static_cast<StoragePtr>(mnt.storage)->getName();
+    storage_name = (char *)static_cast<Storage*>(mnt.storage)->getName();
     xbt_dict_set(storage_list,mnt.name,storage_name,NULL);
   }
   return storage_list;
     xbt_dict_set(storage_list,mnt.name,storage_name,NULL);
   }
   return storage_list;
@@ -202,7 +202,7 @@ xbt_dynar_t Host::getAttachedStorageList()
   xbt_dynar_t result = xbt_dynar_new(sizeof(void*), NULL);
   xbt_lib_foreach(storage_lib, cursor, key, data) {
     if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
   xbt_dynar_t result = xbt_dynar_new(sizeof(void*), NULL);
   xbt_lib_foreach(storage_lib, cursor, key, data) {
     if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
-         StoragePtr storage = static_cast<StoragePtr>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
+         Storage *storage = static_cast<Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
          if(!strcmp((const char*)storage->p_attach,this->getName())){
            xbt_dynar_push_as(result, void *, (void*)storage->getName());
          }
          if(!strcmp((const char*)storage->p_attach,this->getName())){
            xbt_dynar_push_as(result, void *, (void*)storage->getName());
          }
@@ -211,9 +211,9 @@ xbt_dynar_t Host::getAttachedStorageList()
   return result;
 }
 
   return result;
 }
 
-ActionPtr Host::open(const char* fullpath) {
+Action *Host::open(const char* fullpath) {
 
 
-  StoragePtr st = NULL;
+  Storage *st = NULL;
   s_mount_t mnt;
   unsigned int cursor;
   size_t longest_prefix_length = 0;
   s_mount_t mnt;
   unsigned int cursor;
   size_t longest_prefix_length = 0;
@@ -232,7 +232,7 @@ ActionPtr Host::open(const char* fullpath) {
     if(!strcmp(file_mount_name,mnt.name) && strlen(mnt.name)>longest_prefix_length)
     {/* The current mount name is found in the full path and is bigger than the previous*/
       longest_prefix_length = strlen(mnt.name);
     if(!strcmp(file_mount_name,mnt.name) && strlen(mnt.name)>longest_prefix_length)
     {/* The current mount name is found in the full path and is bigger than the previous*/
       longest_prefix_length = strlen(mnt.name);
-      st = static_cast<StoragePtr>(mnt.storage);
+      st = static_cast<Storage*>(mnt.storage);
     }
     free(file_mount_name);
   }
     }
     free(file_mount_name);
   }
@@ -249,26 +249,26 @@ ActionPtr Host::open(const char* fullpath) {
     xbt_die("Can't find mount point for '%s' on '%s'", fullpath, getName());
 
   XBT_DEBUG("OPEN %s on disk '%s'",path, st->getName());
     xbt_die("Can't find mount point for '%s' on '%s'", fullpath, getName());
 
   XBT_DEBUG("OPEN %s on disk '%s'",path, st->getName());
-  ActionPtr action = st->open((const char*)mount_name, (const char*)path);
+  Action *action = st->open((const char*)mount_name, (const char*)path);
   free((char*)path);
   free((char*)mount_name);
   return action;
 }
 
   free((char*)path);
   free((char*)mount_name);
   return action;
 }
 
-ActionPtr Host::close(surf_file_t fd) {
-  StoragePtr st = findStorageOnMountList(fd->mount);
+Action *Host::close(surf_file_t fd) {
+  Storage *st = findStorageOnMountList(fd->mount);
   XBT_DEBUG("CLOSE %s on disk '%s'",fd->name, st->getName());
   return st->close(fd);
 }
 
   XBT_DEBUG("CLOSE %s on disk '%s'",fd->name, st->getName());
   return st->close(fd);
 }
 
-ActionPtr Host::read(surf_file_t fd, sg_size_t size) {
-  StoragePtr st = findStorageOnMountList(fd->mount);
+Action *Host::read(surf_file_t fd, sg_size_t size) {
+  Storage *st = findStorageOnMountList(fd->mount);
   XBT_DEBUG("READ %s on disk '%s'",fd->name, st->getName());
   return st->read(fd, size);
 }
 
   XBT_DEBUG("READ %s on disk '%s'",fd->name, st->getName());
   return st->read(fd, size);
 }
 
-ActionPtr Host::write(surf_file_t fd, sg_size_t size) {
-  StoragePtr st = findStorageOnMountList(fd->mount);
+Action *Host::write(surf_file_t fd, sg_size_t size) {
+  Storage *st = findStorageOnMountList(fd->mount);
   XBT_DEBUG("WRITE %s on disk '%s'",fd->name, st->getName());
   return st->write(fd, size);
 }
   XBT_DEBUG("WRITE %s on disk '%s'",fd->name, st->getName());
   return st->write(fd, size);
 }
@@ -279,7 +279,7 @@ int Host::unlink(surf_file_t fd) {
     return -1;
   } else {
 
     return -1;
   } else {
 
-    StoragePtr st = findStorageOnMountList(fd->mount);
+    Storage *st = findStorageOnMountList(fd->mount);
     /* Check if the file is on this storage */
     if (!xbt_dict_get_or_null(st->p_content, fd->name)){
       XBT_WARN("File %s is not on disk %s. Impossible to unlink", fd->name,
     /* Check if the file is on this storage */
     if (!xbt_dict_get_or_null(st->p_content, fd->name)){
       XBT_WARN("File %s is not on disk %s. Impossible to unlink", fd->name,
@@ -306,7 +306,7 @@ sg_size_t Host::getSize(surf_file_t fd){
 
 xbt_dynar_t Host::getInfo( surf_file_t fd)
 {
 
 xbt_dynar_t Host::getInfo( surf_file_t fd)
 {
-  StoragePtr st = findStorageOnMountList(fd->mount);
+  Storage *st = findStorageOnMountList(fd->mount);
   sg_size_t *psize = xbt_new(sg_size_t, 1);
   *psize = fd->size;
   xbt_dynar_t info = xbt_dynar_new(sizeof(void*), NULL);
   sg_size_t *psize = xbt_new(sg_size_t, 1);
   *psize = fd->size;
   xbt_dynar_t info = xbt_dynar_new(sizeof(void*), NULL);
@@ -372,14 +372,14 @@ int Host::fileMove(surf_file_t fd, const char* fullpath){
 
 xbt_dynar_t Host::getVms()
 {
 
 xbt_dynar_t Host::getVms()
 {
-  xbt_dynar_t dyn = xbt_dynar_new(sizeof(VMPtr), NULL);
+  xbt_dynar_t dyn = xbt_dynar_new(sizeof(VM*), NULL);
 
   /* iterate for all virtual machines */
   for (VMModel::vm_list_t::iterator iter =
          VMModel::ws_vms.begin();
        iter !=  VMModel::ws_vms.end(); ++iter) {
 
 
   /* iterate for all virtual machines */
   for (VMModel::vm_list_t::iterator iter =
          VMModel::ws_vms.begin();
        iter !=  VMModel::ws_vms.end(); ++iter) {
 
-    VMPtr ws_vm = &*iter;
+    VM *ws_vm = &*iter;
     if (this == ws_vm->p_subWs)
       xbt_dynar_push(dyn, &ws_vm);
   }
     if (this == ws_vm->p_subWs)
       xbt_dynar_push(dyn, &ws_vm);
   }
index 4fcfa43..5752a64 100644 (file)
  ***********/
 
 class HostModel;
  ***********/
 
 class HostModel;
-typedef HostModel *HostModelPtr;
-
 class Host;
 class Host;
-typedef Host *HostPtr;
-
 class HostAction;
 class HostAction;
-typedef HostAction *HostActionPtr;
 
 /*************
  * Callbacks *
 
 /*************
  * Callbacks *
@@ -33,30 +28,30 @@ typedef HostAction *HostActionPtr;
  * @brief Callbacks handler which emit the callbacks after Host creation *
  * @details Callback functions have the following signature: `void(HostPtr)`
  */
  * @brief Callbacks handler which emit the callbacks after Host creation *
  * @details Callback functions have the following signature: `void(HostPtr)`
  */
-XBT_PUBLIC_DATA(surf_callback(void, HostPtr)) hostCreatedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, Host*)) hostCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Host destruction *
  * @details Callback functions have the following signature: `void(HostPtr)`
  */
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Host destruction *
  * @details Callback functions have the following signature: `void(HostPtr)`
  */
-XBT_PUBLIC_DATA(surf_callback(void, HostPtr)) hostDestructedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, Host*)) hostDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Host State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Host State changed *
- * @details Callback functions have the following signature: `void(HostActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @details Callback functions have the following signature: `void(HostAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
  */
-XBT_PUBLIC_DATA(surf_callback(void, HostPtr, e_surf_resource_state_t, e_surf_resource_state_t)) hostStateChangedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, Host*, e_surf_resource_state_t, e_surf_resource_state_t)) hostStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after HostAction State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after HostAction State changed *
- * @details Callback functions have the following signature: `void(HostActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @details Callback functions have the following signature: `void(HostAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
  */
-XBT_PUBLIC_DATA(surf_callback(void, HostActionPtr, e_surf_action_state_t, e_surf_action_state_t)) hostActionStateChangedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, HostAction*, e_surf_action_state_t, e_surf_action_state_t)) hostActionStateChangedCallbacks;
 
 /*********
  * Tools *
  *********/
 
 /*********
  * Tools *
  *********/
-XBT_PUBLIC_DATA(HostModelPtr) surf_host_model;
+XBT_PUBLIC_DATA(HostModel*) surf_host_model;
 XBT_PUBLIC(void) host_parse_init(sg_platf_host_cbarg_t host);
 XBT_PUBLIC(void) host_add_traces();
 
 XBT_PUBLIC(void) host_parse_init(sg_platf_host_cbarg_t host);
 XBT_PUBLIC(void) host_add_traces();
 
@@ -82,7 +77,7 @@ public:
   /** @brief HostModel destructor */
   ~HostModel();
 
   /** @brief HostModel destructor */
   ~HostModel();
 
-  virtual HostPtr createHost(const char *name)=0;
+  virtual Host *createHost(const char *name)=0;
   void addTraces(){DIE_IMPOSSIBLE;}
 
   /**
   void addTraces(){DIE_IMPOSSIBLE;}
 
   /**
@@ -102,7 +97,7 @@ public:
    * @param rate [description]
    * @return [description]
    */
    * @param rate [description]
    * @return [description]
    */
-  virtual ActionPtr executeParallelTask(int host_nb,
+  virtual Action *executeParallelTask(int host_nb,
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
@@ -118,9 +113,9 @@ public:
   * @param rate [description]
   * @return [description]
   */
   * @param rate [description]
   * @return [description]
   */
- virtual ActionPtr communicate(HostPtr src, HostPtr dst, double size, double rate)=0;
+ virtual Action *communicate(Host *src, Host *dst, double size, double rate)=0;
 
 
- CpuModelPtr p_cpuModel;
+ CpuModel *p_cpuModel;
 };
 
 /************
 };
 
 /************
@@ -142,8 +137,8 @@ public:
    * @param netElm The RoutingEdge associated to this Host
    * @param cpu The Cpu associated to this Host
    */
    * @param netElm The RoutingEdge associated to this Host
    * @param cpu The Cpu associated to this Host
    */
-  Host(ModelPtr model, const char *name, xbt_dict_t props,
-                     xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu);
+  Host(Model *model, const char *name, xbt_dict_t props,
+                     xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu);
 
   /**
    * @brief Host constructor
 
   /**
    * @brief Host constructor
@@ -156,9 +151,9 @@ public:
    * @param netElm The RoutingEdge associated to this Host
    * @param cpu The Cpu associated to this Host
    */
    * @param netElm The RoutingEdge associated to this Host
    * @param cpu The Cpu associated to this Host
    */
-  Host(ModelPtr model, const char *name, xbt_dict_t props,
-      lmm_constraint_t constraint, xbt_dynar_t storage, RoutingEdgePtr netElm,
-      CpuPtr cpu);
+  Host(Model *model, const char *name, xbt_dict_t props,
+      lmm_constraint_t constraint, xbt_dynar_t storage, RoutingEdge *netElm,
+      Cpu *cpu);
 
   /** @brief Host destructor */
   ~ Host();
 
   /** @brief Host destructor */
   ~ Host();
@@ -179,7 +174,7 @@ public:
    * @return The CpuAction corresponding to the processing
    * @see Cpu
    */
    * @return The CpuAction corresponding to the processing
    * @see Cpu
    */
-  virtual ActionPtr execute(double flops_amount)=0;
+  virtual Action *execute(double flops_amount)=0;
 
   /**
    * @brief Make a process sleep for duration seconds
 
   /**
    * @brief Make a process sleep for duration seconds
@@ -188,7 +183,7 @@ public:
    * @return The CpuAction corresponding to the sleeping
    * @see Cpu
    */
    * @return The CpuAction corresponding to the sleeping
    * @see Cpu
    */
-  virtual ActionPtr sleep(double duration)=0;
+  virtual Action *sleep(double duration)=0;
 
   /**
    * @brief Get the number of cores of the associated Cpu
 
   /**
    * @brief Get the number of cores of the associated Cpu
@@ -235,7 +230,7 @@ public:
    * @param storage The mount point
    * @return The corresponding Storage
    */
    * @param storage The mount point
    * @return The corresponding Storage
    */
-  virtual StoragePtr findStorageOnMountList(const char* storage);
+  virtual Storage *findStorageOnMountList(const char* storage);
 
   /**
    * @brief Get the xbt_dict_t of mount_point: Storage
 
   /**
    * @brief Get the xbt_dict_t of mount_point: Storage
@@ -258,7 +253,7 @@ public:
    *
    * @return The StorageAction corresponding to the opening
    */
    *
    * @return The StorageAction corresponding to the opening
    */
-  virtual ActionPtr open(const char* fullpath);
+  virtual Action *open(const char* fullpath);
 
   /**
    * @brief Close a file
 
   /**
    * @brief Close a file
@@ -266,7 +261,7 @@ public:
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
-  virtual ActionPtr close(surf_file_t fd);
+  virtual Action *close(surf_file_t fd);
 
   /**
    * @brief Unlink a file
 
   /**
    * @brief Unlink a file
@@ -292,7 +287,7 @@ public:
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
    */
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
    */
-  virtual ActionPtr read(surf_file_t fd, sg_size_t size);
+  virtual Action *read(surf_file_t fd, sg_size_t size);
 
   /**
    * @brief Write a file
 
   /**
    * @brief Write a file
@@ -301,7 +296,7 @@ public:
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
    */
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
    */
-  virtual ActionPtr write(surf_file_t fd, sg_size_t size);
+  virtual Action *write(surf_file_t fd, sg_size_t size);
 
   /**
    * @brief Get the informations of a file descriptor
 
   /**
    * @brief Get the informations of a file descriptor
@@ -351,8 +346,8 @@ public:
   virtual int fileMove(surf_file_t fd, const char* fullpath);
 
   xbt_dynar_t p_storage;
   virtual int fileMove(surf_file_t fd, const char* fullpath);
 
   xbt_dynar_t p_storage;
-  RoutingEdgePtr p_netElm;
-  CpuPtr p_cpu;
+  RoutingEdge *p_netElm;
+  Cpu *p_cpu;
 
   /**
    * @brief Get the list of virtual machines on the current Host
 
   /**
    * @brief Get the list of virtual machines on the current Host
@@ -396,7 +391,7 @@ public:
    * @param cost The cost of this HostAction in [TODO]
    * @param failed [description]
    */
    * @param cost The cost of this HostAction in [TODO]
    * @param failed [description]
    */
-  HostAction(ModelPtr model, double cost, bool failed)
+  HostAction(Model *model, double cost, bool failed)
   : Action(model, cost, failed) {}
 
   /**
   : Action(model, cost, failed) {}
 
   /**
@@ -407,7 +402,7 @@ public:
    * @param failed [description]
    * @param var The lmm variable associated to this StorageAction if it is part of a LMM component
    */
    * @param failed [description]
    * @param var The lmm variable associated to this StorageAction if it is part of a LMM component
    */
-  HostAction(ModelPtr model, double cost, bool failed, lmm_variable_t var)
+  HostAction(Model *model, double cost, bool failed, lmm_variable_t var)
   : Action(model, cost, failed, var) {}
 
   void setState(e_surf_action_state_t state);
   : Action(model, cost, failed, var) {}
 
   void setState(e_surf_action_state_t state);
index d0a6c51..ea1518c 100644 (file)
@@ -41,7 +41,7 @@ void surf_host_model_init_ptask_L07(void)
   xbt_assert(!surf_network_model, "network model type already defined");
   ptask_define_callbacks();
   surf_host_model = new HostL07Model();
   xbt_assert(!surf_network_model, "network model type already defined");
   ptask_define_callbacks();
   surf_host_model = new HostL07Model();
-  ModelPtr model = surf_host_model;
+  Model *model = surf_host_model;
   xbt_dynar_push(model_list, &model);
   xbt_dynar_push(model_list_invoke, &model);
 }
   xbt_dynar_push(model_list, &model);
   xbt_dynar_push(model_list_invoke, &model);
 }
@@ -77,16 +77,16 @@ HostL07Model::~HostL07Model() {
 
 double HostL07Model::shareResources(double /*now*/)
 {
 
 double HostL07Model::shareResources(double /*now*/)
 {
-  HostL07ActionPtr action;
+  HostL07Action *action;
 
 
-  ActionListPtr running_actions = getRunningActionSet();
+  ActionList *running_actions = getRunningActionSet();
   double min = this->shareResourcesMaxMin(running_actions,
                                               ptask_maxmin_system,
                                               bottleneck_solve);
 
   for(ActionList::iterator it(running_actions->begin()), itend(running_actions->end())
         ; it != itend ; ++it) {
   double min = this->shareResourcesMaxMin(running_actions,
                                               ptask_maxmin_system,
                                               bottleneck_solve);
 
   for(ActionList::iterator it(running_actions->begin()), itend(running_actions->end())
         ; it != itend ; ++it) {
-       action = static_cast<HostL07ActionPtr>(&*it);
+       action = static_cast<HostL07Action*>(&*it);
     if (action->m_latency > 0) {
       if (min < 0) {
         min = action->m_latency;
     if (action->m_latency > 0) {
       if (min < 0) {
         min = action->m_latency;
@@ -108,14 +108,14 @@ double HostL07Model::shareResources(double /*now*/)
 void HostL07Model::updateActionsState(double /*now*/, double delta)
 {
   double deltap = 0.0;
 void HostL07Model::updateActionsState(double /*now*/, double delta)
 {
   double deltap = 0.0;
-  HostL07ActionPtr action;
+  HostL07Action *action;
 
 
-  ActionListPtr actionSet = getRunningActionSet();
+  ActionList *actionSet = getRunningActionSet();
 
   for(ActionList::iterator it(actionSet->begin()), itNext = it, itend(actionSet->end())
         ; it != itend ; it=itNext) {
        ++itNext;
 
   for(ActionList::iterator it(actionSet->begin()), itNext = it, itend(actionSet->end())
         ; it != itend ; it=itNext) {
        ++itNext;
-    action = static_cast<HostL07ActionPtr>(&*it);
+    action = static_cast<HostL07Action*>(&*it);
     deltap = delta;
     if (action->m_latency > 0) {
       if (action->m_latency > deltap) {
     deltap = delta;
     if (action->m_latency > 0) {
       if (action->m_latency > deltap) {
@@ -157,7 +157,7 @@ void HostL07Model::updateActionsState(double /*now*/, double delta)
                                     i++))) {
         constraint_id = lmm_constraint_id(cnst);
 
                                     i++))) {
         constraint_id = lmm_constraint_id(cnst);
 
-        if (static_cast<HostPtr>(constraint_id)->getState() == SURF_RESOURCE_OFF) {
+        if (static_cast<Host*>(constraint_id)->getState() == SURF_RESOURCE_OFF) {
           XBT_DEBUG("Action (%p) Failed!!", action);
           action->finish();
           action->setState(SURF_ACTION_FAILED);
           XBT_DEBUG("Action (%p) Failed!!", action);
           action->finish();
           action->setState(SURF_ACTION_FAILED);
@@ -169,13 +169,13 @@ void HostL07Model::updateActionsState(double /*now*/, double delta)
   return;
 }
 
   return;
 }
 
-ActionPtr HostL07Model::executeParallelTask(int host_nb,
+Action *HostL07Model::executeParallelTask(int host_nb,
                                                    void **host_list,
                                                    double *flops_amount,
                                                                                                   double *bytes_amount,
                                                    double rate)
 {
                                                    void **host_list,
                                                    double *flops_amount,
                                                                                                   double *bytes_amount,
                                                    double rate)
 {
-  HostL07ActionPtr action;
+  HostL07Action *action;
   int i, j;
   unsigned int cpt;
   int nb_link = 0;
   int i, j;
   unsigned int cpt;
   int nb_link = 0;
@@ -196,16 +196,16 @@ ActionPtr HostL07Model::executeParallelTask(int host_nb,
         double lat=0.0;
         unsigned int cpt;
         void *_link;
         double lat=0.0;
         unsigned int cpt;
         void *_link;
-        LinkL07Ptr link;
+        LinkL07 *link;
 
 
-        routing_platf->getRouteAndLatency(static_cast<HostL07Ptr>(host_list[i])->p_netElm,
-                                                 static_cast<HostL07Ptr>(host_list[j])->p_netElm,
+        routing_platf->getRouteAndLatency(static_cast<HostL07*>(host_list[i])->p_netElm,
+                                                 static_cast<HostL07*>(host_list[j])->p_netElm,
                                                  &route,
                                                  &lat);
         latency = MAX(latency, lat);
 
         xbt_dynar_foreach(route, cpt, _link) {
                                                  &route,
                                                  &lat);
         latency = MAX(latency, lat);
 
         xbt_dynar_foreach(route, cpt, _link) {
-           link = static_cast<LinkL07Ptr>(_link);
+           link = static_cast<LinkL07*>(_link);
            xbt_dict_set(ptask_parallel_task_link_set, link->getName(), link, NULL);
         }
       }
            xbt_dict_set(ptask_parallel_task_link_set, link->getName(), link, NULL);
         }
       }
@@ -225,7 +225,7 @@ ActionPtr HostL07Model::executeParallelTask(int host_nb,
   action->m_suspended = 0;        /* Should be useless because of the
                                    calloc but it seems to help valgrind... */
   action->m_hostNb = host_nb;
   action->m_suspended = 0;        /* Should be useless because of the
                                    calloc but it seems to help valgrind... */
   action->m_hostNb = host_nb;
-  action->p_hostList = (HostPtr *) host_list;
+  action->p_hostList = (Host **) host_list;
   action->p_computationAmount = flops_amount;
   action->p_communicationAmount = bytes_amount;
   action->m_latency = latency;
   action->p_computationAmount = flops_amount;
   action->p_communicationAmount = bytes_amount;
   action->m_latency = latency;
@@ -240,24 +240,24 @@ ActionPtr HostL07Model::executeParallelTask(int host_nb,
 
   for (i = 0; i < host_nb; i++)
     lmm_expand(ptask_maxmin_system,
 
   for (i = 0; i < host_nb; i++)
     lmm_expand(ptask_maxmin_system,
-                static_cast<HostL07Ptr>(host_list[i])->p_cpu->getConstraint(),
+                static_cast<HostL07*>(host_list[i])->p_cpu->getConstraint(),
                action->getVariable(), flops_amount[i]);
 
   for (i = 0; i < host_nb; i++) {
     for (j = 0; j < host_nb; j++) {
       void *_link;
                action->getVariable(), flops_amount[i]);
 
   for (i = 0; i < host_nb; i++) {
     for (j = 0; j < host_nb; j++) {
       void *_link;
-      LinkL07Ptr link;
+      LinkL07 *link;
 
       xbt_dynar_t route=NULL;
       if (bytes_amount[i * host_nb + j] == 0.0)
         continue;
 
 
       xbt_dynar_t route=NULL;
       if (bytes_amount[i * host_nb + j] == 0.0)
         continue;
 
-      routing_platf->getRouteAndLatency(static_cast<HostL07Ptr>(host_list[i])->p_netElm,
-                                        static_cast<HostL07Ptr>(host_list[j])->p_netElm,
+      routing_platf->getRouteAndLatency(static_cast<HostL07*>(host_list[i])->p_netElm,
+                                        static_cast<HostL07*>(host_list[j])->p_netElm,
                                            &route, NULL);
 
       xbt_dynar_foreach(route, cpt, _link) {
                                            &route, NULL);
 
       xbt_dynar_foreach(route, cpt, _link) {
-        link = static_cast<LinkL07Ptr>(_link);
+        link = static_cast<LinkL07*>(_link);
         lmm_expand_add(ptask_maxmin_system, link->getConstraint(),
                        action->getVariable(),
                        bytes_amount[i * host_nb + j]);
         lmm_expand_add(ptask_maxmin_system, link->getConstraint(),
                        action->getVariable(),
                        bytes_amount[i * host_nb + j]);
@@ -273,9 +273,9 @@ ActionPtr HostL07Model::executeParallelTask(int host_nb,
   return action;
 }
 
   return action;
 }
 
-HostPtr HostL07Model::createHost(const char *name)
+Host *HostL07Model::createHost(const char *name)
 {
 {
-  HostL07Ptr wk = NULL;
+  HostL07 *wk = NULL;
   sg_host_t sg_host = sg_host_by_name(name);
 
   xbt_assert(!surf_host_resource_priv(sg_host),
   sg_host_t sg_host = sg_host_by_name(name);
 
   xbt_assert(!surf_host_resource_priv(sg_host),
@@ -291,13 +291,13 @@ HostPtr HostL07Model::createHost(const char *name)
   return wk;//FIXME:xbt_lib_get_elm_or_null(host_lib, name);
 }
 
   return wk;//FIXME:xbt_lib_get_elm_or_null(host_lib, name);
 }
 
-ActionPtr HostL07Model::communicate(HostPtr src, HostPtr dst,
+Action *HostL07Model::communicate(Host *src, Host *dst,
                                        double size, double rate)
 {
   void **host_list = xbt_new0(void *, 2);
   double *flops_amount = xbt_new0(double, 2);
   double *bytes_amount = xbt_new0(double, 4);
                                        double size, double rate)
 {
   void **host_list = xbt_new0(void *, 2);
   double *flops_amount = xbt_new0(double, 2);
   double *bytes_amount = xbt_new0(double, 4);
-  ActionPtr res = NULL;
+  Action *res = NULL;
 
   host_list[0] = src;
   host_list[1] = dst;
 
   host_list[0] = src;
   host_list[1] = dst;
@@ -310,14 +310,14 @@ ActionPtr HostL07Model::communicate(HostPtr src, HostPtr dst,
   return res;
 }
 
   return res;
 }
 
-xbt_dynar_t HostL07Model::getRoute(HostPtr src, HostPtr dst)
+xbt_dynar_t HostL07Model::getRoute(Host *src, Host *dst)
 {
   xbt_dynar_t route=NULL;
   routing_platf->getRouteAndLatency(src->p_netElm, dst->p_netElm, &route, NULL);
   return route;
 }
 
 {
   xbt_dynar_t route=NULL;
   routing_platf->getRouteAndLatency(src->p_netElm, dst->p_netElm, &route, NULL);
   return route;
 }
 
-CpuPtr CpuL07Model::createCpu(const char *name,  xbt_dynar_t powerPeak,
+Cpu *CpuL07Model::createCpu(const char *name,  xbt_dynar_t powerPeak,
                           int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                           int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
@@ -332,7 +332,7 @@ CpuPtr CpuL07Model::createCpu(const char *name,  xbt_dynar_t powerPeak,
               "Host '%s' declared several times in the platform file.",
               name);
 
               "Host '%s' declared several times in the platform file.",
               name);
 
-  CpuL07Ptr cpu = new CpuL07(this, name, cpu_properties,
+  CpuL07 *cpu = new CpuL07(this, name, cpu_properties,
                                     power_initial, power_scale, power_trace,
                          core, state_initial, state_trace);
 
                                     power_initial, power_scale, power_trace,
                          core, state_initial, state_trace);
 
@@ -356,7 +356,7 @@ Link* NetworkL07Model::createLink(const char *name,
                      "Link '%s' declared several times in the platform file.",
                      name);
 
                      "Link '%s' declared several times in the platform file.",
                      name);
 
-  LinkL07Ptr nw_link = new LinkL07(this, name, properties,
+  LinkL07 *nw_link = new LinkL07(this, name, properties,
                                       bw_initial, bw_trace,
                                       lat_initial, lat_trace,
                                       state_initial, state_trace,
                                       bw_initial, bw_trace,
                                       lat_initial, lat_trace,
                                       state_initial, state_trace,
@@ -376,7 +376,7 @@ void HostL07Model::addTraces()
   /* Connect traces relative to cpu */
   xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
   /* Connect traces relative to cpu */
   xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
-    CpuL07Ptr host = static_cast<CpuL07Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
+    CpuL07 *host = static_cast<CpuL07*>(sg_host_surfcpu(sg_host_by_name(elm)));
 
     xbt_assert(host, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
     xbt_assert(host, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -386,7 +386,7 @@ void HostL07Model::addTraces()
 
   xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
 
   xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
-    CpuL07Ptr host = static_cast<CpuL07Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
+    CpuL07 *host = static_cast<CpuL07*>(sg_host_surfcpu(sg_host_by_name(elm)));
 
     xbt_assert(host, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
     xbt_assert(host, "Host %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -397,7 +397,7 @@ void HostL07Model::addTraces()
   /* Connect traces relative to network */
   xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
   /* Connect traces relative to network */
   xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
-    LinkL07Ptr link = static_cast<LinkL07Ptr>(Link::byName(elm));
+    LinkL07 *link = static_cast<LinkL07*>(Link::byName(elm));
 
     xbt_assert(link, "Link %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
     xbt_assert(link, "Link %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -407,7 +407,7 @@ void HostL07Model::addTraces()
 
   xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
 
   xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
-    LinkL07Ptr link = static_cast<LinkL07Ptr>(Link::byName(elm));
+    LinkL07 *link = static_cast<LinkL07*>(Link::byName(elm));
 
     xbt_assert(link, "Link %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
     xbt_assert(link, "Link %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -417,7 +417,7 @@ void HostL07Model::addTraces()
 
   xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
 
   xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
-    LinkL07Ptr link = static_cast<LinkL07Ptr>(Link::byName(elm));
+    LinkL07 *link = static_cast<LinkL07*>(Link::byName(elm));
 
     xbt_assert(link, "Link %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
 
     xbt_assert(link, "Link %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -430,7 +430,7 @@ void HostL07Model::addTraces()
  * Resource *
  ************/
 
  * Resource *
  ************/
 
-HostL07::HostL07(HostModelPtr model, const char* name, xbt_dict_t props, RoutingEdgePtr netElm, CpuPtr cpu)
+HostL07::HostL07(HostModel *model, const char* name, xbt_dict_t props, RoutingEdge *netElm, Cpu *cpu)
   : Host(model, name, props, NULL, netElm, cpu)
 {
 }
   : Host(model, name, props, NULL, netElm, cpu)
 {
 }
@@ -460,7 +460,7 @@ double HostL07::getConsumedEnergy()
        THROW_UNIMPLEMENTED;
 }
 
        THROW_UNIMPLEMENTED;
 }
 
-CpuL07::CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t props,
+CpuL07::CpuL07(CpuL07Model *model, const char* name, xbt_dict_t props,
                     double power_initial, double power_scale, tmgr_trace_t power_trace,
                           int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace)
  : Cpu(model, name, props, lmm_constraint_new(ptask_maxmin_system, this, power_initial * power_scale),
                     double power_initial, double power_scale, tmgr_trace_t power_trace,
                           int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace)
  : Cpu(model, name, props, lmm_constraint_new(ptask_maxmin_system, this, power_initial * power_scale),
@@ -478,7 +478,7 @@ CpuL07::CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t props,
        p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this);
 }
 
        p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this);
 }
 
-LinkL07::LinkL07(NetworkL07ModelPtr model, const char* name, xbt_dict_t props,
+LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
                         double bw_initial,
                         tmgr_trace_t bw_trace,
                         double lat_initial,
                         double bw_initial,
                         tmgr_trace_t bw_trace,
                         double lat_initial,
@@ -560,7 +560,7 @@ e_surf_resource_state_t HostL07::getState()
   return p_cpu->getState();
 }
 
   return p_cpu->getState();
 }
 
-ActionPtr HostL07::execute(double size)
+Action *HostL07::execute(double size)
 {
   void **host_list = xbt_new0(void *, 1);
   double *flops_amount = xbt_new0(double, 1);
 {
   void **host_list = xbt_new0(void *, 1);
   double *flops_amount = xbt_new0(double, 1);
@@ -570,18 +570,18 @@ ActionPtr HostL07::execute(double size)
   bytes_amount[0] = 0.0;
   flops_amount[0] = size;
 
   bytes_amount[0] = 0.0;
   flops_amount[0] = size;
 
-  return static_cast<HostL07ModelPtr>(getModel())->executeParallelTask(1, host_list,
+  return static_cast<HostL07Model*>(getModel())->executeParallelTask(1, host_list,
                                              flops_amount,
                                      bytes_amount, -1);
 }
 
                                              flops_amount,
                                      bytes_amount, -1);
 }
 
-ActionPtr HostL07::sleep(double duration)
+Action *HostL07::sleep(double duration)
 {
 {
-  HostL07ActionPtr action = NULL;
+  HostL07Action *action = NULL;
 
   XBT_IN("(%s,%g)", getName(), duration);
 
 
   XBT_IN("(%s,%g)", getName(), duration);
 
-  action = static_cast<HostL07ActionPtr>(execute(1.0));
+  action = static_cast<HostL07Action*>(execute(1.0));
   action->m_maxDuration = duration;
   action->m_suspended = 2;
   lmm_update_variable_weight(ptask_maxmin_system, action->getVariable(), 0.0);
   action->m_maxDuration = duration;
   action->m_suspended = 2;
   lmm_update_variable_weight(ptask_maxmin_system, action->getVariable(), 0.0);
@@ -609,12 +609,12 @@ double LinkL07::getLatency()
 void LinkL07::updateLatency(double value, double date)
 {
   lmm_variable_t var = NULL;
 void LinkL07::updateLatency(double value, double date)
 {
   lmm_variable_t var = NULL;
-  HostL07ActionPtr action;
+  HostL07Action *action;
   lmm_element_t elem = NULL;
 
   m_latCurrent = value;
   while ((var = lmm_get_var_from_cnst(ptask_maxmin_system, getConstraint(), &elem))) {
   lmm_element_t elem = NULL;
 
   m_latCurrent = value;
   while ((var = lmm_get_var_from_cnst(ptask_maxmin_system, getConstraint(), &elem))) {
-    action = (HostL07ActionPtr) lmm_variable_id(var);
+    action = static_cast<HostL07Action*>(lmm_variable_id(var));
     action->updateBound();
   }
 }
     action->updateBound();
   }
 }
@@ -647,8 +647,8 @@ void HostL07Action::updateBound()
 
       if (p_communicationAmount[i * m_hostNb + j] > 0) {
         double lat = 0.0;
 
       if (p_communicationAmount[i * m_hostNb + j] > 0) {
         double lat = 0.0;
-        routing_platf->getRouteAndLatency(static_cast<HostL07Ptr>(((void**)p_hostList)[i])->p_netElm,
-                                          static_cast<HostL07Ptr>(((void**)p_hostList)[j])->p_netElm,
+        routing_platf->getRouteAndLatency(static_cast<HostL07*>(((void**)p_hostList)[i])->p_netElm,
+                                          static_cast<HostL07*>(((void**)p_hostList)[j])->p_netElm,
                                                          &route, &lat);
 
         lat_current = MAX(lat_current, lat * p_communicationAmount[i * m_hostNb + j]);
                                                          &route, &lat);
 
         lat_current = MAX(lat_current, lat * p_communicationAmount[i * m_hostNb + j]);
index 93038d3..dc91dc1 100644 (file)
  ***********/
 
 class HostL07Model;
  ***********/
 
 class HostL07Model;
-typedef HostL07Model *HostL07ModelPtr;
-
 class CpuL07Model;
 class CpuL07Model;
-typedef CpuL07Model *CpuL07ModelPtr;
-
 class NetworkL07Model;
 class NetworkL07Model;
-typedef NetworkL07Model *NetworkL07ModelPtr;
 
 class HostL07;
 
 class HostL07;
-typedef HostL07 *HostL07Ptr;
-
 class CpuL07;
 class CpuL07;
-typedef CpuL07 *CpuL07Ptr;
-
 class LinkL07;
 class LinkL07;
-typedef LinkL07 *LinkL07Ptr;
 
 class HostL07Action;
 
 class HostL07Action;
-typedef HostL07Action *HostL07ActionPtr;
 
 /*********
  * Tools *
 
 /*********
  * Tools *
@@ -48,23 +37,23 @@ public:
 
   double shareResources(double now);
   void updateActionsState(double now, double delta);
 
   double shareResources(double now);
   void updateActionsState(double now, double delta);
-  HostPtr createHost(const char *name);
-  ActionPtr executeParallelTask(int host_nb,
+  Host *createHost(const char *name);
+  Action *executeParallelTask(int host_nb,
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
                                         double rate);
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
                                         double rate);
-  xbt_dynar_t getRoute(HostPtr src, HostPtr dst);
-  ActionPtr communicate(HostPtr src, HostPtr dst, double size, double rate);
+  xbt_dynar_t getRoute(Host *src, Host *dst);
+  Action *communicate(Host *src, Host *dst, double size, double rate);
   void addTraces();
   void addTraces();
-  NetworkModelPtr p_networkModel;
+  NetworkModel *p_networkModel;
 };
 
 class CpuL07Model : public CpuModel {
 public:
   CpuL07Model() : CpuModel("cpuL07") {};
   ~CpuL07Model() {surf_cpu_model_pm = NULL;};
 };
 
 class CpuL07Model : public CpuModel {
 public:
   CpuL07Model() : CpuModel("cpuL07") {};
   ~CpuL07Model() {surf_cpu_model_pm = NULL;};
-  CpuPtr createCpu(const char *name,  xbt_dynar_t powerPeak,
+  Cpu *createCpu(const char *name,  xbt_dynar_t powerPeak,
                           int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                           int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
@@ -72,7 +61,7 @@ public:
                           xbt_dict_t cpu_properties);
   void addTraces() {DIE_IMPOSSIBLE;};
 
                           xbt_dict_t cpu_properties);
   void addTraces() {DIE_IMPOSSIBLE;};
 
-  HostL07ModelPtr p_hostModel;
+  HostL07Model *p_hostModel;
 };
 
 class NetworkL07Model : public NetworkModel {
 };
 
 class NetworkL07Model : public NetworkModel {
@@ -90,9 +79,9 @@ public:
                                                   e_surf_link_sharing_policy_t
                                                   policy, xbt_dict_t properties);
 
                                                   e_surf_link_sharing_policy_t
                                                   policy, xbt_dict_t properties);
 
-  ActionPtr communicate(RoutingEdgePtr /*src*/, RoutingEdgePtr /*dst*/, double /*size*/, double /*rate*/) {DIE_IMPOSSIBLE;};
+  Action *communicate(RoutingEdge */*src*/, RoutingEdge */*dst*/, double /*size*/, double /*rate*/) {DIE_IMPOSSIBLE;};
   void addTraces() {DIE_IMPOSSIBLE;};
   void addTraces() {DIE_IMPOSSIBLE;};
-  HostL07ModelPtr p_hostModel;
+  HostL07Model *p_hostModel;
 };
 
 /************
 };
 
 /************
@@ -101,12 +90,12 @@ public:
 
 class HostL07 : public Host {
 public:
 
 class HostL07 : public Host {
 public:
-  HostL07(HostModelPtr model, const char* name, xbt_dict_t props, RoutingEdgePtr netElm, CpuPtr cpu);
+  HostL07(HostModel *model, const char* name, xbt_dict_t props, RoutingEdge *netElm, Cpu *cpu);
   //bool isUsed();
   bool isUsed() {DIE_IMPOSSIBLE;};
   void updateState(tmgr_trace_event_t /*event_type*/, double /*value*/, double /*date*/) {DIE_IMPOSSIBLE;};
   //bool isUsed();
   bool isUsed() {DIE_IMPOSSIBLE;};
   void updateState(tmgr_trace_event_t /*event_type*/, double /*value*/, double /*date*/) {DIE_IMPOSSIBLE;};
-  ActionPtr execute(double size);
-  ActionPtr sleep(double duration);
+  Action *execute(double size);
+  Action *sleep(double duration);
   e_surf_resource_state_t getState();
   double getPowerPeakAt(int pstate_index);
   int getNbPstates();
   e_surf_resource_state_t getState();
   double getPowerPeakAt(int pstate_index);
   int getNbPstates();
@@ -120,14 +109,14 @@ class CpuL07 : public Cpu {
   tmgr_trace_event_t p_stateEvent;
   tmgr_trace_event_t p_powerEvent;
 public:
   tmgr_trace_event_t p_stateEvent;
   tmgr_trace_event_t p_powerEvent;
 public:
-  CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t properties,
+  CpuL07(CpuL07Model *model, const char* name, xbt_dict_t properties,
                 double power_scale, double power_initial, tmgr_trace_t power_trace,
      int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace);
   bool isUsed();
   //bool isUsed() {DIE_IMPOSSIBLE;};
   void updateState(tmgr_trace_event_t event_type, double value, double date);
                 double power_scale, double power_initial, tmgr_trace_t power_trace,
      int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace);
   bool isUsed();
   //bool isUsed() {DIE_IMPOSSIBLE;};
   void updateState(tmgr_trace_event_t event_type, double value, double date);
-  CpuActionPtr execute(double /*size*/) {DIE_IMPOSSIBLE;};
-  CpuActionPtr sleep(double /*duration*/) {DIE_IMPOSSIBLE;};
+  CpuAction *execute(double /*size*/) {DIE_IMPOSSIBLE;};
+  CpuAction *sleep(double /*duration*/) {DIE_IMPOSSIBLE;};
 
   double getCurrentPowerPeak() {THROW_UNIMPLEMENTED;};
   double getPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;};
 
   double getCurrentPowerPeak() {THROW_UNIMPLEMENTED;};
   double getPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;};
@@ -139,7 +128,7 @@ public:
 
 class LinkL07 : public Link {
 public:
 
 class LinkL07 : public Link {
 public:
-  LinkL07(NetworkL07ModelPtr model, const char* name, xbt_dict_t props,
+  LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
                  double bw_initial,
           tmgr_trace_t bw_trace,
           double lat_initial,
                  double bw_initial,
           tmgr_trace_t bw_trace,
           double lat_initial,
@@ -168,15 +157,15 @@ public:
  * Action *
  **********/
 class HostL07Action : public HostAction {
  * Action *
  **********/
 class HostL07Action : public HostAction {
-  friend ActionPtr HostL07::execute(double size);
-  friend ActionPtr HostL07::sleep(double duration);
-  friend ActionPtr HostL07Model::executeParallelTask(int host_nb,
+  friend Action *HostL07::execute(double size);
+  friend Action *HostL07::sleep(double duration);
+  friend Action *HostL07Model::executeParallelTask(int host_nb,
                                                      void **host_list,
                                                    double *flops_amount,
                                                                                                   double *bytes_amount,
                                                    double rate);
 public:
                                                      void **host_list,
                                                    double *flops_amount,
                                                                                                   double *bytes_amount,
                                                    double rate);
 public:
-  HostL07Action(ModelPtr model, double cost, bool failed)
+  HostL07Action(Model *model, double cost, bool failed)
   : HostAction(model, cost, failed) {};
  ~HostL07Action();
 
   : HostAction(model, cost, failed) {};
  ~HostL07Action();
 
@@ -192,7 +181,7 @@ public:
   double getRemains();
 
   int m_hostNb;
   double getRemains();
 
   int m_hostNb;
-  HostPtr *p_hostList;
+  Host **p_hostList;
   double *p_computationAmount;
   double *p_communicationAmount;
   double m_latency;
   double *p_computationAmount;
   double *p_communicationAmount;
   double m_latency;
index fc8b453..7f9a358 100644 (file)
@@ -676,7 +676,7 @@ void lmm_solve(lmm_system_t sys)
           cnst->usage = elem->value / elem->variable->weight;
 
         make_elem_active(elem);
           cnst->usage = elem->value / elem->variable->weight;
 
         make_elem_active(elem);
-        ActionPtr action = static_cast<ActionPtr>(elem->variable->id);
+        Action *action = static_cast<Action*>(elem->variable->id);
         if (sys->keep_track && !action->is_linked())
           sys->keep_track->push_back(*action);
       }
         if (sys->keep_track && !action->is_linked())
           sys->keep_track->push_back(*action);
       }
index d49e20b..fd81be3 100644 (file)
@@ -54,7 +54,7 @@ void surf_network_model_init_LegrandVelho(void)
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
-  ModelPtr model = surf_network_model;
+  Model *model = surf_network_model;
   xbt_dynar_push(model_list, &model);
 
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor",
   xbt_dynar_push(model_list, &model);
 
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor",
@@ -83,7 +83,7 @@ void surf_network_model_init_CM02(void)
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
-  ModelPtr model = surf_network_model;
+  Model *model = surf_network_model;
   xbt_dynar_push(model_list, &model);
 
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
   xbt_dynar_push(model_list, &model);
 
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
@@ -109,7 +109,7 @@ void surf_network_model_init_Reno(void)
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
-  ModelPtr model = surf_network_model;
+  Model *model = surf_network_model;
   xbt_dynar_push(model_list, &model);
   lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
                                     func_reno_fpi);
   xbt_dynar_push(model_list, &model);
   lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
                                     func_reno_fpi);
@@ -129,7 +129,7 @@ void surf_network_model_init_Reno2(void)
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
-  ModelPtr model = surf_network_model;
+  Model *model = surf_network_model;
   xbt_dynar_push(model_list, &model);
   lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
                                     func_reno2_fpi);
   xbt_dynar_push(model_list, &model);
   lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
                                     func_reno2_fpi);
@@ -149,7 +149,7 @@ void surf_network_model_init_Vegas(void)
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
 
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
-  ModelPtr model = surf_network_model;
+  Model *model = surf_network_model;
   xbt_dynar_push(model_list, &model);
   lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
                                     func_vegas_fpi);
   xbt_dynar_push(model_list, &model);
   lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
                                     func_vegas_fpi);
@@ -220,10 +220,10 @@ Link* NetworkCm02Model::createLink(const char *name,
 
 void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
 {
 
 void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
 {
-  NetworkCm02ActionPtr action;
+  NetworkCm02Action *action;
   while ((xbt_heap_size(p_actionHeap) > 0)
          && (double_equals(xbt_heap_maxkey(p_actionHeap), now, sg_surf_precision))) {
   while ((xbt_heap_size(p_actionHeap) > 0)
          && (double_equals(xbt_heap_maxkey(p_actionHeap), now, sg_surf_precision))) {
-    action = (NetworkCm02ActionPtr) xbt_heap_pop(p_actionHeap);
+    action = static_cast<NetworkCm02Action*> (xbt_heap_pop(p_actionHeap));
     XBT_DEBUG("Something happened to action %p", action);
     if (TRACE_is_enabled()) {
       int n = lmm_get_number_of_cnst_from_var(p_maxminSystem, action->getVariable());
     XBT_DEBUG("Something happened to action %p", action);
     if (TRACE_is_enabled()) {
       int n = lmm_get_number_of_cnst_from_var(p_maxminSystem, action->getVariable());
@@ -271,14 +271,14 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
 
 void NetworkCm02Model::updateActionsStateFull(double now, double delta)
 {
 
 void NetworkCm02Model::updateActionsStateFull(double now, double delta)
 {
-  NetworkCm02ActionPtr action;
-  ActionListPtr running_actions = getRunningActionSet();
+  NetworkCm02Action *action;
+  ActionList *running_actions = getRunningActionSet();
 
   for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
      ; it != itend ; it=itNext) {
        ++itNext;
 
 
   for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
      ; it != itend ; it=itNext) {
        ++itNext;
 
-    action = (NetworkCm02ActionPtr) &*it;
+    action = static_cast<NetworkCm02Action*> (&*it);
     XBT_DEBUG("Something happened to action %p", action);
       double deltap = delta;
       if (action->m_latency > 0) {
     XBT_DEBUG("Something happened to action %p", action);
       double deltap = delta;
       if (action->m_latency > 0) {
@@ -339,20 +339,20 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta)
   return;
 }
 
   return;
 }
 
-ActionPtr NetworkCm02Model::communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
+Action *NetworkCm02Model::communicate(RoutingEdge *src, RoutingEdge *dst,
                                                 double size, double rate)
 {
   unsigned int i;
   void *_link;
   NetworkCm02Link *link;
   int failed = 0;
                                                 double size, double rate)
 {
   unsigned int i;
   void *_link;
   NetworkCm02Link *link;
   int failed = 0;
-  NetworkCm02ActionPtr action = NULL;
+  NetworkCm02Action *action = NULL;
   double bandwidth_bound;
   double latency = 0.0;
   xbt_dynar_t back_route = NULL;
   int constraints_per_variable = 0;
 
   double bandwidth_bound;
   double latency = 0.0;
   xbt_dynar_t back_route = NULL;
   int constraints_per_variable = 0;
 
-  xbt_dynar_t route = xbt_dynar_new(sizeof(RoutingEdgePtr), NULL);
+  xbt_dynar_t route = xbt_dynar_new(sizeof(RoutingEdge*), NULL);
 
   XBT_IN("(%s,%s,%g,%g)", src->getName(), dst->getName(), size, rate);
 
 
   XBT_IN("(%s,%s,%g,%g)", src->getName(), dst->getName(), size, rate);
 
@@ -515,7 +515,7 @@ void NetworkCm02Model::addTraces(){
 /************
  * Resource *
  ************/
 /************
  * Resource *
  ************/
-NetworkCm02Link::NetworkCm02Link(NetworkCm02ModelPtr model, const char *name, xbt_dict_t props,
+NetworkCm02Link::NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
                                   lmm_system_t system,
                                   double constraint_value,
                                   tmgr_history_t history,
                                   lmm_system_t system,
                                   double constraint_value,
                                   tmgr_history_t history,
@@ -572,7 +572,7 @@ void NetworkCm02Link::updateState(tmgr_trace_event_t event_type,
 
       setState(SURF_RESOURCE_OFF);
       while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), cnst, &elem))) {
 
       setState(SURF_RESOURCE_OFF);
       while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), cnst, &elem))) {
-        ActionPtr action = (ActionPtr) lmm_variable_id(var);
+        Action *action = static_cast<Action*>( lmm_variable_id(var) );
 
         if (action->getState() == SURF_ACTION_RUNNING ||
             action->getState() == SURF_ACTION_READY) {
 
         if (action->getState() == SURF_ACTION_RUNNING ||
             action->getState() == SURF_ACTION_READY) {
@@ -602,7 +602,7 @@ void NetworkCm02Link::updateBandwidth(double value, double date){
   lmm_element_t nextelem = NULL;
   int numelem = 0;
 
   lmm_element_t nextelem = NULL;
   int numelem = 0;
 
-  NetworkCm02ActionPtr action = NULL;
+  NetworkCm02Action *action = NULL;
 
   p_power.peak = value;
   lmm_update_constraint_bound(getModel()->getMaxminSystem(),
 
   p_power.peak = value;
   lmm_update_constraint_bound(getModel()->getMaxminSystem(),
@@ -612,7 +612,7 @@ void NetworkCm02Link::updateBandwidth(double value, double date){
   TRACE_surf_link_set_bandwidth(date, getName(), sg_bandwidth_factor * p_power.peak * p_power.scale);
   if (sg_weight_S_parameter > 0) {
     while ((var = lmm_get_var_from_cnst_safe(getModel()->getMaxminSystem(), getConstraint(), &elem, &nextelem, &numelem))) {
   TRACE_surf_link_set_bandwidth(date, getName(), sg_bandwidth_factor * p_power.peak * p_power.scale);
   if (sg_weight_S_parameter > 0) {
     while ((var = lmm_get_var_from_cnst_safe(getModel()->getMaxminSystem(), getConstraint(), &elem, &nextelem, &numelem))) {
-      action = (NetworkCm02ActionPtr) lmm_variable_id(var);
+      action = (NetworkCm02Action*) lmm_variable_id(var);
       action->m_weight += delta;
       if (!action->isSuspended())
         lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->m_weight);
       action->m_weight += delta;
       if (!action->isSuspended())
         lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->m_weight);
@@ -626,11 +626,11 @@ void NetworkCm02Link::updateLatency(double value, double date){
   lmm_element_t elem = NULL;
   lmm_element_t nextelem = NULL;
   int numelem = 0;
   lmm_element_t elem = NULL;
   lmm_element_t nextelem = NULL;
   int numelem = 0;
-  NetworkCm02ActionPtr action = NULL;
+  NetworkCm02Action *action = NULL;
 
   m_latCurrent = value;
   while ((var = lmm_get_var_from_cnst_safe(getModel()->getMaxminSystem(), getConstraint(), &elem, &nextelem, &numelem))) {
 
   m_latCurrent = value;
   while ((var = lmm_get_var_from_cnst_safe(getModel()->getMaxminSystem(), getConstraint(), &elem, &nextelem, &numelem))) {
-    action = (NetworkCm02ActionPtr) lmm_variable_id(var);
+    action = (NetworkCm02Action*) lmm_variable_id(var);
     action->m_latCurrent += delta;
     action->m_weight += delta;
     if (action->m_rate < 0)
     action->m_latCurrent += delta;
     action->m_weight += delta;
     if (action->m_rate < 0)
index 84b0e99..f9d418a 100644 (file)
  * Classes *
  ***********/
 class NetworkCm02Model;
  * Classes *
  ***********/
 class NetworkCm02Model;
-typedef NetworkCm02Model *NetworkCm02ModelPtr;
-
 class NetworkCm02Action;
 class NetworkCm02Action;
-typedef NetworkCm02Action *NetworkCm02ActionPtr;
 
 /*********
  * Tools *
 
 /*********
  * Tools *
@@ -57,7 +54,7 @@ public:
   void addTraces();
   void updateActionsStateLazy(double now, double delta);
   void updateActionsStateFull(double now, double delta);
   void addTraces();
   void updateActionsStateLazy(double now, double delta);
   void updateActionsStateFull(double now, double delta);
-  ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
+  Action *communicate(RoutingEdge *src, RoutingEdge *dst,
                                           double size, double rate);
 };
 
                                           double size, double rate);
 };
 
@@ -67,7 +64,7 @@ public:
 
 class NetworkCm02Link : public Link {
 public:
 
 class NetworkCm02Link : public Link {
 public:
-  NetworkCm02Link(NetworkCm02ModelPtr model, const char *name, xbt_dict_t props,
+  NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
                                   lmm_system_t system,
                                   double constraint_value,
                                   tmgr_history_t history,
                                   lmm_system_t system,
                                   double constraint_value,
                                   tmgr_history_t history,
@@ -89,10 +86,10 @@ public:
  **********/
 
 class NetworkCm02Action : public NetworkAction {
  **********/
 
 class NetworkCm02Action : public NetworkAction {
-  friend ActionPtr NetworkCm02Model::communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate);
+  friend Action *NetworkCm02Model::communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate);
 
 public:
 
 public:
-  NetworkCm02Action(ModelPtr model, double cost, bool failed)
+  NetworkCm02Action(Model *model, double cost, bool failed)
  : NetworkAction(model, cost, failed) {};
   void updateRemainingLazy(double now);
   void recycle();
  : NetworkAction(model, cost, failed) {};
   void updateRemainingLazy(double now);
   void recycle();
index 06001ba..6574473 100644 (file)
@@ -24,19 +24,19 @@ void surf_network_model_init_Constant()
 
   sg_platf_host_add_cb(netcste_count_hosts);
 
 
   sg_platf_host_add_cb(netcste_count_hosts);
 
-  ModelPtr model = surf_network_model;
+  Model *model = surf_network_model;
   xbt_dynar_push(model_list, &model);
 }
 
 double NetworkConstantModel::shareResources(double /*now*/)
 {
   xbt_dynar_push(model_list, &model);
 }
 
 double NetworkConstantModel::shareResources(double /*now*/)
 {
-  NetworkConstantActionPtr action = NULL;
+  NetworkConstantAction *action = NULL;
   double min = -1.0;
 
   double min = -1.0;
 
-  ActionListPtr actionSet = getRunningActionSet();
+  ActionList *actionSet = getRunningActionSet();
   for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
         ; it != itend ; ++it) {
   for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
         ; it != itend ; ++it) {
-       action = static_cast<NetworkConstantActionPtr>(&*it);
+       action = static_cast<NetworkConstantAction*>(&*it);
         if (action->m_latency > 0 && (min < 0 || action->m_latency < min))
             min = action->m_latency;
   }
         if (action->m_latency > 0 && (min < 0 || action->m_latency < min))
             min = action->m_latency;
   }
@@ -46,12 +46,12 @@ double NetworkConstantModel::shareResources(double /*now*/)
 
 void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
 {
 
 void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
 {
-  NetworkConstantActionPtr action = NULL;
-  ActionListPtr actionSet = getRunningActionSet();
+  NetworkConstantAction *action = NULL;
+  ActionList *actionSet = getRunningActionSet();
   for(ActionList::iterator it(actionSet->begin()), itNext=it, itend(actionSet->end())
      ; it != itend ; it=itNext) {
     ++itNext;
   for(ActionList::iterator it(actionSet->begin()), itNext=it, itend(actionSet->end())
      ; it != itend ; it=itNext) {
     ++itNext;
-       action = static_cast<NetworkConstantActionPtr>(&*it);
+       action = static_cast<NetworkConstantAction*>(&*it);
     if (action->m_latency > 0) {
       if (action->m_latency > delta) {
         double_update(&(action->m_latency), delta, sg_surf_precision);
     if (action->m_latency > 0) {
       if (action->m_latency > delta) {
         double_update(&(action->m_latency), delta, sg_surf_precision);
@@ -74,14 +74,14 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
   }
 }
 
   }
 }
 
-ActionPtr NetworkConstantModel::communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
+Action *NetworkConstantModel::communicate(RoutingEdge *src, RoutingEdge *dst,
                                         double size, double rate)
 {
   char *src_name = src->getName();
   char *dst_name = dst->getName();
 
   XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
                                         double size, double rate)
 {
   char *src_name = src->getName();
   char *dst_name = dst->getName();
 
   XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
-  NetworkConstantActionPtr action = new NetworkConstantAction(this, size, sg_latency_factor);
+  NetworkConstantAction *action = new NetworkConstantAction(this, size, sg_latency_factor);
   XBT_OUT();
 
   surf_callback_emit(networkCommunicateCallbacks, action, src, dst, size, rate);
   XBT_OUT();
 
   surf_callback_emit(networkCommunicateCallbacks, action, src, dst, size, rate);
index 13f2833..ecff72a 100644 (file)
  * Classes *
  ***********/
 class NetworkConstantModel;
  * Classes *
  ***********/
 class NetworkConstantModel;
-typedef NetworkConstantModel *NetworkConstantModelPtr;
-
 class NetworkConstantAction;
 class NetworkConstantAction;
-typedef NetworkConstantAction *NetworkConstantActionPtr;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -30,9 +27,9 @@ public:
   };
   double shareResources(double now);
   void updateActionsState(double now, double delta);
   };
   double shareResources(double now);
   void updateActionsState(double now, double delta);
-  ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
+  Action *communicate(RoutingEdge *src, RoutingEdge *dst,
                                           double size, double rate);
                                           double size, double rate);
-  void gapRemove(ActionPtr action);
+  void gapRemove(Action *action);
 };
 
 /************
 };
 
 /************
@@ -40,7 +37,7 @@ public:
  ************/
 class NetworkConstantLink : public NetworkCm02Link {
 public:
  ************/
 class NetworkConstantLink : public NetworkCm02Link {
 public:
-  NetworkConstantLink(NetworkCm02ModelPtr model, const char* name, xbt_dict_t properties);
+  NetworkConstantLink(NetworkCm02Model *model, const char* name, xbt_dict_t properties);
   bool isUsed();
   void updateState(tmgr_trace_event_t event_type, double value, double date);
   double getBandwidth();
   bool isUsed();
   void updateState(tmgr_trace_event_t event_type, double value, double date);
   double getBandwidth();
@@ -53,7 +50,7 @@ public:
  **********/
 class NetworkConstantAction : public NetworkCm02Action {
 public:
  **********/
 class NetworkConstantAction : public NetworkCm02Action {
 public:
-  NetworkConstantAction(NetworkConstantModelPtr model_, double size, double latency)
+  NetworkConstantAction(NetworkConstantModel *model_, double size, double latency)
   : NetworkCm02Action(model_, size, false)
   , m_latInit(latency)
   {
   : NetworkCm02Action(model_, size, false)
   , m_latInit(latency)
   {
index 9c9854c..cecdfc8 100644 (file)
@@ -24,7 +24,7 @@ static void IB_create_host_callback(sg_platf_host_cbarg_t t){
  
 }
 
  
 }
 
-static void IB_action_state_changed_callback(NetworkActionPtr action, e_surf_action_state_t statein, e_surf_action_state_t stateout){
+static void IB_action_state_changed_callback(NetworkAction *action, e_surf_action_state_t statein, e_surf_action_state_t stateout){
  if(statein!=SURF_ACTION_RUNNING|| stateout!=SURF_ACTION_DONE)
     return;
   std::pair<IBNode*,IBNode*> pair = ((NetworkIBModel*)surf_network_model)->active_comms[action];
  if(statein!=SURF_ACTION_RUNNING|| stateout!=SURF_ACTION_DONE)
     return;
   std::pair<IBNode*,IBNode*> pair = ((NetworkIBModel*)surf_network_model)->active_comms[action];
@@ -37,7 +37,7 @@ static void IB_action_state_changed_callback(NetworkActionPtr action, e_surf_act
 }
 
 
 }
 
 
-static void IB_action_init_callback(NetworkActionPtr action,RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate){
+static void IB_action_init_callback(NetworkAction *action,RoutingEdge *src, RoutingEdge *dst, double size, double rate){
   if(((NetworkIBModel*)surf_network_model)->active_nodes==NULL)
     xbt_die("IB comm added, without any node connected !");
   
   if(((NetworkIBModel*)surf_network_model)->active_nodes==NULL)
     xbt_die("IB comm added, without any node connected !");
   
@@ -184,7 +184,7 @@ void NetworkIBModel::updateIBfactors_rec(IBNode *root, bool* updatedlist) {
 }
 
 
 }
 
 
-void NetworkIBModel::updateIBfactors(NetworkActionPtr action, IBNode *from, IBNode * to, int remove) {
+void NetworkIBModel::updateIBfactors(NetworkAction *action, IBNode *from, IBNode * to, int remove) {
   if (from == to)//disregard local comms (should use loopback)
     return;
   
   if (from == to)//disregard local comms (should use loopback)
     return;
   
index 7328b97..77e361e 100644 (file)
@@ -15,7 +15,7 @@ class ActiveComm{
 public :
   //IBNode* origin;
   IBNode* destination;
 public :
   //IBNode* origin;
   IBNode* destination;
-  NetworkActionPtr action;
+  NetworkAction *action;
   double init_rate;
   ActiveComm() : destination(NULL),action(NULL),init_rate(-1){};
   ~ActiveComm(){};
   double init_rate;
   ActiveComm() : destination(NULL),action(NULL),init_rate(-1){};
   ~ActiveComm(){};
@@ -42,10 +42,10 @@ public:
   NetworkIBModel();
   NetworkIBModel(const char *name);
   ~NetworkIBModel();
   NetworkIBModel();
   NetworkIBModel(const char *name);
   ~NetworkIBModel();
-  void updateIBfactors(NetworkActionPtr action, IBNode *from, IBNode * to, int remove);
+  void updateIBfactors(NetworkAction *action, IBNode *from, IBNode * to, int remove);
   
   xbt_dict_t active_nodes;
   
   xbt_dict_t active_nodes;
-  std::map<NetworkActionPtr , std::pair<IBNode*,IBNode*> > active_comms;
+  std::map<NetworkAction *, std::pair<IBNode*,IBNode*> > active_comms;
   
   double Bs;
   double Be;
   
   double Bs;
   double Be;
index 5486717..37ee98e 100644 (file)
@@ -87,8 +87,8 @@ void Link::linksExit() {
 surf_callback(void, Link*) networkLinkCreatedCallbacks;
 surf_callback(void, Link*) networkLinkDestructedCallbacks;
 surf_callback(void, Link*, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
 surf_callback(void, Link*) networkLinkCreatedCallbacks;
 surf_callback(void, Link*) networkLinkDestructedCallbacks;
 surf_callback(void, Link*, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
-surf_callback(void, NetworkActionPtr, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
-surf_callback(void, NetworkActionPtr, RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate) networkCommunicateCallbacks;
+surf_callback(void, NetworkAction*, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
+surf_callback(void, NetworkAction*, RoutingEdge *src, RoutingEdge *dst, double size, double rate) networkCommunicateCallbacks;
 
 void netlink_parse_init(sg_platf_link_cbarg_t link){
   if (link->policy == SURF_LINK_FULLDUPLEX) {
 
 void netlink_parse_init(sg_platf_link_cbarg_t link){
   if (link->policy == SURF_LINK_FULLDUPLEX) {
@@ -130,7 +130,7 @@ void net_add_traces(){
  * Model *
  *********/
 
  * Model *
  *********/
 
-NetworkModelPtr surf_network_model = NULL;
+NetworkModel *surf_network_model = NULL;
 
 double NetworkModel::latencyFactor(double /*size*/) {
   return sg_latency_factor;
 
 double NetworkModel::latencyFactor(double /*size*/) {
   return sg_latency_factor;
@@ -146,15 +146,15 @@ double NetworkModel::bandwidthConstraint(double rate, double /*bound*/, double /
 
 double NetworkModel::shareResourcesFull(double now)
 {
 
 double NetworkModel::shareResourcesFull(double now)
 {
-  NetworkActionPtr action = NULL;
-  ActionListPtr runningActions = surf_network_model->getRunningActionSet();
+  NetworkAction *action = NULL;
+  ActionList *runningActions = surf_network_model->getRunningActionSet();
   double minRes;
 
   minRes = shareResourcesMaxMin(runningActions, surf_network_model->p_maxminSystem, surf_network_model->f_networkSolve);
 
   for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
        ; it != itend ; ++it) {
   double minRes;
 
   minRes = shareResourcesMaxMin(runningActions, surf_network_model->p_maxminSystem, surf_network_model->f_networkSolve);
 
   for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
        ; it != itend ; ++it) {
-      action = static_cast<NetworkActionPtr>(&*it);
+      action = static_cast<NetworkAction*>(&*it);
 #ifdef HAVE_LATENCY_BOUND_TRACKING
     if (lmm_is_variable_limited_by_latency(action->getVariable())) {
       action->m_latencyLimited = 1;
 #ifdef HAVE_LATENCY_BOUND_TRACKING
     if (lmm_is_variable_limited_by_latency(action->getVariable())) {
       action->m_latencyLimited = 1;
@@ -176,7 +176,7 @@ double NetworkModel::shareResourcesFull(double now)
  * Resource *
  ************/
 
  * Resource *
  ************/
 
-Link::Link(NetworkModelPtr model, const char *name, xbt_dict_t props)
+Link::Link(NetworkModel *model, const char *name, xbt_dict_t props)
 : Resource(model, name, props)
 , p_latEvent(NULL)
 {
 : Resource(model, name, props)
 , p_latEvent(NULL)
 {
@@ -186,7 +186,7 @@ Link::Link(NetworkModelPtr model, const char *name, xbt_dict_t props)
   XBT_DEBUG("Create link '%s'",name);
 }
 
   XBT_DEBUG("Create link '%s'",name);
 }
 
-Link::Link(NetworkModelPtr model, const char *name, xbt_dict_t props,
+Link::Link(NetworkModel *model, const char *name, xbt_dict_t props,
                                 lmm_constraint_t constraint,
                             tmgr_history_t history,
                             tmgr_trace_t state_trace)
                                 lmm_constraint_t constraint,
                             tmgr_history_t history,
                             tmgr_trace_t state_trace)
index 171a047..1893836 100644 (file)
  * Classes *
  ***********/
 class NetworkModel;
  * Classes *
  ***********/
 class NetworkModel;
-typedef NetworkModel *NetworkModelPtr;
-
 class NetworkAction;
 class NetworkAction;
-typedef NetworkAction *NetworkActionPtr;
 
 /*************
  * Callbacks *
 
 /*************
  * Callbacks *
@@ -42,21 +39,21 @@ XBT_PUBLIC_DATA( surf_callback(void, Link*)) networkLinkDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emits the callbacks after Link State changed
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emits the callbacks after Link State changed
- * @details Callback functions have the following signature: `void(LinkActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @details Callback functions have the following signature: `void(LinkAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
 XBT_PUBLIC_DATA( surf_callback(void, Link*, e_surf_resource_state_t, e_surf_resource_state_t)) networkLinkStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emits the callbacks after NetworkAction State changed
  */
 XBT_PUBLIC_DATA( surf_callback(void, Link*, e_surf_resource_state_t, e_surf_resource_state_t)) networkLinkStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emits the callbacks after NetworkAction State changed
- * @details Callback functions have the following signature: `void(NetworkActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
+ * @details Callback functions have the following signature: `void(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t current)`
  */
  */
-XBT_PUBLIC_DATA( surf_callback(void, NetworkActionPtr, e_surf_action_state_t, e_surf_action_state_t)) networkActionStateChangedCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, NetworkAction*, e_surf_action_state_t, e_surf_action_state_t)) networkActionStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emits the callbacks after communication created
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emits the callbacks after communication created
- * @details Callback functions have the following signature: `void(NetworkActionPtr action, RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate)`
+ * @details Callback functions have the following signature: `void(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate)`
  */
  */
-XBT_PUBLIC_DATA( surf_callback(void, NetworkActionPtr, RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate)) networkCommunicateCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, NetworkAction*, RoutingEdge *src, RoutingEdge *dst, double size, double rate)) networkCommunicateCallbacks;
 
 /*********
  * Tools *
 
 /*********
  * Tools *
@@ -118,7 +115,7 @@ public:
                                    e_surf_link_sharing_policy_t policy,
                                    xbt_dict_t properties)=0;
 
                                    e_surf_link_sharing_policy_t policy,
                                    xbt_dict_t properties)=0;
 
-  virtual void gapAppend(double /*size*/, const Link* /*link*/, NetworkActionPtr /*action*/) {};
+  virtual void gapAppend(double /*size*/, const Link* /*link*/, NetworkAction */*action*/) {};
 
   /**
    * @brief Create a communication between two hosts.
 
   /**
    * @brief Create a communication between two hosts.
@@ -132,7 +129,7 @@ public:
    * unlimited.
    * @return The action representing the communication
    */
    * unlimited.
    * @return The action representing the communication
    */
-  virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
+  virtual Action *communicate(RoutingEdge *src, RoutingEdge *dst,
                                           double size, double rate)=0;
 
   /**
                                           double size, double rate)=0;
 
   /**
@@ -196,7 +193,7 @@ public:
    * @param name The name of the Link
    * @param props Dictionary of properties associated to this Link
    */
    * @param name The name of the Link
    * @param props Dictionary of properties associated to this Link
    */
-  Link(NetworkModelPtr model, const char *name, xbt_dict_t props);
+  Link(NetworkModel *model, const char *name, xbt_dict_t props);
 
   /**
    * @brief Link constructor
 
   /**
    * @brief Link constructor
@@ -208,7 +205,7 @@ public:
    * @param history [TODO]
    * @param state_trace [TODO]
    */
    * @param history [TODO]
    * @param state_trace [TODO]
    */
-  Link(NetworkModelPtr model, const char *name, xbt_dict_t props,
+  Link(NetworkModel *model, const char *name, xbt_dict_t props,
               lmm_constraint_t constraint,
               tmgr_history_t history,
               tmgr_trace_t state_trace);
               lmm_constraint_t constraint,
               tmgr_history_t history,
               tmgr_trace_t state_trace);
@@ -282,7 +279,7 @@ public:
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
    */
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
    */
-  NetworkAction(ModelPtr model, double cost, bool failed)
+  NetworkAction(Model *model, double cost, bool failed)
   : Action(model, cost, failed) {}
 
   /**
   : Action(model, cost, failed) {}
 
   /**
@@ -294,7 +291,7 @@ public:
    * @param var The lmm variable associated to this Action if it is part of a
    * LMM component
    */
    * @param var The lmm variable associated to this Action if it is part of a
    * LMM component
    */
-  NetworkAction(ModelPtr model, double cost, bool failed, lmm_variable_t var)
+  NetworkAction(Model *model, double cost, bool failed, lmm_variable_t var)
   : Action(model, cost, failed, var) {};
 
   void setState(e_surf_action_state_t state);
   : Action(model, cost, failed, var) {};
 
   void setState(e_surf_action_state_t state);
index af20467..4e8cccc 100644 (file)
@@ -198,7 +198,7 @@ static void create_ns3_topology(void)
     xbt_die("There is no routes!");
   XBT_DEBUG("Have get_onelink_routes, found %ld routes",onelink_routes->used);
   //save them in trace file
     xbt_die("There is no routes!");
   XBT_DEBUG("Have get_onelink_routes, found %ld routes",onelink_routes->used);
   //save them in trace file
-  OnelinkPtr onelink;
+  Onelink *onelink;
   unsigned int iter;
   xbt_dynar_foreach(onelink_routes, iter, onelink) {
     char *src = onelink->p_src->getName();
   unsigned int iter;
   xbt_dynar_foreach(onelink_routes, iter, onelink) {
     char *src = onelink->p_src->getName();
@@ -308,7 +308,7 @@ Link* NetworkNS3Model::createLink(const char *name,
   return new NetworkNS3Link(this, name, properties, bw_initial, lat_initial);
 }
 
   return new NetworkNS3Link(this, name, properties, bw_initial, lat_initial);
 }
 
-xbt_dynar_t NetworkNS3Model::getRoute(RoutingEdgePtr src, RoutingEdgePtr dst)
+xbt_dynar_t NetworkNS3Model::getRoute(RoutingEdge *src, RoutingEdge *dst)
 {
   xbt_dynar_t route = NULL;
   routing_get_route_and_latency(src, dst, &route, NULL);
 {
   xbt_dynar_t route = NULL;
   routing_get_route_and_latency(src, dst, &route, NULL);
@@ -316,11 +316,11 @@ xbt_dynar_t NetworkNS3Model::getRoute(RoutingEdgePtr src, RoutingEdgePtr dst)
   return route;
 }
 
   return route;
 }
 
-ActionPtr NetworkNS3Model::communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
+Action *NetworkNS3Model::communicate(RoutingEdge *src, RoutingEdge *dst,
                                               double size, double rate)
 {
   XBT_DEBUG("Communicate from %s to %s", src->getName(), dst->getName());
                                               double size, double rate)
 {
   XBT_DEBUG("Communicate from %s to %s", src->getName(), dst->getName());
-  NetworkNS3ActionPtr action = new NetworkNS3Action(this, size, 0);
+  NetworkNS3Action *action = new NetworkNS3Action(this, size, 0);
 
   ns3_create_flow(src->getName(), dst->getName(), surf_get_clock(), size, action);
 
 
   ns3_create_flow(src->getName(), dst->getName(), surf_get_clock(), size, action);
 
@@ -370,9 +370,9 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
     return;
   }
 
     return;
   }
 
-  NetworkNS3ActionPtr action;
+  NetworkNS3Action *action;
   xbt_dict_foreach(dict_socket,cursor,key,data){
   xbt_dict_foreach(dict_socket,cursor,key,data){
-    action = static_cast<NetworkNS3ActionPtr>(ns3_get_socket_action(data));
+    action = static_cast<NetworkNS3Action*>(ns3_get_socket_action(data));
     XBT_DEBUG("Processing socket %p (action %p)",data,action);
     action->setRemains(action->getCost() - ns3_get_socket_sent(data));
 
     XBT_DEBUG("Processing socket %p (action %p)",data,action);
     action->setRemains(action->getCost() - ns3_get_socket_sent(data));
 
@@ -386,7 +386,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
        routing_get_route_and_latency (action->p_srcElm, action->p_dstElm, &route, NULL);
        unsigned int i;
        for (i = 0; i < xbt_dynar_length (route); i++){
        routing_get_route_and_latency (action->p_srcElm, action->p_dstElm, &route, NULL);
        unsigned int i;
        for (i = 0; i < xbt_dynar_length (route); i++){
-               NetworkNS3Link* link = ((NetworkNS3Link*)xbt_dynar_get_ptr (route, i));
+               NetworkNS3Link* link = ((NetworkNS3Link*)xbt_dynar_get_ptr(route, i));
                TRACE_surf_link_set_utilization (link->getName(),
                                action->getCategory(),
                                        (data_delta_sent)/delta,
                TRACE_surf_link_set_utilization (link->getName(),
                                action->getCategory(),
                                        (data_delta_sent)/delta,
@@ -408,7 +408,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
     xbt_dynar_pop(socket_to_destroy,&key);
 
     void *data = xbt_dict_get (dict_socket, key);
     xbt_dynar_pop(socket_to_destroy,&key);
 
     void *data = xbt_dict_get (dict_socket, key);
-    action = static_cast<NetworkNS3ActionPtr>(ns3_get_socket_action(data));
+    action = static_cast<NetworkNS3Action*>(ns3_get_socket_action(data));
     XBT_DEBUG ("Removing socket %p of action %p", key, action);
     xbt_dict_remove(dict_socket, key);
   }
     XBT_DEBUG ("Removing socket %p of action %p", key, action);
     xbt_dict_remove(dict_socket, key);
   }
@@ -419,7 +419,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
  * Resource *
  ************/
 
  * Resource *
  ************/
 
-NetworkNS3Link::NetworkNS3Link(NetworkNS3ModelPtr model, const char *name, xbt_dict_t props,
+NetworkNS3Link::NetworkNS3Link(NetworkNS3Model *model, const char *name, xbt_dict_t props,
                                       double bw_initial, double lat_initial)
  : Link(model, name, props)
  , p_lat(bprintf("%f", lat_initial))
                                       double bw_initial, double lat_initial)
  : Link(model, name, props)
  , p_lat(bprintf("%f", lat_initial))
@@ -441,7 +441,7 @@ void NetworkNS3Link::updateState(tmgr_trace_event_t event_type, double value, do
  * Action *
  **********/
 
  * Action *
  **********/
 
-NetworkNS3Action::NetworkNS3Action(ModelPtr model, double cost, bool failed)
+NetworkNS3Action::NetworkNS3Action(Model *model, double cost, bool failed)
 : NetworkAction(model, cost, failed)
 {}
 
 : NetworkAction(model, cost, failed)
 {}
 
index b04d5c9..b296eb2 100644 (file)
  * Classes *
  ***********/
 class NetworkNS3Model;
  * Classes *
  ***********/
 class NetworkNS3Model;
-typedef NetworkNS3Model *NetworkNS3ModelPtr;
-
 class NetworkNS3Action;
 class NetworkNS3Action;
-typedef NetworkNS3Action *NetworkNS3ActionPtr;
 
 /*********
  * Tools *
 
 /*********
  * Tools *
@@ -43,8 +40,8 @@ public:
                                         tmgr_trace_t state_trace,
                                         e_surf_link_sharing_policy_t policy,
                                         xbt_dict_t properties);
                                         tmgr_trace_t state_trace,
                                         e_surf_link_sharing_policy_t policy,
                                         xbt_dict_t properties);
-  xbt_dynar_t getRoute(RoutingEdgePtr src, RoutingEdgePtr dst);
-  ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
+  xbt_dynar_t getRoute(RoutingEdge *src, RoutingEdge *dst);
+  Action *communicate(RoutingEdge *src, RoutingEdge *dst,
                                           double size, double rate);
   double shareResources(double now);
   void updateActionsState(double now, double delta);
                                           double size, double rate);
   double shareResources(double now);
   void updateActionsState(double now, double delta);
@@ -56,7 +53,7 @@ public:
  ************/
 class NetworkNS3Link : public Link {
 public:
  ************/
 class NetworkNS3Link : public Link {
 public:
-  NetworkNS3Link(NetworkNS3ModelPtr model, const char *name, xbt_dict_t props,
+  NetworkNS3Link(NetworkNS3Model *model, const char *name, xbt_dict_t props,
                         double bw_initial, double lat_initial);
   ~NetworkNS3Link();
 
                         double bw_initial, double lat_initial);
   ~NetworkNS3Link();
 
@@ -78,7 +75,7 @@ public:
  **********/
 class NetworkNS3Action : public NetworkAction {
 public:
  **********/
 class NetworkNS3Action : public NetworkAction {
 public:
-  NetworkNS3Action(ModelPtr model, double cost, bool failed);
+  NetworkNS3Action(Model *model, double cost, bool failed);
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
   int getLatencyLimited();
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
   int getLatencyLimited();
@@ -91,8 +88,8 @@ void resume();
 
 //private:
   double m_lastSent;
 
 //private:
   double m_lastSent;
-  RoutingEdgePtr p_srcElm;
-  RoutingEdgePtr p_dstElm;
+  RoutingEdge *p_srcElm;
+  RoutingEdge *p_dstElm;
 };
 
 
 };
 
 
index 706e053..da20927 100644 (file)
@@ -104,7 +104,7 @@ NetworkSmpiModel::~NetworkSmpiModel(){
   }
 }
 
   }
 }
 
-void NetworkSmpiModel::gapAppend(double size, Link* link, NetworkActionPtr action)
+void NetworkSmpiModel::gapAppend(double size, Link* link, NetworkAction *action)
 {
   const char *src = link->getName();
   xbt_fifo_t fifo;
 {
   const char *src = link->getName();
   xbt_fifo_t fifo;
@@ -139,11 +139,11 @@ void NetworkSmpiModel::gapAppend(double size, Link* link, NetworkActionPtr actio
   }
 }
 
   }
 }
 
-void NetworkSmpiModel::gapRemove(ActionPtr lmm_action)
+void NetworkSmpiModel::gapRemove(Action *lmm_action)
 {
   xbt_fifo_t fifo;
   size_t size;
 {
   xbt_fifo_t fifo;
   size_t size;
-  NetworkCm02ActionPtr action = static_cast<NetworkCm02ActionPtr>(lmm_action);
+  NetworkCm02Action *action = static_cast<NetworkCm02Action*>(lmm_action);
 
   if (sg_sender_gap > 0.0 && action->p_senderLinkName
       && action->p_senderFifoItem) {
 
   if (sg_sender_gap > 0.0 && action->p_senderLinkName
       && action->p_senderFifoItem) {
index 879d59c..6d7bd44 100644 (file)
@@ -11,7 +11,6 @@
  ***********/
 
 class NetworkSmpiModel;
  ***********/
 
 class NetworkSmpiModel;
-typedef NetworkSmpiModel *NetworkSmpiModelPtr;
 
 /*********
  * Tools *
 
 /*********
  * Tools *
@@ -26,8 +25,8 @@ public:
   NetworkSmpiModel();
   ~NetworkSmpiModel();
 
   NetworkSmpiModel();
   ~NetworkSmpiModel();
 
-  void gapAppend(double size, Link* link, NetworkActionPtr action);
-  void gapRemove(ActionPtr action);
+  void gapAppend(double size, Link* link, NetworkAction *action);
+  void gapRemove(Action *action);
   double latencyFactor(double size);
   double bandwidthFactor(double size);
   double bandwidthConstraint(double rate, double bound, double size);
   double latencyFactor(double size);
   double bandwidthFactor(double size);
   double bandwidthConstraint(double rate, double bound, double size);
index 627ad9b..8be8068 100644 (file)
@@ -50,13 +50,13 @@ XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_energy, surf,
                                 "Logging specific to the SURF energy plugin");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_energy, surf,
                                 "Logging specific to the SURF energy plugin");
 
-std::map<CpuPtr, CpuEnergyPtr> *surf_energy=NULL;
+std::map<Cpu*, CpuEnergy*> *surf_energy=NULL;
 
 
-static void energyCpuCreatedCallback(CpuPtr cpu){
+static void energyCpuCreatedCallback(Cpu *cpu){
   (*surf_energy)[cpu] = new CpuEnergy(cpu);
 }
 
   (*surf_energy)[cpu] = new CpuEnergy(cpu);
 }
 
-static void update_consumption_running(CpuPtr cpu, CpuEnergyPtr cpu_energy) {
+static void update_consumption_running(Cpu *cpu, CpuEnergy *cpu_energy) {
        double cpu_load = lmm_constraint_get_usage(cpu->getConstraint()) / cpu->m_powerPeak;
        double start_time = cpu_energy->last_updated;
        double finish_time = surf_get_clock();
        double cpu_load = lmm_constraint_get_usage(cpu->getConstraint()) / cpu->m_powerPeak;
        double start_time = cpu_energy->last_updated;
        double finish_time = surf_get_clock();
@@ -70,7 +70,7 @@ static void update_consumption_running(CpuPtr cpu, CpuEnergyPtr cpu_energy) {
        XBT_DEBUG("[cpu_update_energy] period=[%.2f-%.2f]; current power peak=%.0E flop/s; consumption change: %.2f J -> %.2f J",
                  start_time, finish_time, cpu->m_powerPeak, previous_energy, energy_this_step);
 }
        XBT_DEBUG("[cpu_update_energy] period=[%.2f-%.2f]; current power peak=%.0E flop/s; consumption change: %.2f J -> %.2f J",
                  start_time, finish_time, cpu->m_powerPeak, previous_energy, energy_this_step);
 }
-static void update_consumption_off(CpuPtr cpu, CpuEnergyPtr cpu_energy) {
+static void update_consumption_off(Cpu *cpu, CpuEnergy *cpu_energy) {
        double start_time = cpu_energy->last_updated;
        double finish_time = surf_get_clock();
 
        double start_time = cpu_energy->last_updated;
        double finish_time = surf_get_clock();
 
@@ -84,11 +84,11 @@ static void update_consumption_off(CpuPtr cpu, CpuEnergyPtr cpu_energy) {
                  start_time, finish_time, previous_energy, energy_this_step);
 }
 
                  start_time, finish_time, previous_energy, energy_this_step);
 }
 
-static void energyCpuDestructedCallback(CpuPtr cpu){
-  std::map<CpuPtr, CpuEnergyPtr>::iterator cpu_energy_it = surf_energy->find(cpu);
+static void energyCpuDestructedCallback(Cpu *cpu){
+  std::map<Cpu*, CpuEnergy*>::iterator cpu_energy_it = surf_energy->find(cpu);
   xbt_assert(cpu_energy_it != surf_energy->end(), "The cpu is not in surf_energy.");
 
   xbt_assert(cpu_energy_it != surf_energy->end(), "The cpu is not in surf_energy.");
 
-  CpuEnergyPtr cpu_energy = cpu_energy_it->second;
+  CpuEnergy *cpu_energy = cpu_energy_it->second;
   if (cpu->getState() == SURF_RESOURCE_OFF)
          update_consumption_off(cpu, cpu_energy);
   else
   if (cpu->getState() == SURF_RESOURCE_OFF)
          update_consumption_off(cpu, cpu_energy);
   else
@@ -99,17 +99,17 @@ static void energyCpuDestructedCallback(CpuPtr cpu){
   surf_energy->erase(cpu_energy_it);
 }
 
   surf_energy->erase(cpu_energy_it);
 }
 
-static void energyCpuActionStateChangedCallback(CpuActionPtr action, e_surf_action_state_t old, e_surf_action_state_t cur){
-  CpuPtr cpu  = getActionCpu(action);
-  CpuEnergyPtr cpu_energy = (*surf_energy)[cpu];
+static void energyCpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t old, e_surf_action_state_t cur){
+  Cpu *cpu  = getActionCpu(action);
+  CpuEnergy *cpu_energy = (*surf_energy)[cpu];
 
   if(cpu_energy->last_updated < surf_get_clock()) {
          update_consumption_running(cpu, cpu_energy);
   }
 }
 
 
   if(cpu_energy->last_updated < surf_get_clock()) {
          update_consumption_running(cpu, cpu_energy);
   }
 }
 
-static void energyStateChangedCallback(CpuPtr cpu, e_surf_resource_state_t oldState, e_surf_resource_state_t newState){
-  CpuEnergyPtr cpu_energy = (*surf_energy)[cpu];
+static void energyStateChangedCallback(Cpu *cpu, e_surf_resource_state_t oldState, e_surf_resource_state_t newState){
+  CpuEnergy *cpu_energy = (*surf_energy)[cpu];
 
   if(cpu_energy->last_updated < surf_get_clock()) {
          if (oldState == SURF_RESOURCE_OFF)
 
   if(cpu_energy->last_updated < surf_get_clock()) {
          if (oldState == SURF_RESOURCE_OFF)
@@ -131,7 +131,7 @@ static void sg_energy_plugin_exit()
  */
 void sg_energy_plugin_init() {
   if (surf_energy == NULL) {
  */
 void sg_energy_plugin_init() {
   if (surf_energy == NULL) {
-    surf_energy = new std::map<CpuPtr, CpuEnergyPtr>();
+    surf_energy = new std::map<Cpu*, CpuEnergy*>();
     surf_callback_connect(cpuCreatedCallbacks, energyCpuCreatedCallback);
     surf_callback_connect(cpuDestructedCallbacks, energyCpuDestructedCallback);
     surf_callback_connect(cpuActionStateChangedCallbacks, energyCpuActionStateChangedCallback);
     surf_callback_connect(cpuCreatedCallbacks, energyCpuCreatedCallback);
     surf_callback_connect(cpuDestructedCallbacks, energyCpuDestructedCallback);
     surf_callback_connect(cpuActionStateChangedCallbacks, energyCpuActionStateChangedCallback);
@@ -143,7 +143,7 @@ void sg_energy_plugin_init() {
 /**
  *
  */
 /**
  *
  */
-CpuEnergy::CpuEnergy(CpuPtr ptr)
+CpuEnergy::CpuEnergy(Cpu *ptr)
  : cpu(ptr)
 {
   total_energy = 0;
  : cpu(ptr)
 {
   total_energy = 0;
@@ -172,14 +172,14 @@ CpuEnergy::~CpuEnergy(){
 double CpuEnergy::getWattMinAt(int pstate) {
   xbt_dynar_t power_range_list = power_range_watts_list;
   xbt_assert(power_range_watts_list, "No power range properties specified for host %s", cpu->getName());
 double CpuEnergy::getWattMinAt(int pstate) {
   xbt_dynar_t power_range_list = power_range_watts_list;
   xbt_assert(power_range_watts_list, "No power range properties specified for host %s", cpu->getName());
-  xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<CpuCas01Ptr>(cpu)->getPState(), xbt_dynar_t);
+  xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<CpuCas01*>(cpu)->getPState(), xbt_dynar_t);
   double min_power = xbt_dynar_get_as(current_power_values, 0, double);
   return min_power;
 }
 double CpuEnergy::getWattMaxAt(int pstate) {
   xbt_dynar_t power_range_list = power_range_watts_list;
   xbt_assert(power_range_watts_list, "No power range properties specified for host %s", cpu->getName());
   double min_power = xbt_dynar_get_as(current_power_values, 0, double);
   return min_power;
 }
 double CpuEnergy::getWattMaxAt(int pstate) {
   xbt_dynar_t power_range_list = power_range_watts_list;
   xbt_assert(power_range_watts_list, "No power range properties specified for host %s", cpu->getName());
-  xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<CpuCas01Ptr>(cpu)->getPState(), xbt_dynar_t);
+  xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<CpuCas01*>(cpu)->getPState(), xbt_dynar_t);
   double max_power = xbt_dynar_get_as(current_power_values, 1, double);
   return max_power;
 }
   double max_power = xbt_dynar_get_as(current_power_values, 1, double);
   return max_power;
 }
@@ -194,7 +194,7 @@ double CpuEnergy::getCurrentWattsValue(double cpu_load)
        xbt_assert(power_range_watts_list, "No power range properties specified for host %s", cpu->getName());
 
     /* retrieve the power values associated with the current pstate */
        xbt_assert(power_range_watts_list, "No power range properties specified for host %s", cpu->getName());
 
     /* retrieve the power values associated with the current pstate */
-    xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<CpuCas01Ptr>(cpu)->getPState(), xbt_dynar_t);
+    xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<CpuCas01*>(cpu)->getPState(), xbt_dynar_t);
 
     /* min_power corresponds to the idle power (cpu load = 0) */
     /* max_power is the power consumed at 100% cpu load       */
 
     /* min_power corresponds to the idle power (cpu load = 0) */
     /* max_power is the power consumed at 100% cpu load       */
index 9b776be..7185b57 100644 (file)
 #define CALLBACK_HPP_
 
 class CpuEnergy;
 #define CALLBACK_HPP_
 
 class CpuEnergy;
-typedef CpuEnergy *CpuEnergyPtr;
 
 
-extern std::map<CpuPtr, CpuEnergyPtr> *surf_energy;
+extern std::map<Cpu*, CpuEnergy*> *surf_energy;
 
 class CpuEnergy {
 public:
 
 class CpuEnergy {
 public:
-  CpuEnergy(CpuPtr ptr);
+  CpuEnergy(Cpu *ptr);
   ~CpuEnergy();
 
   double getCurrentWattsValue(double cpu_load);
   ~CpuEnergy();
 
   double getCurrentWattsValue(double cpu_load);
@@ -30,7 +29,7 @@ public:
   double watts_off;                      /*< Consumption when the machine is turned off (shutdown) */
   double total_energy;                                 /*< Total energy consumed by the host */
   double last_updated;                                 /*< Timestamp of the last energy update event*/
   double watts_off;                      /*< Consumption when the machine is turned off (shutdown) */
   double total_energy;                                 /*< Total energy consumed by the host */
   double last_updated;                                 /*< Timestamp of the last energy update event*/
-  CpuPtr cpu;
+  Cpu *cpu;
 };
 
 #endif /* CALLBACK_HPP_ */
 };
 
 #endif /* CALLBACK_HPP_ */
index 7d6a8b7..996c771 100644 (file)
@@ -18,16 +18,16 @@ int SURF_STORAGE_LEVEL;
 xbt_lib_t storage_type_lib;
 int ROUTING_STORAGE_TYPE_LEVEL; //Routing for storage_type level
 xbt_dynar_t mount_list = NULL;
 xbt_lib_t storage_type_lib;
 int ROUTING_STORAGE_TYPE_LEVEL; //Routing for storage_type level
 xbt_dynar_t mount_list = NULL;
-StorageModelPtr surf_storage_model = NULL;
+StorageModel *surf_storage_model = NULL;
 
 /*************
  * Callbacks *
  *************/
 
 
 /*************
  * Callbacks *
  *************/
 
-surf_callback(void, StoragePtr) storageCreatedCallbacks;
-surf_callback(void, StoragePtr) storageDestructedCallbacks;
-surf_callback(void, StoragePtr, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
-surf_callback(void, StorageActionPtr, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
+surf_callback(void, Storage*) storageCreatedCallbacks;
+surf_callback(void, Storage*) storageDestructedCallbacks;
+surf_callback(void, Storage*, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
+surf_callback(void, StorageAction*, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -49,21 +49,21 @@ StorageModel::~StorageModel(){
  * Resource *
  ************/
 
  * Resource *
  ************/
 
-Storage::Storage(ModelPtr model, const char *name, xbt_dict_t props,
+Storage::Storage(Model *model, const char *name, xbt_dict_t props,
                  const char* type_id, char *content_name, char *content_type,
                  sg_size_t size)
  : Resource(model, name, props)
  , p_contentType(content_type)
  , m_size(size), m_usedSize(0)
  , p_typeId(xbt_strdup(type_id))
                  const char* type_id, char *content_name, char *content_type,
                  sg_size_t size)
  : Resource(model, name, props)
  , p_contentType(content_type)
  , m_size(size), m_usedSize(0)
  , p_typeId(xbt_strdup(type_id))
- , p_writeActions(xbt_dynar_new(sizeof(ActionPtr),NULL))
+ , p_writeActions(xbt_dynar_new(sizeof(Action*),NULL))
 {
   surf_callback_emit(storageCreatedCallbacks, this);
   p_content = parseContent(content_name);
   setState(SURF_RESOURCE_ON);
 }
 
 {
   surf_callback_emit(storageCreatedCallbacks, this);
   p_content = parseContent(content_name);
   setState(SURF_RESOURCE_ON);
 }
 
-Storage::Storage(ModelPtr model, const char *name, xbt_dict_t props,
+Storage::Storage(Model *model, const char *name, xbt_dict_t props,
                  lmm_system_t maxminSystem, double bread, double bwrite,
                  double bconnection, const char* type_id, char *content_name,
                  char *content_type, sg_size_t size, char *attach)
                  lmm_system_t maxminSystem, double bread, double bwrite,
                  double bconnection, const char* type_id, char *content_name,
                  char *content_type, sg_size_t size, char *attach)
@@ -71,7 +71,7 @@ Storage::Storage(ModelPtr model, const char *name, xbt_dict_t props,
  , p_contentType(content_type)
  , m_size(size), m_usedSize(0)
  , p_typeId(xbt_strdup(type_id))
  , p_contentType(content_type)
  , m_size(size), m_usedSize(0)
  , p_typeId(xbt_strdup(type_id))
- , p_writeActions(xbt_dynar_new(sizeof(ActionPtr),NULL)) {
+ , p_writeActions(xbt_dynar_new(sizeof(Action*),NULL)) {
   surf_callback_emit(storageCreatedCallbacks, this);
   p_content = parseContent(content_name);
   p_attach = xbt_strdup(attach);
   surf_callback_emit(storageCreatedCallbacks, this);
   p_content = parseContent(content_name);
   p_attach = xbt_strdup(attach);
@@ -175,15 +175,15 @@ sg_size_t Storage::getUsedSize(){
 /**********
  * Action *
  **********/
 /**********
  * Action *
  **********/
-StorageAction::StorageAction(ModelPtr model, double cost, bool failed,
-                             StoragePtr storage, e_surf_action_storage_type_t type)
+StorageAction::StorageAction(Model *model, double cost, bool failed,
+                             Storage *storage, e_surf_action_storage_type_t type)
 : Action(model, cost, failed)
 , m_type(type), p_storage(storage), p_file(NULL){
   progress = 0;
 };
 
 : Action(model, cost, failed)
 , m_type(type), p_storage(storage), p_file(NULL){
   progress = 0;
 };
 
-StorageAction::StorageAction(ModelPtr model, double cost, bool failed, lmm_variable_t var,
-                             StoragePtr storage, e_surf_action_storage_type_t type)
+StorageAction::StorageAction(Model *model, double cost, bool failed, lmm_variable_t var,
+                             Storage *storage, e_surf_action_storage_type_t type)
   : Action(model, cost, failed, var)
   , m_type(type), p_storage(storage), p_file(NULL){
   progress = 0;
   : Action(model, cost, failed, var)
   , m_type(type), p_storage(storage), p_file(NULL){
   progress = 0;
index 56cd226..241cb67 100644 (file)
@@ -16,13 +16,8 @@ extern xbt_dynar_t mount_list;
  ***********/
 
 class StorageModel;
  ***********/
 
 class StorageModel;
-typedef StorageModel *StorageModelPtr;
-
 class Storage;
 class Storage;
-typedef Storage *StoragePtr;
-
 class StorageAction;
 class StorageAction;
-typedef StorageAction *StorageActionPtr;
 
 /*************
  * Callbacks *
 
 /*************
  * Callbacks *
@@ -30,27 +25,27 @@ typedef StorageAction *StorageActionPtr;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage creation *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage creation *
- * @details Callback functions have the following signature: `void(StoragePtr)`
+ * @details Callback functions have the following signature: `void(Storage*)`
  */
  */
-XBT_PUBLIC_DATA(surf_callback(void, StoragePtr)) storageCreatedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, Storage*)) storageCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage destruction *
  * @details Callback functions have the following signature: `void(StoragePtr)`
  */
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage destruction *
  * @details Callback functions have the following signature: `void(StoragePtr)`
  */
-XBT_PUBLIC_DATA(surf_callback(void, StoragePtr)) storageDestructedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, Storage*)) storageDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage State changed *
- * @details Callback functions have the following signature: `void(StorageActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @details Callback functions have the following signature: `void(StorageAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
  */
-XBT_PUBLIC_DATA(surf_callback(void, StoragePtr, e_surf_resource_state_t, e_surf_resource_state_t)) storageStateChangedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, Storage*, e_surf_resource_state_t, e_surf_resource_state_t)) storageStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after StorageAction State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after StorageAction State changed *
- * @details Callback functions have the following signature: `void(StorageActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
+ * @details Callback functions have the following signature: `void(StorageAction *action, e_surf_action_state_t old, e_surf_action_state_t current)`
  */
  */
-XBT_PUBLIC_DATA(surf_callback(void, StorageActionPtr, e_surf_action_state_t, e_surf_action_state_t)) storageActionStateChangedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, StorageAction*, e_surf_action_state_t, e_surf_action_state_t)) storageActionStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -82,7 +77,7 @@ public:
    * @param attach [description]
    * @return The created Storage
    */
    * @param attach [description]
    * @return The created Storage
    */
-  virtual StoragePtr createStorage(const char* id,
+  virtual Storage *createStorage(const char* id,
                                     const char* type_id,
                                     const char* content_name,
                                     const char* content_type,
                                     const char* type_id,
                                     const char* content_name,
                                     const char* content_type,
@@ -112,7 +107,7 @@ public:
    * @param content_type [description]
    * @param size [description]
    */
    * @param content_type [description]
    * @param size [description]
    */
-  Storage(ModelPtr model, const char *name, xbt_dict_t props,
+  Storage(Model *model, const char *name, xbt_dict_t props,
           const char* type_id, char *content_name, char *content_type,
           sg_size_t size);
 
           const char* type_id, char *content_name, char *content_type,
           sg_size_t size);
 
@@ -132,7 +127,7 @@ public:
    * @param size [description]
    * @param attach [description]
    */
    * @param size [description]
    * @param attach [description]
    */
-  Storage(ModelPtr model, const char *name, xbt_dict_t props,
+  Storage(Model *model, const char *name, xbt_dict_t props,
           lmm_system_t maxminSystem, double bread, double bwrite,
           double bconnection,
           const char* type_id, char *content_name, char *content_type,
           lmm_system_t maxminSystem, double bread, double bwrite,
           double bconnection,
           const char* type_id, char *content_name, char *content_type,
@@ -176,7 +171,7 @@ public:
    *
    * @return The StorageAction corresponding to the opening
    */
    *
    * @return The StorageAction corresponding to the opening
    */
-  virtual StorageActionPtr open(const char* mount, const char* path)=0;
+  virtual StorageAction *open(const char* mount, const char* path)=0;
 
   /**
    * @brief Close a file
 
   /**
    * @brief Close a file
@@ -184,7 +179,7 @@ public:
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
-  virtual StorageActionPtr close(surf_file_t fd)=0;
+  virtual StorageAction *close(surf_file_t fd)=0;
 
   /**
    * @brief Read a file
 
   /**
    * @brief Read a file
@@ -193,7 +188,7 @@ public:
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
    */
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
    */
-  virtual StorageActionPtr read(surf_file_t fd, sg_size_t size)=0;
+  virtual StorageAction *read(surf_file_t fd, sg_size_t size)=0;
 
   /**
    * @brief Write a file
 
   /**
    * @brief Write a file
@@ -202,7 +197,7 @@ public:
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
    */
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
    */
-  virtual StorageActionPtr write(surf_file_t fd, sg_size_t size)=0;
+  virtual StorageAction *write(surf_file_t fd, sg_size_t size)=0;
 
   /**
    * @brief Get the content of the current Storage
 
   /**
    * @brief Get the content of the current Storage
@@ -270,7 +265,7 @@ public:
    * @param storage The Storage associated to this StorageAction
    * @param type [description]
    */
    * @param storage The Storage associated to this StorageAction
    * @param type [description]
    */
-  StorageAction(ModelPtr model, double cost, bool failed, StoragePtr storage,
+  StorageAction(Model *model, double cost, bool failed, Storage *storage,
       e_surf_action_storage_type_t type);
 
     /**
       e_surf_action_storage_type_t type);
 
     /**
@@ -283,13 +278,13 @@ public:
    * @param storage The Storage associated to this StorageAction
    * @param type [description]
    */
    * @param storage The Storage associated to this StorageAction
    * @param type [description]
    */
-  StorageAction(ModelPtr model, double cost, bool failed, lmm_variable_t var,
-      StoragePtr storage, e_surf_action_storage_type_t type);
+  StorageAction(Model *model, double cost, bool failed, lmm_variable_t var,
+      Storage *storage, e_surf_action_storage_type_t type);
 
   void setState(e_surf_action_state_t state);
 
   e_surf_action_storage_type_t m_type;
 
   void setState(e_surf_action_state_t state);
 
   e_surf_action_storage_type_t m_type;
-  StoragePtr p_storage;
+  Storage *p_storage;
   surf_file_t p_file;
   double progress;
 };
   surf_file_t p_file;
   double progress;
 };
index e1dc8f1..3b914b9 100644 (file)
@@ -31,7 +31,7 @@ static XBT_INLINE void routing_storage_type_free(void *r)
 static XBT_INLINE void surf_storage_resource_free(void *r)
 {
   // specific to storage
 static XBT_INLINE void surf_storage_resource_free(void *r)
 {
   // specific to storage
-  StoragePtr storage = static_cast<StoragePtr>(r);
+  Storage *storage = static_cast<Storage*>(r);
   // generic resource
   delete storage;
 }
   // generic resource
   delete storage;
 }
@@ -218,7 +218,7 @@ void surf_storage_model_init_default(void)
 }
 
 StorageN11Model::StorageN11Model() : StorageModel() {
 }
 
 StorageN11Model::StorageN11Model() : StorageModel() {
-  ActionPtr action = NULL;
+  Action *action = NULL;
 
   XBT_DEBUG("surf_storage_model_init_internal");
 
 
   XBT_DEBUG("surf_storage_model_init_internal");
 
@@ -234,7 +234,7 @@ StorageN11Model::~StorageN11Model(){
   storage_running_action_set_that_does_not_need_being_checked = NULL;
 }
 
   storage_running_action_set_that_does_not_need_being_checked = NULL;
 }
 
-StoragePtr StorageN11Model::createStorage(const char* id, const char* type_id,
+Storage *StorageN11Model::createStorage(const char* id, const char* type_id,
     const char* content_name, const char* content_type, xbt_dict_t properties,
     const char* attach)
 {
     const char* content_name, const char* content_type, xbt_dict_t properties,
     const char* attach)
 {
@@ -249,7 +249,7 @@ StoragePtr StorageN11Model::createStorage(const char* id, const char* type_id,
   double Bwrite = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bwrite"));
   double Bconnection   = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bconnection"));
 
   double Bwrite = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bwrite"));
   double Bconnection   = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bconnection"));
 
-  StoragePtr storage = new StorageN11(this, id, properties, p_maxminSystem,
+  Storage *storage = new StorageN11(this, id, properties, p_maxminSystem,
       Bread, Bwrite, Bconnection, type_id, (char *)content_name,
       xbt_strdup(content_type), storage_type->size, (char *) attach);
 
       Bread, Bwrite, Bconnection, type_id, (char *)content_name,
       xbt_strdup(content_type), storage_type->size, (char *) attach);
 
@@ -272,9 +272,9 @@ double StorageN11Model::shareResources(double now)
 {
   XBT_DEBUG("storage_share_resources %f", now);
   unsigned int i, j;
 {
   XBT_DEBUG("storage_share_resources %f", now);
   unsigned int i, j;
-  StoragePtr storage;
+  Storage *storage;
   void *_write_action;
   void *_write_action;
-  StorageActionPtr write_action;
+  StorageAction *write_action;
 
   double min_completion = shareResourcesMaxMin(getRunningActionSet(),
       p_maxminSystem, lmm_solve);
 
   double min_completion = shareResourcesMaxMin(getRunningActionSet(),
       p_maxminSystem, lmm_solve);
@@ -287,7 +287,7 @@ double StorageN11Model::shareResources(double now)
     // Foreach write action on disk
     xbt_dynar_foreach(storage->p_writeActions, j, _write_action)
     {
     // Foreach write action on disk
     xbt_dynar_foreach(storage->p_writeActions, j, _write_action)
     {
-      write_action = static_cast<StorageActionPtr>(_write_action);
+      write_action = static_cast<StorageAction*>(_write_action);
       rate += lmm_variable_getvalue(write_action->getVariable());
     }
     if(rate > 0)
       rate += lmm_variable_getvalue(write_action->getVariable());
     }
     if(rate > 0)
@@ -299,13 +299,13 @@ double StorageN11Model::shareResources(double now)
 
 void StorageN11Model::updateActionsState(double /*now*/, double delta)
 {
 
 void StorageN11Model::updateActionsState(double /*now*/, double delta)
 {
-  StorageActionPtr action = NULL;
+  StorageAction *action = NULL;
 
 
-  ActionListPtr actionSet = getRunningActionSet();
+  ActionList *actionSet = getRunningActionSet();
   for(ActionList::iterator it(actionSet->begin()), itNext=it, itend(actionSet->end())
      ; it != itend ; it=itNext) {
     ++itNext;
   for(ActionList::iterator it(actionSet->begin()), itNext=it, itend(actionSet->end())
      ; it != itend ; it=itNext) {
     ++itNext;
-    action = static_cast<StorageActionPtr>(&*it);
+    action = static_cast<StorageAction*>(&*it);
 
     if(action->m_type == WRITE)
     {
 
     if(action->m_type == WRITE)
     {
@@ -371,7 +371,7 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta)
  * Resource *
  ************/
 
  * Resource *
  ************/
 
-StorageN11::StorageN11(StorageModelPtr model, const char* name,
+StorageN11::StorageN11(StorageModel *model, const char* name,
     xbt_dict_t properties, lmm_system_t maxminSystem, double bread,
     double bwrite, double bconnection, const char* type_id, char *content_name,
     char *content_type, sg_size_t size, char *attach)
     xbt_dict_t properties, lmm_system_t maxminSystem, double bread,
     double bwrite, double bconnection, const char* type_id, char *content_name,
     char *content_type, sg_size_t size, char *attach)
@@ -380,7 +380,7 @@ StorageN11::StorageN11(StorageModelPtr model, const char* name,
   XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size);
 }
 
   XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size);
 }
 
-StorageActionPtr StorageN11::open(const char* mount, const char* path)
+StorageAction *StorageN11::open(const char* mount, const char* path)
 {
   XBT_DEBUG("\tOpen file '%s'",path);
 
 {
   XBT_DEBUG("\tOpen file '%s'",path);
 
@@ -402,22 +402,22 @@ StorageActionPtr StorageN11::open(const char* mount, const char* path)
   file->mount = xbt_strdup(mount);
   file->current_position = 0;
 
   file->mount = xbt_strdup(mount);
   file->current_position = 0;
 
-  StorageActionPtr action = new StorageN11Action(getModel(), 0, getState() != SURF_RESOURCE_ON, this, OPEN);
+  StorageAction *action = new StorageN11Action(getModel(), 0, getState() != SURF_RESOURCE_ON, this, OPEN);
   action->p_file = file;
 
   return action;
 }
 
   action->p_file = file;
 
   return action;
 }
 
-StorageActionPtr StorageN11::close(surf_file_t fd)
+StorageAction *StorageN11::close(surf_file_t fd)
 {
   char *filename = fd->name;
   XBT_DEBUG("\tClose file '%s' size '%llu'", filename, fd->size);
   // unref write actions from storage
   void *_write_action;
 {
   char *filename = fd->name;
   XBT_DEBUG("\tClose file '%s' size '%llu'", filename, fd->size);
   // unref write actions from storage
   void *_write_action;
-  StorageActionPtr write_action;
+  StorageAction *write_action;
   unsigned int i;
   xbt_dynar_foreach(p_writeActions, i, _write_action) {
   unsigned int i;
   xbt_dynar_foreach(p_writeActions, i, _write_action) {
-       write_action = static_cast<StorageActionPtr>(_write_action);
+       write_action = static_cast<StorageAction*>(_write_action);
     if ((write_action->p_file) == fd) {
       xbt_dynar_cursor_rm(p_writeActions, &i);
       write_action->unref();
     if ((write_action->p_file) == fd) {
       xbt_dynar_cursor_rm(p_writeActions, &i);
       write_action->unref();
@@ -426,11 +426,11 @@ StorageActionPtr StorageN11::close(surf_file_t fd)
   free(fd->name);
   free(fd->mount);
   xbt_free(fd);
   free(fd->name);
   free(fd->mount);
   xbt_free(fd);
-  StorageActionPtr action = new StorageN11Action(getModel(), 0, getState() != SURF_RESOURCE_ON, this, CLOSE);
+  StorageAction *action = new StorageN11Action(getModel(), 0, getState() != SURF_RESOURCE_ON, this, CLOSE);
   return action;
 }
 
   return action;
 }
 
-StorageActionPtr StorageN11::read(surf_file_t fd, sg_size_t size)
+StorageAction *StorageN11::read(surf_file_t fd, sg_size_t size)
 {
   if(fd->current_position + size > fd->size){
     size = fd->size - fd->current_position;
 {
   if(fd->current_position + size > fd->size){
     size = fd->size - fd->current_position;
@@ -439,16 +439,16 @@ StorageActionPtr StorageN11::read(surf_file_t fd, sg_size_t size)
   else
     fd->current_position += size;
 
   else
     fd->current_position += size;
 
-  StorageActionPtr action = new StorageN11Action(getModel(), size, getState() != SURF_RESOURCE_ON, this, READ);
+  StorageAction *action = new StorageN11Action(getModel(), size, getState() != SURF_RESOURCE_ON, this, READ);
   return action;
 }
 
   return action;
 }
 
-StorageActionPtr StorageN11::write(surf_file_t fd, sg_size_t size)
+StorageAction *StorageN11::write(surf_file_t fd, sg_size_t size)
 {
   char *filename = fd->name;
   XBT_DEBUG("\tWrite file '%s' size '%llu/%llu'",filename,size,fd->size);
 
 {
   char *filename = fd->name;
   XBT_DEBUG("\tWrite file '%s' size '%llu/%llu'",filename,size,fd->size);
 
-  StorageActionPtr action = new StorageN11Action(getModel(), size, getState() != SURF_RESOURCE_ON, this, WRITE);
+  StorageAction *action = new StorageN11Action(getModel(), size, getState() != SURF_RESOURCE_ON, this, WRITE);
   action->p_file = fd;
   /* Substract the part of the file that might disappear from the used sized on
    * the storage element */
   action->p_file = fd;
   /* Substract the part of the file that might disappear from the used sized on
    * the storage element */
@@ -464,7 +464,7 @@ StorageActionPtr StorageN11::write(surf_file_t fd, sg_size_t size)
  * Action *
  **********/
 
  * Action *
  **********/
 
-StorageN11Action::StorageN11Action(ModelPtr model, double cost, bool failed, StoragePtr storage, e_surf_action_storage_type_t type)
+StorageN11Action::StorageN11Action(Model *model, double cost, bool failed, Storage *storage, e_surf_action_storage_type_t type)
   : StorageAction(model, cost, failed,
                      lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0 , 3),
                      storage, type) {
   : StorageAction(model, cost, failed,
                      lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0 , 3),
                      storage, type) {
@@ -486,7 +486,7 @@ StorageN11Action::StorageN11Action(ModelPtr model, double cost, bool failed, Sto
                getVariable(), 1.0);
 
 //TODO there is something annoying with what's below. Have to sort it out...
                getVariable(), 1.0);
 
 //TODO there is something annoying with what's below. Have to sort it out...
-//    ActionPtr action = this;
+//    Action *action = this;
 //    xbt_dynar_push(storage->p_writeActions, &action);
 //    ref();
     break;
 //    xbt_dynar_push(storage->p_writeActions, &action);
 //    ref();
     break;
index 2ec1123..a65620a 100644 (file)
  ***********/
 
 class StorageN11Model;
  ***********/
 
 class StorageN11Model;
-typedef StorageN11Model *StorageN11ModelPtr;
-
-class StorageN11;
-typedef StorageN11 *StorageN11Ptr;
-
 class StorageN11;
 class StorageN11;
-typedef StorageN11 *StorageN11Ptr;
-
 class StorageN11Action;
 class StorageN11Action;
-typedef StorageN11Action *StorageN11ActionPtr;
-
-class StorageN11Action;
-typedef StorageN11Action *StorageN11ActionPtr;
-
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -37,7 +25,7 @@ class StorageN11Model : public StorageModel {
 public:
   StorageN11Model();
   ~StorageN11Model();
 public:
   StorageN11Model();
   ~StorageN11Model();
-  StoragePtr createStorage(const char* id, const char* type_id,
+  Storage *createStorage(const char* id, const char* type_id,
                   const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach);
   void addTraces(){DIE_IMPOSSIBLE;}
   double shareResources(double now);
                   const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach);
   void addTraces(){DIE_IMPOSSIBLE;}
   double shareResources(double now);
@@ -50,15 +38,15 @@ public:
 
 class StorageN11 : public Storage {
 public:
 
 class StorageN11 : public Storage {
 public:
-  StorageN11(StorageModelPtr model, const char* name, xbt_dict_t properties,
+  StorageN11(StorageModel *model, const char* name, xbt_dict_t properties,
                     lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
                     const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach);
 
                     lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
                     const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach);
 
-  StorageActionPtr open(const char* mount, const char* path);
-  StorageActionPtr close(surf_file_t fd);
-  StorageActionPtr ls(const char *path);
-  StorageActionPtr read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
-  StorageActionPtr write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
+  StorageAction *open(const char* mount, const char* path);
+  StorageAction *close(surf_file_t fd);
+  StorageAction *ls(const char *path);
+  StorageAction *read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param  *??
+  StorageAction *write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param  *??
   void rename(const char *src, const char *dest);
 
   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
   void rename(const char *src, const char *dest);
 
   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
@@ -71,7 +59,7 @@ public:
 
 class StorageN11Action : public StorageAction {
 public:
 
 class StorageN11Action : public StorageAction {
 public:
-  StorageN11Action(ModelPtr model, double cost, bool failed, StoragePtr storage, e_surf_action_storage_type_t type);
+  StorageN11Action(Model *model, double cost, bool failed, Storage *storage, e_surf_action_storage_type_t type);
   void suspend();
   int unref();
   void cancel();
   void suspend();
   int unref();
   void cancel();
index 50f59b4..7d3554e 100644 (file)
@@ -18,12 +18,12 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_kernel);
  * TOOLS *
  *********/
 
  * TOOLS *
  *********/
 
-static HostPtr get_casted_host(surf_resource_t resource){
-  return static_cast<HostPtr>(surf_host_resource_priv(resource));
+static Host *get_casted_host(surf_resource_t resource){
+  return static_cast<Host*>(surf_host_resource_priv(resource));
 }
 
 }
 
-static VMPtr get_casted_vm(surf_resource_t resource){
-  return static_cast<VMPtr>(surf_host_resource_priv(resource));
+static VM *get_casted_vm(surf_resource_t resource){
+  return static_cast<VM*>(surf_host_resource_priv(resource));
 }
 
 char *surf_routing_edge_name(sg_routing_edge_t edge){
 }
 
 char *surf_routing_edge_name(sg_routing_edge_t edge){
@@ -40,8 +40,8 @@ void surf_presolve(void)
   double next_event_date = -1.0;
   tmgr_trace_event_t event = NULL;
   double value = -1.0;
   double next_event_date = -1.0;
   tmgr_trace_event_t event = NULL;
   double value = -1.0;
-  ResourcePtr resource = NULL;
-  ModelPtr model = NULL;
+  Resource *resource = NULL;
+  Model *model = NULL;
   unsigned int iter;
 
   XBT_DEBUG
   unsigned int iter;
 
   XBT_DEBUG
@@ -98,8 +98,8 @@ double surf_solve(double max_date)
   double next_event_date = -1.0;
   double model_next_action_end = -1.0;
   double value = -1.0;
   double next_event_date = -1.0;
   double model_next_action_end = -1.0;
   double value = -1.0;
-  ResourcePtr resource = NULL;
-  ModelPtr model = NULL;
+  Resource *resource = NULL;
+  Model *model = NULL;
   tmgr_trace_event_t event = NULL;
   unsigned int iter;
 
   tmgr_trace_event_t event = NULL;
   unsigned int iter;
 
@@ -119,7 +119,7 @@ double surf_solve(double max_date)
 
   /* sequential version */
   xbt_dynar_foreach(model_list_invoke, iter, model) {
 
   /* sequential version */
   xbt_dynar_foreach(model_list_invoke, iter, model) {
-    surf_share_resources(static_cast<ModelPtr>(model));
+    surf_share_resources(static_cast<Model*>(model));
   }
 
   unsigned i;
   }
 
   unsigned i;
@@ -215,16 +215,16 @@ void routing_get_route_and_latency(sg_routing_edge_t src, sg_routing_edge_t dst,
 surf_model_t surf_resource_model(const void *host, int level) {
   /* If level is SURF_WKS_LEVEL, ws is a host_CLM03 object. It has
    * surf_resource at the generic_resource field. */
 surf_model_t surf_resource_model(const void *host, int level) {
   /* If level is SURF_WKS_LEVEL, ws is a host_CLM03 object. It has
    * surf_resource at the generic_resource field. */
-  ResourcePtr ws = static_cast<ResourcePtr>(xbt_lib_get_level((xbt_dictelm_t) host, level));
+  Resource *ws = static_cast<Resource*>(xbt_lib_get_level((xbt_dictelm_t) host, level));
   return ws->getModel();
 }
 
 void *surf_as_cluster_get_backbone(AS_t as){
   return ws->getModel();
 }
 
 void *surf_as_cluster_get_backbone(AS_t as){
-  return static_cast<AsClusterPtr>(as)->p_backbone;
+  return static_cast<AsCluster*>(as)->p_backbone;
 }
 
 void surf_as_cluster_set_backbone(AS_t as, void* backbone){
 }
 
 void surf_as_cluster_set_backbone(AS_t as, void* backbone){
-  static_cast<AsClusterPtr>(as)->p_backbone = static_cast<Link*>(backbone);
+  static_cast<AsCluster*>(as)->p_backbone = static_cast<Link*>(backbone);
 }
 
 const char *surf_model_name(surf_model_t model){
 }
 
 const char *surf_model_name(surf_model_t model){
@@ -273,7 +273,7 @@ surf_action_t surf_host_model_execute_parallel_task(surf_host_model_t model,
                                             double *flops_amount,
                                             double *bytes_amount,
                                             double rate){
                                             double *flops_amount,
                                             double *bytes_amount,
                                             double rate){
-  return static_cast<ActionPtr>(model->executeParallelTask(host_nb, host_list, flops_amount, bytes_amount, rate));
+  return static_cast<Action*>(model->executeParallelTask(host_nb, host_list, flops_amount, bytes_amount, rate));
 }
 
 surf_action_t surf_host_model_communicate(surf_host_model_t model, surf_resource_t src, surf_resource_t dst, double size, double rate){
 }
 
 surf_action_t surf_host_model_communicate(surf_host_model_t model, surf_resource_t src, surf_resource_t dst, double size, double rate){
@@ -352,18 +352,18 @@ int surf_host_get_pstate(surf_resource_t resource){
 }
 double surf_host_get_wattmin_at(surf_resource_t resource, int pstate){
   xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
 }
 double surf_host_get_wattmin_at(surf_resource_t resource, int pstate){
   xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
-  std::map<CpuPtr, CpuEnergyPtr>::iterator cpuIt = surf_energy->find(get_casted_host(resource)->p_cpu);
+  std::map<Cpu*, CpuEnergy*>::iterator cpuIt = surf_energy->find(get_casted_host(resource)->p_cpu);
   return cpuIt->second->getWattMinAt(pstate);
 }
 double surf_host_get_wattmax_at(surf_resource_t resource, int pstate){
   xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
   return cpuIt->second->getWattMinAt(pstate);
 }
 double surf_host_get_wattmax_at(surf_resource_t resource, int pstate){
   xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
-  std::map<CpuPtr, CpuEnergyPtr>::iterator cpuIt = surf_energy->find(get_casted_host(resource)->p_cpu);
+  std::map<Cpu*, CpuEnergy*>::iterator cpuIt = surf_energy->find(get_casted_host(resource)->p_cpu);
   return cpuIt->second->getWattMaxAt(pstate);
 }
 
 double surf_host_get_consumed_energy(surf_resource_t resource){
   xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
   return cpuIt->second->getWattMaxAt(pstate);
 }
 
 double surf_host_get_consumed_energy(surf_resource_t resource){
   xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
-  std::map<CpuPtr, CpuEnergyPtr>::iterator cpuIt = surf_energy->find(get_casted_host(resource)->p_cpu);
+  std::map<Cpu*, CpuEnergy*>::iterator cpuIt = surf_energy->find(get_casted_host(resource)->p_cpu);
   return cpuIt->second->getConsumedEnergy();
 }
 
   return cpuIt->second->getConsumedEnergy();
 }
 
@@ -420,7 +420,7 @@ xbt_dynar_t surf_host_get_vms(surf_resource_t host){
   xbt_dynar_t vms = get_casted_host(host)->getVms();
   xbt_dynar_t vms_ = xbt_dynar_new(sizeof(sg_host_t), NULL);
   unsigned int cpt;
   xbt_dynar_t vms = get_casted_host(host)->getVms();
   xbt_dynar_t vms_ = xbt_dynar_new(sizeof(sg_host_t), NULL);
   unsigned int cpt;
-  VMPtr vm;
+  VM *vm;
   xbt_dynar_foreach(vms, cpt, vm) {
     sg_host_t vm_ = xbt_lib_get_elm_or_null(host_lib, vm->getName());
     xbt_dynar_push(vms_, &vm_);
   xbt_dynar_foreach(vms, cpt, vm) {
     sg_host_t vm_ = xbt_lib_get_elm_or_null(host_lib, vm->getName());
     xbt_dynar_push(vms_, &vm_);
@@ -439,7 +439,7 @@ void surf_host_set_params(surf_resource_t host, ws_params_t params){
 
 void surf_vm_destroy(surf_resource_t resource){
   /* Before clearing the entries in host_lib, we have to pick up resources. */
 
 void surf_vm_destroy(surf_resource_t resource){
   /* Before clearing the entries in host_lib, we have to pick up resources. */
-  VMPtr vm = get_casted_vm(resource);
+  VM *vm = get_casted_vm(resource);
   char* name = xbt_dict_get_elm_key(resource);
   /* We deregister objects from host_lib, without invoking the freeing callback
    * of each level.
   char* name = xbt_dict_get_elm_key(resource);
   /* We deregister objects from host_lib, without invoking the freeing callback
    * of each level.
@@ -490,23 +490,23 @@ void surf_vm_set_affinity(surf_resource_t vm, surf_resource_t cpu, unsigned long
 }
 
 xbt_dict_t surf_storage_get_content(surf_resource_t resource){
 }
 
 xbt_dict_t surf_storage_get_content(surf_resource_t resource){
-  return static_cast<StoragePtr>(surf_storage_resource_priv(resource))->getContent();
+  return static_cast<Storage*>(surf_storage_resource_priv(resource))->getContent();
 }
 
 sg_size_t surf_storage_get_size(surf_resource_t resource){
 }
 
 sg_size_t surf_storage_get_size(surf_resource_t resource){
-  return static_cast<StoragePtr>(surf_storage_resource_priv(resource))->getSize();
+  return static_cast<Storage*>(surf_storage_resource_priv(resource))->getSize();
 }
 
 sg_size_t surf_storage_get_free_size(surf_resource_t resource){
 }
 
 sg_size_t surf_storage_get_free_size(surf_resource_t resource){
-  return static_cast<StoragePtr>(surf_storage_resource_priv(resource))->getFreeSize();
+  return static_cast<Storage*>(surf_storage_resource_priv(resource))->getFreeSize();
 }
 
 sg_size_t surf_storage_get_used_size(surf_resource_t resource){
 }
 
 sg_size_t surf_storage_get_used_size(surf_resource_t resource){
-  return static_cast<StoragePtr>(surf_storage_resource_priv(resource))->getUsedSize();
+  return static_cast<Storage*>(surf_storage_resource_priv(resource))->getUsedSize();
 }
 
 const char* surf_storage_get_host(surf_resource_t resource){
 }
 
 const char* surf_storage_get_host(surf_resource_t resource){
-  return static_cast<StoragePtr>(surf_storage_resource_priv(resource))->p_attach;
+  return static_cast<Storage*>(surf_storage_resource_priv(resource))->p_attach;
 }
 
 surf_action_t surf_cpu_execute(surf_resource_t cpu, double size){
 }
 
 surf_action_t surf_cpu_execute(surf_resource_t cpu, double size){
@@ -570,11 +570,11 @@ double surf_action_get_cost(surf_action_t action){
 }
 
 void surf_cpu_action_set_affinity(surf_action_t action, surf_resource_t cpu, unsigned long mask) {
 }
 
 void surf_cpu_action_set_affinity(surf_action_t action, surf_resource_t cpu, unsigned long mask) {
-  static_cast<CpuActionPtr>(action)->setAffinity(sg_host_surfcpu(cpu), mask);
+  static_cast<CpuAction*>(action)->setAffinity(sg_host_surfcpu(cpu), mask);
 }
 
 void surf_cpu_action_set_bound(surf_action_t action, double bound) {
 }
 
 void surf_cpu_action_set_bound(surf_action_t action, double bound) {
-  static_cast<CpuActionPtr>(action)->setBound(bound);
+  static_cast<CpuAction*>(action)->setBound(bound);
 }
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
 }
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
@@ -584,5 +584,5 @@ double surf_network_action_get_latency_limited(surf_action_t action) {
 #endif
 
 surf_file_t surf_storage_action_get_file(surf_action_t action){
 #endif
 
 surf_file_t surf_storage_action_get_file(surf_action_t action){
-  return static_cast<StorageActionPtr>(action)->p_file;
+  return static_cast<StorageAction*>(action)->p_file;
 }
 }
index 0399c01..0124e39 100644 (file)
@@ -367,12 +367,12 @@ static XBT_INLINE void surf_link_free(void *r)
 
 static XBT_INLINE void surf_host_free(void *r)
 {
 
 static XBT_INLINE void surf_host_free(void *r)
 {
-  delete static_cast<HostPtr>(r);
+  delete static_cast<Host*>(r);
 }
 
 static XBT_INLINE void surf_storage_free(void *r)
 {
 }
 
 static XBT_INLINE void surf_storage_free(void *r)
 {
-  delete static_cast<StoragePtr>(r);
+  delete static_cast<Storage*>(r);
 }
 
 
 }
 
 
@@ -403,9 +403,9 @@ void surf_init(int *argc, char **argv)
 
   xbt_init(argc, argv);
   if (!model_list)
 
   xbt_init(argc, argv);
   if (!model_list)
-    model_list = xbt_dynar_new(sizeof(ModelPtr), NULL);
+    model_list = xbt_dynar_new(sizeof(Model*), NULL);
   if (!model_list_invoke)
   if (!model_list_invoke)
-    model_list_invoke = xbt_dynar_new(sizeof(ModelPtr), NULL);
+    model_list_invoke = xbt_dynar_new(sizeof(Model*), NULL);
   if (!history)
     history = tmgr_history_new();
 
   if (!history)
     history = tmgr_history_new();
 
@@ -421,7 +421,7 @@ void surf_init(int *argc, char **argv)
 void surf_exit(void)
 {
   unsigned int iter;
 void surf_exit(void)
 {
   unsigned int iter;
-  ModelPtr model = NULL;
+  Model *model = NULL;
 
   TRACE_end();                  /* Just in case it was not called by the upper
                                  * layer (or there is no upper layer) */
 
   TRACE_end();                  /* Just in case it was not called by the upper
                                  * layer (or there is no upper layer) */
@@ -509,7 +509,7 @@ double Model::shareResources(double now)
 
 double Model::shareResourcesLazy(double now)
 {
 
 double Model::shareResourcesLazy(double now)
 {
-  ActionPtr action = NULL;
+  Action *action = NULL;
   double min = -1;
   double share;
 
   double min = -1;
   double share;
 
@@ -588,11 +588,11 @@ double Model::shareResourcesFull(double /*now*/) {
   THROW_UNIMPLEMENTED;
 }
 
   THROW_UNIMPLEMENTED;
 }
 
-double Model::shareResourcesMaxMin(ActionListPtr running_actions,
+double Model::shareResourcesMaxMin(ActionList *running_actions,
                           lmm_system_t sys,
                           void (*solve) (lmm_system_t))
 {
                           lmm_system_t sys,
                           void (*solve) (lmm_system_t))
 {
-  ActionPtr action = NULL;
+  Action *action = NULL;
   double min = -1;
   double value = -1;
 
   double min = -1;
   double value = -1;
 
@@ -671,17 +671,17 @@ Resource::Resource()
 : p_name(NULL), p_properties(NULL), p_model(NULL)
 {}
 
 : p_name(NULL), p_properties(NULL), p_model(NULL)
 {}
 
-Resource::Resource(ModelPtr model, const char *name, xbt_dict_t props)
+Resource::Resource(Model *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)
 {}
 
   : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
   , m_running(true), m_stateCurrent(SURF_RESOURCE_ON)
 {}
 
-Resource::Resource(ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint)
+Resource::Resource(Model *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)
 {}
 
   : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
   , m_running(true), m_stateCurrent(SURF_RESOURCE_ON), p_constraint(constraint)
 {}
 
-Resource::Resource(ModelPtr model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit)
+Resource::Resource(Model *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)
 {}
   : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
   , m_running(true), m_stateCurrent(stateInit)
 {}
@@ -720,7 +720,7 @@ void Resource::turnOff()
   }
 }
 
   }
 }
 
-ModelPtr Resource::getModel() {
+Model *Resource::getModel() {
   return p_model;
 }
 
   return p_model;
 }
 
@@ -751,7 +751,7 @@ const char *surf_action_state_names[6] = {
   "SURF_ACTION_NOT_IN_THE_SYSTEM"
 };
 
   "SURF_ACTION_NOT_IN_THE_SYSTEM"
 };
 
-void Action::initialize(ModelPtr model, double cost, bool failed,
+void Action::initialize(Model *model, double cost, bool failed,
                         lmm_variable_t var)
 {
   m_priority = 1.0;
                         lmm_variable_t var)
 {
   m_priority = 1.0;
@@ -771,7 +771,7 @@ void Action::initialize(ModelPtr model, double cost, bool failed,
   m_hat = NOTSET;
 }
 
   m_hat = NOTSET;
 }
 
-Action::Action(ModelPtr model, double cost, bool failed)
+Action::Action(Model *model, double cost, bool failed)
 {
   initialize(model, cost, failed);
   p_category = NULL;
 {
   initialize(model, cost, failed);
   p_category = NULL;
@@ -785,7 +785,7 @@ Action::Action(ModelPtr model, double cost, bool failed)
   p_stateSet->push_back(*this);
 }
 
   p_stateSet->push_back(*this);
 }
 
-Action::Action(ModelPtr model, double cost, bool failed, lmm_variable_t var)
+Action::Action(Model *model, double cost, bool failed, lmm_variable_t var)
 {
   initialize(model, cost, failed, var);
   p_category = NULL;
 {
   initialize(model, cost, failed, var);
   p_category = NULL;
@@ -995,7 +995,7 @@ void Action::heapUpdate(xbt_heap_t heap, double key, enum heap_action_type hat)
 
 /* added to manage the communication action's heap */
 void surf_action_lmm_update_index_heap(void *action, int i) {
 
 /* added to manage the communication action's heap */
 void surf_action_lmm_update_index_heap(void *action, int i) {
-  ((ActionPtr)action)->updateIndexHeap(i);
+  static_cast<Action*>(action)->updateIndexHeap(i);
 }
 
 void Action::updateIndexHeap(int i) {
 }
 
 void Action::updateIndexHeap(int i) {
@@ -1044,7 +1044,7 @@ void Action::updateRemainingLazy(double now)
     double_update(&m_remains, m_lastValue * delta, sg_surf_precision*sg_maxmin_precision);
 
     if (getModel() == surf_cpu_model_pm && TRACE_is_enabled()) {
     double_update(&m_remains, m_lastValue * delta, sg_surf_precision*sg_maxmin_precision);
 
     if (getModel() == surf_cpu_model_pm && TRACE_is_enabled()) {
-      ResourcePtr cpu = static_cast<ResourcePtr>(lmm_constraint_id(lmm_get_cnst_from_var(getModel()->getMaxminSystem(), getVariable(), 0)));
+      Resource *cpu = static_cast<Resource*>(lmm_constraint_id(lmm_get_cnst_from_var(getModel()->getMaxminSystem(), getVariable(), 0)));
       TRACE_surf_host_set_utilization(cpu->getName(), getCategory(), m_lastValue, m_lastUpdate, now - m_lastUpdate);
     }
     XBT_DEBUG("Updating action(%p): remains is now %f", this, m_remains);
       TRACE_surf_host_set_utilization(cpu->getName(), getCategory(), m_lastValue, m_lastUpdate, now - m_lastUpdate);
     }
     XBT_DEBUG("Updating action(%p): remains is now %f", this, m_remains);
index 95ac8a6..62e74e1 100644 (file)
@@ -68,15 +68,6 @@ int __surf_is_absolute_file_path(const char *file_path);
 /***********
  * Classes *
  ***********/
 /***********
  * Classes *
  ***********/
-//class Model;
-typedef Model* ModelPtr;
-
-//class Resource;
-typedef Resource* ResourcePtr;
-
-//class Action;
-typedef Action* ActionPtr;
-
 typedef boost::intrusive::list<Action> ActionList;
 typedef ActionList* ActionListPtr;
 typedef boost::intrusive::list_base_hook<> actionHook;
 typedef boost::intrusive::list<Action> ActionList;
 typedef ActionList* ActionListPtr;
 typedef boost::intrusive::list_base_hook<> actionHook;
@@ -267,7 +258,7 @@ public:
    * @param name The name of the Resource
    * @param props Dictionary of properties associated to this Resource
    */
    * @param name The name of the Resource
    * @param props Dictionary of properties associated to this Resource
    */
-  Resource(ModelPtr model, const char *name, xbt_dict_t props);
+  Resource(Model *model, const char *name, xbt_dict_t props);
 
   /**
    * @brief Resource constructor
 
   /**
    * @brief Resource constructor
@@ -277,7 +268,7 @@ public:
    * @param props Dictionary of properties associated to this Resource
    * @param constraint The lmm constraint associated to this Resource if it is part of a LMM component
    */
    * @param props Dictionary of properties associated to this Resource
    * @param constraint The lmm constraint associated to this Resource if it is part of a LMM component
    */
-  Resource(ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint);
+  Resource(Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint);
   /**
    * @brief Resource constructor
    *
   /**
    * @brief Resource constructor
    *
@@ -286,7 +277,7 @@ public:
    * @param props Dictionary of properties associated to this Resource
    * @param stateInit the initial state of the Resource
    */
    * @param props Dictionary of properties associated to this Resource
    * @param stateInit the initial state of the Resource
    */
-  Resource(ModelPtr model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit);
+  Resource(Model *model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit);
 
   /**
    * @brief Resource destructor
 
   /**
    * @brief Resource destructor
@@ -298,7 +289,7 @@ public:
    *
    * @return The Model of the current Resource
    */
    *
    * @return The Model of the current Resource
    */
-  ModelPtr getModel();
+  Model *getModel();
 
   /**
    * @brief Get the name of the current Resource
 
   /**
    * @brief Get the name of the current Resource
@@ -364,7 +355,7 @@ public:
 private:
   const char *p_name;
   xbt_dict_t p_properties;
 private:
   const char *p_name;
   xbt_dict_t p_properties;
-  ModelPtr p_model;
+  Model *p_model;
   bool m_running;
   e_surf_resource_state_t m_stateCurrent;
 
   bool m_running;
   e_surf_resource_state_t m_stateCurrent;
 
@@ -394,7 +385,7 @@ private:
   /**
    * @brief Common initializations for the constructors
    */
   /**
    * @brief Common initializations for the constructors
    */
-  void initialize(ModelPtr model, double cost, bool failed,
+  void initialize(Model *model, double cost, bool failed,
                   lmm_variable_t var = NULL);
 
 public:
                   lmm_variable_t var = NULL);
 
 public:
@@ -405,7 +396,7 @@ public:
    * @param cost The cost of the Action
    * @param failed If the action is impossible (e.g.: execute something on a switched off host)
    */
    * @param cost The cost of the Action
    * @param failed If the action is impossible (e.g.: execute something on a switched off host)
    */
-  Action(ModelPtr model, double cost, bool failed);
+  Action(Model *model, double cost, bool failed);
 
   /**
    * @brief Action constructor
 
   /**
    * @brief Action constructor
@@ -415,7 +406,7 @@ public:
    * @param failed If the action is impossible (e.g.: execute something on a switched off host)
    * @param var The lmm variable associated to this Action if it is part of a LMM component
    */
    * @param failed If the action is impossible (e.g.: execute something on a switched off host)
    * @param var The lmm variable associated to this Action if it is part of a LMM component
    */
-  Action(ModelPtr model, double cost, bool failed, lmm_variable_t var);
+  Action(Model *model, double cost, bool failed, lmm_variable_t var);
 
   /**
    * @brief Action destructor
 
   /**
    * @brief Action destructor
@@ -630,7 +621,7 @@ public:
 
   s_xbt_swag_hookup_t p_stateHookup;
 
 
   s_xbt_swag_hookup_t p_stateHookup;
 
-  ModelPtr getModel() {return p_model;}
+  Model *getModel() {return p_model;}
 
 protected:
   ActionListPtr p_stateSet;
 
 protected:
   ActionListPtr p_stateSet;
@@ -649,7 +640,7 @@ private:
   int m_latencyLimited;               /**< Set to 1 if is limited by latency, 0 otherwise */
   #endif
   double    m_cost;
   int m_latencyLimited;               /**< Set to 1 if is limited by latency, 0 otherwise */
   #endif
   double    m_cost;
-  ModelPtr p_model;
+  Model *p_model;
   void *p_data; /**< for your convenience */
 
   /* LMM */
   void *p_data; /**< for your convenience */
 
   /* LMM */
index 1446b55..dbde952 100644 (file)
@@ -46,17 +46,17 @@ static xbt_dict_t random_value = NULL;
  *
  * Routing edges are either host and routers, whatever
  */
  *
  * Routing edges are either host and routers, whatever
  */
-RoutingEdgePtr sg_routing_edge_by_name_or_null(const char *name) {
+RoutingEdge *sg_routing_edge_by_name_or_null(const char *name) {
   sg_host_t h = sg_host_by_name(name);
   sg_host_t h = sg_host_by_name(name);
-  RoutingEdgePtr net_elm = h==NULL?NULL: sg_host_edge(h);
+  RoutingEdge *net_elm = h==NULL?NULL: sg_host_edge(h);
   if (!net_elm)
   if (!net_elm)
-       net_elm = (RoutingEdgePtr) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
+       net_elm = (RoutingEdge*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
   return net_elm;
 }
 
 /* Global vars */
   return net_elm;
 }
 
 /* Global vars */
-RoutingPlatfPtr routing_platf = NULL;
-AsPtr current_routing = NULL;
+RoutingPlatf *routing_platf = NULL;
+As *current_routing = NULL;
 
 /* global parse functions */
 extern xbt_dynar_t mount_list;
 
 /* global parse functions */
 extern xbt_dynar_t mount_list;
@@ -112,7 +112,7 @@ struct s_model_type routing_models[] = {
  */
 static void parse_S_host_link(sg_platf_host_link_cbarg_t host)
 {
  */
 static void parse_S_host_link(sg_platf_host_link_cbarg_t host)
 {
-  RoutingEdgePtr info = sg_host_edge(sg_host_by_name(host->id));
+  RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id));
   xbt_assert(info, "Host '%s' not found!", host->id);
   xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER] ||
       current_routing->p_modelDesc == &routing_models[SURF_MODEL_VIVALDI],
   xbt_assert(info, "Host '%s' not found!", host->id);
   xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER] ||
       current_routing->p_modelDesc == &routing_models[SURF_MODEL_VIVALDI],
@@ -147,7 +147,7 @@ static void parse_S_host(sg_platf_host_cbarg_t host)
   xbt_assert(!sg_host_by_name(host->id),
                     "Reading a host, processing unit \"%s\" already exists", host->id);
 
   xbt_assert(!sg_host_by_name(host->id),
                     "Reading a host, processing unit \"%s\" already exists", host->id);
 
-  RoutingEdgePtr info = new RoutingEdgeImpl(xbt_strdup(host->id),
+  RoutingEdge *info = new RoutingEdgeImpl(xbt_strdup(host->id),
                                                    -1,
                                                    SURF_NETWORK_ELEMENT_HOST,
                                                    current_routing);
                                                    -1,
                                                    SURF_NETWORK_ELEMENT_HOST,
                                                    current_routing);
@@ -191,7 +191,7 @@ static void parse_S_router(sg_platf_router_cbarg_t router)
              "Reading a router, processing unit \"%s\" already exists",
              router->id);
 
              "Reading a router, processing unit \"%s\" already exists",
              router->id);
 
-  RoutingEdgePtr info = new RoutingEdgeImpl(xbt_strdup(router->id),
+  RoutingEdge *info = new RoutingEdgeImpl(xbt_strdup(router->id),
                                             -1,
                                             SURF_NETWORK_ELEMENT_ROUTER,
                                             current_routing);
                                             -1,
                                             SURF_NETWORK_ELEMENT_ROUTER,
                                             current_routing);
@@ -361,13 +361,13 @@ void routing_AS_begin(sg_platf_AS_cbarg_t AS)
   }
 
   /* make a new routing component */
   }
 
   /* make a new routing component */
-  AsPtr new_as = model->create();
+  As *new_as = model->create();
 
   new_as->p_modelDesc = model;
   new_as->p_hierarchy = SURF_ROUTING_NULL;
   new_as->p_name = xbt_strdup(AS->id);
 
 
   new_as->p_modelDesc = model;
   new_as->p_hierarchy = SURF_ROUTING_NULL;
   new_as->p_name = xbt_strdup(AS->id);
 
-  RoutingEdgePtr info = new RoutingEdgeImpl(xbt_strdup(new_as->p_name),
+  RoutingEdge *info = new RoutingEdgeImpl(xbt_strdup(new_as->p_name),
                                             -1,
                                             SURF_NETWORK_ELEMENT_AS,
                                             current_routing);
                                             -1,
                                             SURF_NETWORK_ELEMENT_AS,
                                             current_routing);
@@ -447,15 +447,15 @@ static void elements_father(sg_routing_edge_t src, sg_routing_edge_t dst,
 {
   xbt_assert(src && dst, "bad parameters for \"elements_father\" method");
 #define ELEMENTS_FATHER_MAXDEPTH 16     /* increase if it is not enough */
 {
   xbt_assert(src && dst, "bad parameters for \"elements_father\" method");
 #define ELEMENTS_FATHER_MAXDEPTH 16     /* increase if it is not enough */
-  AsPtr src_as, dst_as;
-  AsPtr path_src[ELEMENTS_FATHER_MAXDEPTH];
-  AsPtr path_dst[ELEMENTS_FATHER_MAXDEPTH];
+  As *src_as, *dst_as;
+  As *path_src[ELEMENTS_FATHER_MAXDEPTH];
+  As *path_dst[ELEMENTS_FATHER_MAXDEPTH];
   int index_src = 0;
   int index_dst = 0;
   int index_src = 0;
   int index_dst = 0;
-  AsPtr current;
-  AsPtr current_src;
-  AsPtr current_dst;
-  AsPtr father;
+  As *current;
+  As *current_src;
+  As *current_dst;
+  As *father;
 
   /* (1) find the as where the src and dst are located */
   sg_routing_edge_t src_data = src;
 
   /* (1) find the as where the src and dst are located */
   sg_routing_edge_t src_data = src;
@@ -515,7 +515,7 @@ static void elements_father(sg_routing_edge_t src, sg_routing_edge_t dst,
  * This function is called by "get_route" and "get_latency". It allows to walk
  * recursively through the ASes tree.
  */
  * This function is called by "get_route" and "get_latency". It allows to walk
  * recursively through the ASes tree.
  */
-static void _get_route_and_latency(RoutingEdgePtr src, RoutingEdgePtr dst,
+static void _get_route_and_latency(RoutingEdge *src, RoutingEdge *dst,
                                    xbt_dynar_t * links, double *latency)
 {
   s_sg_platf_route_cbarg_t route;
                                    xbt_dynar_t * links, double *latency)
 {
   s_sg_platf_route_cbarg_t route;
@@ -525,7 +525,7 @@ static void _get_route_and_latency(RoutingEdgePtr src, RoutingEdgePtr dst,
   XBT_DEBUG("Solve route/latency  \"%s\" to \"%s\"", src->getName(), dst->getName());
 
   /* Find how src and dst are interconnected */
   XBT_DEBUG("Solve route/latency  \"%s\" to \"%s\"", src->getName(), dst->getName());
 
   /* Find how src and dst are interconnected */
-  AsPtr common_father, src_father, dst_father;
+  As *common_father, *src_father, *dst_father;
   elements_father(src, dst, &common_father, &src_father, &dst_father);
   XBT_DEBUG("elements_father: common father '%s' src_father '%s' dst_father '%s'",
       common_father->p_name, src_father->p_name, dst_father->p_name);
   elements_father(src, dst, &common_father, &src_father, &dst_father);
   XBT_DEBUG("elements_father: common father '%s' src_father '%s' dst_father '%s'",
       common_father->p_name, src_father->p_name, dst_father->p_name);
@@ -555,8 +555,8 @@ static void _get_route_and_latency(RoutingEdgePtr src, RoutingEdgePtr dst,
 
   route.link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
   // Find the net_card corresponding to father
 
   route.link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
   // Find the net_card corresponding to father
-  RoutingEdgePtr src_father_net_elm = src_father->p_netElem;
-  RoutingEdgePtr dst_father_net_elm = dst_father->p_netElem;
+  RoutingEdge *src_father_net_elm = src_father->p_netElem;
+  RoutingEdge *dst_father_net_elm = dst_father->p_netElem;
 
   common_father->getRouteAndLatency(src_father_net_elm, dst_father_net_elm,
                                     &route, latency);
 
   common_father->getRouteAndLatency(src_father_net_elm, dst_father_net_elm,
                                     &route, latency);
@@ -602,7 +602,7 @@ e_surf_network_element_type_t surf_routing_edge_get_rc_type(sg_routing_edge_t ed
  * walk through the routing components tree and find a route between hosts
  * by calling the differents "get_route" functions in each routing component.
  */
  * walk through the routing components tree and find a route between hosts
  * by calling the differents "get_route" functions in each routing component.
  */
-void RoutingPlatf::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst,
+void RoutingPlatf::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst,
                                    xbt_dynar_t* route, double *latency)
 {
   XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName());
                                    xbt_dynar_t* route, double *latency)
 {
   XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName());
@@ -621,9 +621,9 @@ xbt_dynar_t RoutingPlatf::getOneLinkRoutes(){
   return recursiveGetOneLinkRoutes(p_root);
 }
 
   return recursiveGetOneLinkRoutes(p_root);
 }
 
-xbt_dynar_t RoutingPlatf::recursiveGetOneLinkRoutes(AsPtr rc)
+xbt_dynar_t RoutingPlatf::recursiveGetOneLinkRoutes(As *rc)
 {
 {
-  xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free_f);
+  xbt_dynar_t ret = xbt_dynar_new(sizeof(Onelink*), xbt_free_f);
 
   //adding my one link routes
   xbt_dynar_t onelink_mine = rc->getOneLinkRoutes();
 
   //adding my one link routes
   xbt_dynar_t onelink_mine = rc->getOneLinkRoutes();
@@ -644,7 +644,7 @@ xbt_dynar_t RoutingPlatf::recursiveGetOneLinkRoutes(AsPtr rc)
 
 e_surf_network_element_type_t routing_get_network_element_type(const char *name)
 {
 
 e_surf_network_element_type_t routing_get_network_element_type(const char *name)
 {
-  RoutingEdgePtr rc = sg_routing_edge_by_name_or_null(name);
+  RoutingEdge *rc = sg_routing_edge_by_name_or_null(name);
   if (rc)
     return rc->getRcType();
 
   if (rc)
     return rc->getRcType();
 
@@ -827,7 +827,7 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
     XBT_DEBUG("<AS id=\"%s\"\trouting=\"Torus_Cluster\">", cluster->id);
     AS.routing = A_surfxml_AS_routing_Cluster___torus;
     sg_platf_new_AS_begin(&AS);
     XBT_DEBUG("<AS id=\"%s\"\trouting=\"Torus_Cluster\">", cluster->id);
     AS.routing = A_surfxml_AS_routing_Cluster___torus;
     sg_platf_new_AS_begin(&AS);
-    ((AsClusterTorusPtr)current_routing)->parse_specific_arguments(cluster);
+    ((AsClusterTorus*)current_routing)->parse_specific_arguments(cluster);
   }
   else if (cluster->topology == SURF_CLUSTER_FAT_TREE) {
     XBT_DEBUG("<AS id=\"%s\"\trouting=\"Fat_Tree_Cluster\">", cluster->id);
   }
   else if (cluster->topology == SURF_CLUSTER_FAT_TREE) {
     XBT_DEBUG("<AS id=\"%s\"\trouting=\"Fat_Tree_Cluster\">", cluster->id);
@@ -843,13 +843,13 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
   }
 
   if(cluster->loopback_bw!=0 || cluster->loopback_lat!=0){
   }
 
   if(cluster->loopback_bw!=0 || cluster->loopback_lat!=0){
-      ((AsClusterPtr)current_routing)->p_nb_links_per_node++;
-      ((AsClusterPtr)current_routing)->p_has_loopback=1;
+      ((AsCluster*)current_routing)->p_nb_links_per_node++;
+      ((AsCluster*)current_routing)->p_has_loopback=1;
   }
 
   if(cluster->limiter_link!=0){
   }
 
   if(cluster->limiter_link!=0){
-      ((AsClusterPtr)current_routing)->p_nb_links_per_node++;
-      ((AsClusterPtr)current_routing)->p_has_limiter=1;
+      ((AsCluster*)current_routing)->p_nb_links_per_node++;
+      ((AsCluster*)current_routing)->p_has_limiter=1;
   }
 
 
   }
 
 
@@ -954,7 +954,7 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
         info_loop.link_up   = Link::byName(tmp_link);
         info_loop.link_down = info_loop.link_up;
         free(tmp_link);
         info_loop.link_up   = Link::byName(tmp_link);
         info_loop.link_down = info_loop.link_up;
         free(tmp_link);
-        xbt_dynar_set(current_routing->p_linkUpDownList, rankId*((AsClusterPtr)current_routing)->p_nb_links_per_node, &info_loop);
+        xbt_dynar_set(current_routing->p_linkUpDownList, rankId*(static_cast<AsCluster*>(current_routing))->p_nb_links_per_node, &info_loop);
       }
 
       //add a limiter link (shared link to account for maximal bandwidth of the node)
       }
 
       //add a limiter link (shared link to account for maximal bandwidth of the node)
@@ -975,7 +975,7 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
         info_lim.link_down = info_lim.link_up;
         free(tmp_link);
         xbt_dynar_set(current_routing->p_linkUpDownList,
         info_lim.link_down = info_lim.link_up;
         free(tmp_link);
         xbt_dynar_set(current_routing->p_linkUpDownList,
-            rankId*((AsClusterPtr)current_routing)->p_nb_links_per_node + ((AsClusterPtr)current_routing)->p_has_loopback ,
+            rankId*(static_cast<AsCluster*>(current_routing))->p_nb_links_per_node + static_cast<AsCluster*>(current_routing)->p_has_loopback ,
             &info_lim);
 
       }
             &info_lim);
 
       }
@@ -986,10 +986,10 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
         ((AsClusterFatTree*) current_routing)->addProcessingNode(i);
       }
       else {
         ((AsClusterFatTree*) current_routing)->addProcessingNode(i);
       }
       else {
-      ((AsClusterPtr)current_routing)->create_links_for_node(cluster, i, rankId, rankId*
-          ((AsClusterPtr)current_routing)->p_nb_links_per_node
-          + ((AsClusterPtr)current_routing)->p_has_loopback
-          + ((AsClusterPtr)current_routing)->p_has_limiter );
+      static_cast<AsCluster*>(current_routing)->create_links_for_node(cluster, i, rankId, rankId*
+                 static_cast<AsCluster*>(current_routing)->p_nb_links_per_node
+          + static_cast<AsCluster*>(current_routing)->p_has_loopback
+          + static_cast<AsCluster*>(current_routing)->p_has_limiter );
       }
       xbt_free(link_id);
       xbt_free(host_id);
       }
       xbt_free(link_id);
       xbt_free(host_id);
@@ -1002,7 +1002,7 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
 
   // For fat trees, the links must be created once all nodes have been added
   if(cluster->topology == SURF_CLUSTER_FAT_TREE) {
 
   // For fat trees, the links must be created once all nodes have been added
   if(cluster->topology == SURF_CLUSTER_FAT_TREE) {
-    ((AsClusterFatTree*)current_routing)->create_links();
+    static_cast<AsClusterFatTree*>(current_routing)->create_links();
   }
   // Add a router. It is magically used thanks to the way in which surf_routing_cluster is written,
   // and it's very useful to connect clusters together
   }
   // Add a router. It is magically used thanks to the way in which surf_routing_cluster is written,
   // and it's very useful to connect clusters together
@@ -1018,7 +1018,7 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
         bprintf("%s%s_router%s", cluster->prefix, cluster->id,
                 cluster->suffix);
   sg_platf_new_router(&router);
         bprintf("%s%s_router%s", cluster->prefix, cluster->id,
                 cluster->suffix);
   sg_platf_new_router(&router);
-  ((AsClusterPtr)current_routing)->p_router = (RoutingEdgePtr) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL);
+  ((AsCluster*)current_routing)->p_router = (RoutingEdge*) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL);
   free(newid);
 
   //Make the backbone
   free(newid);
 
   //Make the backbone
@@ -1121,7 +1121,7 @@ static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
   router.id = router_id;
   router.coord = peer->coord;
   sg_platf_new_router(&router);
   router.id = router_id;
   router.coord = peer->coord;
   sg_platf_new_router(&router);
-  static_cast<AsClusterPtr>(current_routing)->p_router = static_cast<RoutingEdgePtr>(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL));
+  static_cast<AsCluster*>(current_routing)->p_router = static_cast<RoutingEdge*>(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL));
 
   XBT_DEBUG("</AS>");
   sg_platf_new_AS_end();
 
   XBT_DEBUG("</AS>");
   sg_platf_new_AS_end();
@@ -1260,10 +1260,10 @@ static void check_disk_attachment()
   xbt_lib_cursor_t cursor;
   char *key;
   void **data;
   xbt_lib_cursor_t cursor;
   char *key;
   void **data;
-  RoutingEdgePtr host_elm;
+  RoutingEdge *host_elm;
   xbt_lib_foreach(storage_lib, cursor, key, data) {
     if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
   xbt_lib_foreach(storage_lib, cursor, key, data) {
     if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
-         StoragePtr storage = static_cast<StoragePtr>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
+         Storage *storage = static_cast<Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
          host_elm = sg_routing_edge_by_name_or_null(storage->p_attach);
          if(!host_elm)
                  surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
          host_elm = sg_routing_edge_by_name_or_null(storage->p_attach);
          if(!host_elm)
                  surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
@@ -1306,7 +1306,7 @@ void routing_register_callbacks()
  * This fuction is call by "finalize". It allow to finalize the
  * AS or routing components. It delete all the structures.
  */
  * This fuction is call by "finalize". It allow to finalize the
  * AS or routing components. It delete all the structures.
  */
-static void finalize_rec(AsPtr as) {
+static void finalize_rec(As *as) {
   xbt_dict_cursor_t cursor = NULL;
   char *key;
   AS_t elem;
   xbt_dict_cursor_t cursor = NULL;
   char *key;
   AS_t elem;
@@ -1333,15 +1333,15 @@ AS_t surf_AS_get_routing_root() {
   return routing_platf->p_root;
 }
 
   return routing_platf->p_root;
 }
 
-const char *surf_AS_get_name(AsPtr as) {
+const char *surf_AS_get_name(As *as) {
   return as->p_name;
 }
 
   return as->p_name;
 }
 
-static AsPtr surf_AS_recursive_get_by_name(AsPtr current, const char * name) {
+static As *surf_AS_recursive_get_by_name(As *current, const char * name) {
   xbt_dict_cursor_t cursor = NULL;
   char *key;
   AS_t elem;
   xbt_dict_cursor_t cursor = NULL;
   char *key;
   AS_t elem;
-  AsPtr tmp = NULL;
+  As *tmp = NULL;
 
   if(!strcmp(current->p_name, name))
     return current;
 
   if(!strcmp(current->p_name, name))
     return current;
@@ -1356,22 +1356,22 @@ static AsPtr surf_AS_recursive_get_by_name(AsPtr current, const char * name) {
 }
 
 
 }
 
 
-AsPtr surf_AS_get_by_name(const char * name) {
-  AsPtr as = surf_AS_recursive_get_by_name(routing_platf->p_root, name);
+As *surf_AS_get_by_name(const char * name) {
+  As *as = surf_AS_recursive_get_by_name(routing_platf->p_root, name);
   if(as == NULL)
     XBT_WARN("Impossible to find an AS with name %s, please check your input", name);
   return as;
 }
 
   if(as == NULL)
     XBT_WARN("Impossible to find an AS with name %s, please check your input", name);
   return as;
 }
 
-xbt_dict_t surf_AS_get_routing_sons(AsPtr as) {
+xbt_dict_t surf_AS_get_routing_sons(As *as) {
   return as->p_routingSons;
 }
 
   return as->p_routingSons;
 }
 
-const char *surf_AS_get_model(AsPtr as) {
+const char *surf_AS_get_model(As *as) {
   return as->p_modelDesc->name;
 }
 
   return as->p_modelDesc->name;
 }
 
-xbt_dynar_t surf_AS_get_hosts(AsPtr as) {
+xbt_dynar_t surf_AS_get_hosts(As *as) {
   xbt_dynar_t elms = as->p_indexNetworkElm;
   sg_routing_edge_t relm;
   xbt_dictelm_t delm;
   xbt_dynar_t elms = as->p_indexNetworkElm;
   sg_routing_edge_t relm;
   xbt_dictelm_t delm;
@@ -1379,7 +1379,7 @@ xbt_dynar_t surf_AS_get_hosts(AsPtr as) {
   int count = xbt_dynar_length(elms);
   xbt_dynar_t res =  xbt_dynar_new(sizeof(xbt_dictelm_t), NULL);
   for (index = 0; index < count; index++) {
   int count = xbt_dynar_length(elms);
   xbt_dynar_t res =  xbt_dynar_new(sizeof(xbt_dictelm_t), NULL);
   for (index = 0; index < count; index++) {
-     relm = xbt_dynar_get_as(elms, index, RoutingEdgePtr);
+     relm = xbt_dynar_get_as(elms, index, RoutingEdge*);
      delm = xbt_lib_get_elm_or_null(host_lib, relm->getName());
      if (delm!=NULL) {
        xbt_dynar_push(res, &delm);
      delm = xbt_lib_get_elm_or_null(host_lib, relm->getName());
      if (delm!=NULL) {
        xbt_dynar_push(res, &delm);
index 0980e57..6877e4c 100644 (file)
@@ -21,34 +21,25 @@ xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xb
  * Classes *
  ***********/
 
  * Classes *
  ***********/
 
-/* Note: As and RoutingEdge are declared as struct instead of class, to keep
-   compatibility with C files where they are mentioned. */
-struct As;
-typedef As *AsPtr;
-
+class As;
 class RoutingModelDescription;
 class RoutingModelDescription;
-typedef RoutingModelDescription *RoutingModelDescriptionPtr;
-
 class Onelink;
 class Onelink;
-typedef Onelink *OnelinkPtr;
-
 class RoutingPlatf;
 class RoutingPlatf;
-typedef RoutingPlatf *RoutingPlatfPtr;
 
 /** @ingroup SURF_routing_interface
  * @brief The Autonomous System (AS) routing interface
  * @details [TODO]
  */
 
 /** @ingroup SURF_routing_interface
  * @brief The Autonomous System (AS) routing interface
  * @details [TODO]
  */
-struct As {
+class As {
 public:
   xbt_dynar_t p_indexNetworkElm;
   xbt_dict_t p_bypassRoutes;    /* store bypass routes */
   routing_model_description_t p_modelDesc;
   e_surf_routing_hierarchy_t p_hierarchy;
   char *p_name;
 public:
   xbt_dynar_t p_indexNetworkElm;
   xbt_dict_t p_bypassRoutes;    /* store bypass routes */
   routing_model_description_t p_modelDesc;
   e_surf_routing_hierarchy_t p_hierarchy;
   char *p_name;
-  AsPtr p_routingFather;
+  As *p_routingFather;
   xbt_dict_t p_routingSons;
   xbt_dict_t p_routingSons;
-  RoutingEdgePtr p_netElem;
+  RoutingEdge *p_netElem;
   xbt_dynar_t p_linkUpDownList;
 
   /**
   xbt_dynar_t p_linkUpDownList;
 
   /**
@@ -72,17 +63,17 @@ public:
    * @param into [description]
    * @param latency [description]
    */
    * @param into [description]
    * @param latency [description]
    */
-  virtual void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t into, double *latency)=0;
+  virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency)=0;
   virtual xbt_dynar_t getOneLinkRoutes()=0;
   virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)=0;
   virtual xbt_dynar_t getOneLinkRoutes()=0;
   virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)=0;
-  virtual sg_platf_route_cbarg_t getBypassRoute(RoutingEdgePtr src, RoutingEdgePtr dst, double *lat)=0;
+  virtual sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat)=0;
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
-  virtual int parsePU(RoutingEdgePtr elm)=0; /* A host or a router, whatever */
-  virtual int parseAS( RoutingEdgePtr elm)=0;
+  virtual int parsePU(RoutingEdge *elm)=0; /* A host or a router, whatever */
+  virtual int parseAS( RoutingEdge *elm)=0;
   virtual void parseRoute(sg_platf_route_cbarg_t route)=0;
   virtual void parseASroute(sg_platf_route_cbarg_t route)=0;
   virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
   virtual void parseRoute(sg_platf_route_cbarg_t route)=0;
   virtual void parseASroute(sg_platf_route_cbarg_t route)=0;
   virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
@@ -99,13 +90,13 @@ public:
   virtual int *getIdPtr()=0;
   virtual void setId(int id)=0;
   virtual char *getName()=0;
   virtual int *getIdPtr()=0;
   virtual void setId(int id)=0;
   virtual char *getName()=0;
-  virtual AsPtr getRcComponent()=0;
+  virtual As *getRcComponent()=0;
   virtual e_surf_network_element_type_t getRcType()=0;
 };
 
 struct RoutingEdgeImpl : public RoutingEdge {
 public:
   virtual e_surf_network_element_type_t getRcType()=0;
 };
 
 struct RoutingEdgeImpl : public RoutingEdge {
 public:
-  RoutingEdgeImpl(char *name, int id, e_surf_network_element_type_t rcType, AsPtr rcComponent)
+  RoutingEdgeImpl(char *name, int id, e_surf_network_element_type_t rcType, As *rcComponent)
   : p_rcComponent(rcComponent), p_rcType(rcType), m_id(id), p_name(name) {}
   ~RoutingEdgeImpl() { xbt_free(p_name);};
 
   : p_rcComponent(rcComponent), p_rcType(rcType), m_id(id), p_name(name) {}
   ~RoutingEdgeImpl() { xbt_free(p_name);};
 
@@ -113,10 +104,10 @@ public:
   int *getIdPtr() {return &m_id;}
   void setId(int id) {m_id = id;}
   char *getName() {return p_name;}
   int *getIdPtr() {return &m_id;}
   void setId(int id) {m_id = id;}
   char *getName() {return p_name;}
-  AsPtr getRcComponent() {return p_rcComponent;}
+  As *getRcComponent() {return p_rcComponent;}
   e_surf_network_element_type_t getRcType() {return p_rcType;}
 private:
   e_surf_network_element_type_t getRcType() {return p_rcType;}
 private:
-  AsPtr p_rcComponent;
+  As *p_rcComponent;
   e_surf_network_element_type_t p_rcType;
   int m_id;
   char *p_name;
   e_surf_network_element_type_t p_rcType;
   int m_id;
   char *p_name;
@@ -130,7 +121,7 @@ public:
   int *getIdPtr() {return p_re->getIdPtr();}
   void setId(int id) {p_re->setId(id);}
   char *getName() {return p_re->getName();}
   int *getIdPtr() {return p_re->getIdPtr();}
   void setId(int id) {p_re->setId(id);}
   char *getName() {return p_re->getName();}
-  AsPtr getRcComponent() {return p_re->getRcComponent();}
+  As *getRcComponent() {return p_re->getRcComponent();}
   e_surf_network_element_type_t getRcType() {return p_re->getRcType();}
 private:
   RoutingEdge *p_re;
   e_surf_network_element_type_t getRcType() {return p_re->getRcType();}
 private:
   RoutingEdge *p_re;
@@ -141,10 +132,10 @@ private:
  */
 class Onelink {
 public:
  */
 class Onelink {
 public:
-  Onelink(void *link, RoutingEdgePtr src, RoutingEdgePtr dst)
+  Onelink(void *link, RoutingEdge *src, RoutingEdge *dst)
     : p_src(src), p_dst(dst), p_link(link) {};
     : p_src(src), p_dst(dst), p_link(link) {};
-  RoutingEdgePtr p_src;
-  RoutingEdgePtr p_dst;
+  RoutingEdge *p_src;
+  RoutingEdge *p_dst;
   void *p_link;
 };
 
   void *p_link;
 };
 
@@ -154,12 +145,12 @@ public:
 XBT_PUBLIC_CLASS RoutingPlatf {
 public:
   ~RoutingPlatf();
 XBT_PUBLIC_CLASS RoutingPlatf {
 public:
   ~RoutingPlatf();
-  AsPtr p_root;
+  As *p_root;
   void *p_loopback;
   xbt_dynar_t p_lastRoute;
   xbt_dynar_t getOneLinkRoutes(void);
   void *p_loopback;
   xbt_dynar_t p_lastRoute;
   xbt_dynar_t getOneLinkRoutes(void);
-  xbt_dynar_t recursiveGetOneLinkRoutes(AsPtr rc);
-  void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, xbt_dynar_t * links, double *latency);
+  xbt_dynar_t recursiveGetOneLinkRoutes(As *rc);
+  void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, xbt_dynar_t * links, double *latency);
 };
 
 #endif /* NETWORK_ROUTING_HPP_ */
 };
 
 #endif /* NETWORK_ROUTING_HPP_ */
index c928779..5a0dab9 100644 (file)
@@ -29,7 +29,7 @@ AsCluster::AsCluster() : AsNone()
 }
 
 /* Business methods */
 }
 
 /* Business methods */
-void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t route, double *lat)
+void AsCluster::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat)
 {
   s_surf_parsing_link_up_down_t info;
   XBT_VERB("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]",
 {
   s_surf_parsing_link_up_down_t info;
   XBT_VERB("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]",
@@ -61,7 +61,7 @@ void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
   }
 
   if (p_backbone) {
   }
 
   if (p_backbone) {
-    xbt_dynar_push_as(route->link_list, void *, static_cast<ResourcePtr>(p_backbone));
+    xbt_dynar_push_as(route->link_list, void *, static_cast<Resource*>(p_backbone));
     if (lat)
       *lat += p_backbone->getLatency();
   }
     if (lat)
       *lat += p_backbone->getLatency();
   }
@@ -86,7 +86,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
   int isrc;
   int table_size = xbt_dynar_length(p_indexNetworkElm);
 
   int isrc;
   int table_size = xbt_dynar_length(p_indexNetworkElm);
 
-  RoutingEdgePtr src;
+  RoutingEdge *src;
   xbt_node_t current, previous, backboneNode = NULL, routerNode;
   s_surf_parsing_link_up_down_t info;
 
   xbt_node_t current, previous, backboneNode = NULL, routerNode;
   s_surf_parsing_link_up_down_t info;
 
@@ -104,7 +104,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
   }
 
   for (isrc = 0; isrc < table_size; isrc++) {
   }
 
   for (isrc = 0; isrc < table_size; isrc++) {
-    src = xbt_dynar_get_as(p_indexNetworkElm, isrc, RoutingEdgePtr);
+    src = xbt_dynar_get_as(p_indexNetworkElm, isrc, RoutingEdge*);
 
     if (src->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) {
       previous = new_xbt_graph_node(graph, src->getName(), nodes);
 
     if (src->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) {
       previous = new_xbt_graph_node(graph, src->getName(), nodes);
@@ -113,7 +113,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 
       if (info.link_up) {     // link up
 
 
       if (info.link_up) {     // link up
 
-        const char *link_name = static_cast<ResourcePtr>(info.link_up)->getName();
+        const char *link_name = static_cast<Resource*>(info.link_up)->getName();
         current = new_xbt_graph_node(graph, link_name, nodes);
         new_xbt_graph_edge(graph, previous, current, edges);
 
         current = new_xbt_graph_node(graph, link_name, nodes);
         new_xbt_graph_edge(graph, previous, current, edges);
 
@@ -126,7 +126,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
       }
 
       if (info.link_down) {    // link down
       }
 
       if (info.link_down) {    // link down
-        const char *link_name = static_cast<ResourcePtr>(info.link_down)->getName();
+        const char *link_name = static_cast<Resource*>(info.link_down)->getName();
         current = new_xbt_graph_node(graph, link_name, nodes);
         new_xbt_graph_edge(graph, previous, current, edges);
 
         current = new_xbt_graph_node(graph, link_name, nodes);
         new_xbt_graph_edge(graph, previous, current, edges);
 
@@ -169,15 +169,15 @@ void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id,
   xbt_free(link_id);
 }
 
   xbt_free(link_id);
 }
 
-int AsCluster::parsePU(RoutingEdgePtr elm) {
+int AsCluster::parsePU(RoutingEdge *elm) {
   XBT_DEBUG("Load process unit \"%s\"", elm->getName());
   XBT_DEBUG("Load process unit \"%s\"", elm->getName());
-  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdgePtr, elm);
+  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
   return xbt_dynar_length(p_indexNetworkElm)-1;
 }
 
   return xbt_dynar_length(p_indexNetworkElm)-1;
 }
 
-int AsCluster::parseAS(RoutingEdgePtr elm) {
+int AsCluster::parseAS(RoutingEdge *elm) {
   XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
   XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
-  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdgePtr, elm);
+  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
   return xbt_dynar_length(p_indexNetworkElm)-1;
 }
 
   return xbt_dynar_length(p_indexNetworkElm)-1;
 }
 
index da24d6a..f87953e 100644 (file)
@@ -14,7 +14,6 @@
  * Classes *
  ***********/
 class AsCluster;
  * Classes *
  ***********/
 class AsCluster;
-typedef AsCluster *AsClusterPtr;
 
 
 /* ************************************************** */
 
 
 /* ************************************************** */
@@ -24,24 +23,24 @@ class AsCluster: public AsNone {
 public:
   AsCluster();
 
 public:
   AsCluster();
 
-  virtual void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t into, double *latency);
+  virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency);
   //xbt_dynar_t getOneLinkRoutes();
   //void parseRoute(sg_platf_route_cbarg_t route);
   //void parseASroute(sg_platf_route_cbarg_t route);
 
   void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
   //xbt_dynar_t getOneLinkRoutes();
   //void parseRoute(sg_platf_route_cbarg_t route);
   //void parseASroute(sg_platf_route_cbarg_t route);
 
   void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdgePtr src, RoutingEdgePtr dst, double *lat);
+  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
-  int parsePU(RoutingEdgePtr elm); /* A host or a router, whatever */
-  int parseAS(RoutingEdgePtr elm);
+  int parsePU(RoutingEdge *elm); /* A host or a router, whatever */
+  int parseAS(RoutingEdge *elm);
   virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
   Link* p_backbone;
   void *p_loopback;
   virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
   Link* p_backbone;
   void *p_loopback;
-  RoutingEdgePtr p_router;
+  RoutingEdge *p_router;
   int p_has_limiter;
   int p_has_loopback;
   int p_nb_links_per_node;
   int p_has_limiter;
   int p_has_loopback;
   int p_nb_links_per_node;
index 7e55877..fc58a79 100644 (file)
@@ -47,8 +47,8 @@ bool AsClusterFatTree::isInSubTree(FatTreeNode *root, FatTreeNode *node) {
   return true;
 }
 
   return true;
 }
 
-void AsClusterFatTree::getRouteAndLatency(RoutingEdgePtr src,
-                                          RoutingEdgePtr dst,
+void AsClusterFatTree::getRouteAndLatency(RoutingEdge *src,
+                                          RoutingEdge *dst,
                                           sg_platf_route_cbarg_t into,
                                           double *latency) {
   FatTreeNode *source, *destination, *currentNode;
                                           sg_platf_route_cbarg_t into,
                                           double *latency) {
   FatTreeNode *source, *destination, *currentNode;
index 1b3c460..9435ca9 100644 (file)
@@ -111,7 +111,7 @@ class AsClusterFatTree : public AsCluster {
 public:
   AsClusterFatTree();
   ~AsClusterFatTree();
 public:
   AsClusterFatTree();
   ~AsClusterFatTree();
-  virtual void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst,
+  virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst,
                                   sg_platf_route_cbarg_t into,
                                   double *latency);
 
                                   sg_platf_route_cbarg_t into,
                                   double *latency);
 
index 9377aa2..d6a33a5 100644 (file)
@@ -118,7 +118,7 @@ void AsClusterTorus::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster){
     xbt_dynar_free(&dimensions);
 }
 
     xbt_dynar_free(&dimensions);
 }
 
-void AsClusterTorus::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t route, double *lat){
+void AsClusterTorus::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat){
 
   XBT_VERB("torus_get_route_and_latency from '%s'[%d] to '%s'[%d]",
                src->getName(), src->getId(),
 
   XBT_VERB("torus_get_route_and_latency from '%s'[%d] to '%s'[%d]",
                src->getName(), src->getId(),
index 86e9a20..a9ab794 100644 (file)
 #ifndef SURF_ROUTING_CLUSTER_TORUS_HPP_
 #define SURF_ROUTING_CLUSTER_TORUS_HPP_
 
 #ifndef SURF_ROUTING_CLUSTER_TORUS_HPP_
 #define SURF_ROUTING_CLUSTER_TORUS_HPP_
 
-class AsClusterTorus;
-typedef AsClusterTorus *AsClusterTorusPtr;
-
-
 class AsClusterTorus: public AsCluster {
 public:
    AsClusterTorus();
    virtual ~AsClusterTorus();
    virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
 class AsClusterTorus: public AsCluster {
 public:
    AsClusterTorus();
    virtual ~AsClusterTorus();
    virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
-   virtual void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t into, double *latency);
+   virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency);
    void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster);
 
 
    void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster);
 
 
index 57d39b9..f6d146d 100644 (file)
@@ -48,7 +48,7 @@ AS_t model_dijkstracache_create(void){
 
 void model_dijkstra_both_end(AS_t as)
 {
 
 void model_dijkstra_both_end(AS_t as)
 {
-  AsDijkstraPtr THIS_AS = static_cast<AsDijkstraPtr>(as);
+  AsDijkstra *THIS_AS = static_cast<AsDijkstra*>(as);
   xbt_node_t node = NULL;
   unsigned int cursor2;
   xbt_dynar_t nodes = NULL;
   xbt_node_t node = NULL;
   unsigned int cursor2;
   xbt_dynar_t nodes = NULL;
@@ -176,23 +176,23 @@ void AsDijkstra::addLoopback() {
 
 xbt_dynar_t AsDijkstra::getOnelinkRoutes()
 {
 
 xbt_dynar_t AsDijkstra::getOnelinkRoutes()
 {
-  xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free_f);
+  xbt_dynar_t ret = xbt_dynar_new(sizeof(Onelink*), xbt_free_f);
   sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t,1);
   route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t),NULL);
 
   int src,dst;
   sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t,1);
   route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t),NULL);
 
   int src,dst;
-  RoutingEdgePtr src_elm, dst_elm;
+  RoutingEdge *src_elm, *dst_elm;
   int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
   for(src=0; src < table_size; src++) {
     for(dst=0; dst< table_size; dst++) {
       xbt_dynar_reset(route->link_list);
   int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
   for(src=0; src < table_size; src++) {
     for(dst=0; dst< table_size; dst++) {
       xbt_dynar_reset(route->link_list);
-      src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdgePtr);
-      dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdgePtr);
+      src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdge*);
+      dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdge*);
       this->getRouteAndLatency(src_elm, dst_elm,route, NULL);
 
       if (xbt_dynar_length(route->link_list) == 1) {
         void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
       this->getRouteAndLatency(src_elm, dst_elm,route, NULL);
 
       if (xbt_dynar_length(route->link_list) == 1) {
         void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
-        OnelinkPtr onelink;
+        Onelink *onelink;
         if (p_hierarchy == SURF_ROUTING_BASE)
           onelink = new Onelink(link, src_elm, dst_elm);
         else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
         if (p_hierarchy == SURF_ROUTING_BASE)
           onelink = new Onelink(link, src_elm, dst_elm);
         else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
@@ -206,7 +206,7 @@ xbt_dynar_t AsDijkstra::getOnelinkRoutes()
   return ret;
 }
 
   return ret;
 }
 
-void AsDijkstra::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t route, double *lat)
+void AsDijkstra::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat)
 {
 
   /* set utils vars */
 {
 
   /* set utils vars */
@@ -330,8 +330,8 @@ void AsDijkstra::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_p
   }
 
   /* compose route path with links */
   }
 
   /* compose route path with links */
-  RoutingEdgePtr gw_src = NULL, gw_dst, prev_gw_src, first_gw = NULL;
-  RoutingEdgePtr gw_dst_net_elm = NULL, prev_gw_src_net_elm = NULL;
+  RoutingEdge *gw_src = NULL, *gw_dst, *prev_gw_src, *first_gw = NULL;
+  RoutingEdge *gw_dst_net_elm = NULL, *prev_gw_src_net_elm = NULL;
 
   for (v = dst_node_id; v != src_node_id; v = pred_arr[v]) {
     xbt_node_t node_pred_v =
 
   for (v = dst_node_id; v != src_node_id; v = pred_arr[v]) {
     xbt_node_t node_pred_v =
@@ -480,7 +480,7 @@ void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route)
       surf_parse_error("The gw_src '%s' does not exist!",route->gw_src->getName());
   }
 
       surf_parse_error("The gw_src '%s' does not exist!",route->gw_src->getName());
   }
 
-  RoutingEdgePtr src_net_elm, dst_net_elm;
+  RoutingEdge *src_net_elm, *dst_net_elm;
 
   src_net_elm = sg_routing_edge_by_name_or_null(src);
   dst_net_elm = sg_routing_edge_by_name_or_null(dst);
 
   src_net_elm = sg_routing_edge_by_name_or_null(src);
   dst_net_elm = sg_routing_edge_by_name_or_null(dst);
@@ -521,7 +521,7 @@ void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route)
       THROWF(arg_error,0,"(AS)Route from '%s' to '%s' already exists",src,dst);
 
     if (route->gw_dst && route->gw_src) {
       THROWF(arg_error,0,"(AS)Route from '%s' to '%s' already exists",src,dst);
 
     if (route->gw_dst && route->gw_src) {
-      RoutingEdgePtr gw_tmp;
+      RoutingEdge *gw_tmp;
       gw_tmp = route->gw_src;
       route->gw_src = route->gw_dst;
       route->gw_dst = gw_tmp;
       gw_tmp = route->gw_src;
       route->gw_src = route->gw_dst;
       route->gw_dst = gw_tmp;
index 033e4f9..2814383 100644 (file)
@@ -27,7 +27,6 @@ typedef struct route_cache_element {
  * Classes *
  ***********/
 class AsDijkstra;
  * Classes *
  ***********/
 class AsDijkstra;
-typedef AsDijkstra *AsDijkstraPtr;
 
 class AsDijkstra : public AsGeneric {
 public:
 
 class AsDijkstra : public AsGeneric {
 public:
@@ -50,7 +49,7 @@ public:
      * will have a loopback attached to it.
      */
        void addLoopback();
      * will have a loopback attached to it.
      */
        void addLoopback();
-       void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t route, double *lat);
+       void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat);
        xbt_dynar_t getOnelinkRoutes();
        void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat);
        void parseASroute(sg_platf_route_cbarg_t route);
        xbt_dynar_t getOnelinkRoutes();
        void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat);
        void parseASroute(sg_platf_route_cbarg_t route);
index adaeced..adc6a53 100644 (file)
@@ -20,7 +20,7 @@ AS_t model_floyd_create(void)
 
 void model_floyd_end(AS_t current_routing)
 {
 
 void model_floyd_end(AS_t current_routing)
 {
-  static_cast<AsFloydPtr>(current_routing)->end();
+  static_cast<AsFloyd*>(current_routing)->end();
 }
 
 AsFloyd::AsFloyd(): AsGeneric() {
 }
 
 AsFloyd::AsFloyd(): AsGeneric() {
@@ -51,7 +51,7 @@ AsFloyd::~AsFloyd(){
 /* Business methods */
 xbt_dynar_t AsFloyd::getOneLinkRoutes()
 {
 /* Business methods */
 xbt_dynar_t AsFloyd::getOneLinkRoutes()
 {
-  xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free_f);
+  xbt_dynar_t ret = xbt_dynar_new(sizeof(Onelink*), xbt_free_f);
   sg_platf_route_cbarg_t route =   xbt_new0(s_sg_platf_route_cbarg_t, 1);
   route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
 
   sg_platf_route_cbarg_t route =   xbt_new0(s_sg_platf_route_cbarg_t, 1);
   route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
 
@@ -61,13 +61,13 @@ xbt_dynar_t AsFloyd::getOneLinkRoutes()
   for(src=0; src < table_size; src++) {
     for(dst=0; dst< table_size; dst++) {
       xbt_dynar_reset(route->link_list);
   for(src=0; src < table_size; src++) {
     for(dst=0; dst< table_size; dst++) {
       xbt_dynar_reset(route->link_list);
-      src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdgePtr);
-      dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdgePtr);
+      src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdge*);
+      dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdge*);
       this->getRouteAndLatency(src_elm, dst_elm, route, NULL);
 
       if (xbt_dynar_length(route->link_list) == 1) {
         void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
       this->getRouteAndLatency(src_elm, dst_elm, route, NULL);
 
       if (xbt_dynar_length(route->link_list) == 1) {
         void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
-        OnelinkPtr onelink;
+        Onelink *onelink;
         if (p_hierarchy == SURF_ROUTING_BASE)
           onelink = new Onelink(link, src_elm, dst_elm);
         else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
         if (p_hierarchy == SURF_ROUTING_BASE)
           onelink = new Onelink(link, src_elm, dst_elm);
         else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
@@ -82,7 +82,7 @@ xbt_dynar_t AsFloyd::getOneLinkRoutes()
   return ret;
 }
 
   return ret;
 }
 
-void AsFloyd::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t res, double *lat)
+void AsFloyd::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t res, double *lat)
 {
 
   /* set utils vars */
 {
 
   /* set utils vars */
@@ -149,7 +149,7 @@ void AsFloyd::parseRoute(sg_platf_route_cbarg_t route)
 
   /* set the size of table routing */
   int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
 
   /* set the size of table routing */
   int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
-  RoutingEdgePtr src_net_elm, dst_net_elm;
+  RoutingEdge *src_net_elm, *dst_net_elm;
 
   src_net_elm = sg_routing_edge_by_name_or_null(src);
   dst_net_elm = sg_routing_edge_by_name_or_null(dst);
 
   src_net_elm = sg_routing_edge_by_name_or_null(src);
   dst_net_elm = sg_routing_edge_by_name_or_null(dst);
index 57fca5e..e307d47 100644 (file)
  * Classes *
  ***********/
 class AsFloyd;
  * Classes *
  ***********/
 class AsFloyd;
-typedef AsFloyd *AsFloydPtr;
 
 class AsFloyd: public AsGeneric {
 public:
   AsFloyd();
   ~AsFloyd();
 
 
 class AsFloyd: public AsGeneric {
 public:
   AsFloyd();
   ~AsFloyd();
 
-  void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t into, double *latency);
+  void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency);
   xbt_dynar_t getOneLinkRoutes();
   void parseASroute(sg_platf_route_cbarg_t route);
   void parseRoute(sg_platf_route_cbarg_t route);
   xbt_dynar_t getOneLinkRoutes();
   void parseASroute(sg_platf_route_cbarg_t route);
   void parseRoute(sg_platf_route_cbarg_t route);
@@ -29,14 +28,14 @@ public:
   //void parseASroute(sg_platf_route_cbarg_t route);
 
   //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
   //void parseASroute(sg_platf_route_cbarg_t route);
 
   //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdgePtr src, RoutingEdgePtr dst, double *lat);
+  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
-  //int parsePU(RoutingEdgePtr elm); /* A host or a router, whatever */
-  //int parseAS(RoutingEdgePtr elm);
+  //int parsePU(RoutingEdge *elm); /* A host or a router, whatever */
+  //int parseAS(RoutingEdge *elm);
 
   //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
 
 
   //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
 
index 806ece7..c7ef49a 100644 (file)
@@ -25,7 +25,7 @@ void model_full_end(AS_t _routing)
   sg_platf_route_cbarg_t e_route;
 
   /* set utils vars */
   sg_platf_route_cbarg_t e_route;
 
   /* set utils vars */
-  AsFullPtr routing = ((AsFullPtr) _routing);
+  AsFull *routing = static_cast<AsFull*>(_routing);
   int table_size = (int)xbt_dynar_length(routing->p_indexNetworkElm);
 
   /* Create table if necessary */
   int table_size = (int)xbt_dynar_length(routing->p_indexNetworkElm);
 
   /* Create table if necessary */
@@ -70,7 +70,7 @@ AsFull::~AsFull(){
 
 xbt_dynar_t AsFull::getOneLinkRoutes()
 {
 
 xbt_dynar_t AsFull::getOneLinkRoutes()
 {
-  xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free_f);
+  xbt_dynar_t ret = xbt_dynar_new(sizeof(Onelink*), xbt_free_f);
 
   int src, dst;
   int table_size = xbt_dynar_length(p_indexNetworkElm);
 
   int src, dst;
   int table_size = xbt_dynar_length(p_indexNetworkElm);
@@ -81,11 +81,11 @@ xbt_dynar_t AsFull::getOneLinkRoutes()
       if (route) {
         if (xbt_dynar_length(route->link_list) == 1) {
           void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
       if (route) {
         if (xbt_dynar_length(route->link_list) == 1) {
           void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
-          OnelinkPtr onelink;
+          Onelink *onelink;
           if (p_hierarchy == SURF_ROUTING_BASE) {
           if (p_hierarchy == SURF_ROUTING_BASE) {
-               RoutingEdgePtr tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_routing_edge_t);
+               RoutingEdge *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_routing_edge_t);
             tmp_src->setId(src);
             tmp_src->setId(src);
-               RoutingEdgePtr tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_routing_edge_t);
+               RoutingEdge *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_routing_edge_t);
                tmp_dst->setId(dst);
             onelink = new Onelink(link, tmp_src, tmp_dst);
           } else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
                tmp_dst->setId(dst);
             onelink = new Onelink(link, tmp_src, tmp_dst);
           } else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
@@ -103,7 +103,7 @@ xbt_dynar_t AsFull::getOneLinkRoutes()
   return ret;
 }
 
   return ret;
 }
 
-void AsFull::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t res, double *lat)
+void AsFull::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t res, double *lat)
 {
   XBT_DEBUG("full_get_route_and_latency from %s[%d] to %s[%d]",
       src->getName(),
 {
   XBT_DEBUG("full_get_route_and_latency from %s[%d] to %s[%d]",
       src->getName(),
@@ -145,7 +145,7 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route)
   int as_route = 0;
   char *src = (char*)(route->src);
   char *dst = (char*)(route->dst);
   int as_route = 0;
   char *src = (char*)(route->src);
   char *dst = (char*)(route->dst);
-  RoutingEdgePtr src_net_elm, dst_net_elm;
+  RoutingEdge *src_net_elm, *dst_net_elm;
   src_net_elm = sg_routing_edge_by_name_or_null(src);
   dst_net_elm = sg_routing_edge_by_name_or_null(dst);
 
   src_net_elm = sg_routing_edge_by_name_or_null(src);
   dst_net_elm = sg_routing_edge_by_name_or_null(dst);
 
index de3d0de..bd0c712 100644 (file)
@@ -13,7 +13,6 @@
  * Classes *
  ***********/
 class AsFull;
  * Classes *
  ***********/
 class AsFull;
-typedef AsFull *AsFullPtr;
 
 class AsFull: public AsGeneric {
 public:
 
 class AsFull: public AsGeneric {
 public:
@@ -22,20 +21,20 @@ public:
   AsFull();
   ~AsFull();
 
   AsFull();
   ~AsFull();
 
-  void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t into, double *latency);
+  void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency);
   xbt_dynar_t getOneLinkRoutes();
   void parseRoute(sg_platf_route_cbarg_t route);
   void parseASroute(sg_platf_route_cbarg_t route);
 
   //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
   xbt_dynar_t getOneLinkRoutes();
   void parseRoute(sg_platf_route_cbarg_t route);
   void parseASroute(sg_platf_route_cbarg_t route);
 
   //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdgePtr src, RoutingEdgePtr dst, double *lat);
+  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
-  //virtual int parsePU(RoutingEdgePtr elm)=0; /* A host or a router, whatever */
-  //virtual int parseAS( RoutingEdgePtr elm)=0;
+  //virtual int parsePU(RoutingEdge *elm)=0; /* A host or a router, whatever */
+  //virtual int parseAS( RoutingEdge *elm)=0;
 
   //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
 };
 
   //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
 };
index a92e8be..d80e89c 100644 (file)
@@ -30,7 +30,7 @@ void AsGeneric::parseASroute(sg_platf_route_cbarg_t /*route*/){
   THROW_IMPOSSIBLE;
 }
 
   THROW_IMPOSSIBLE;
 }
 
-void AsGeneric::getRouteAndLatency(RoutingEdgePtr /*src*/, RoutingEdgePtr /*dst*/, sg_platf_route_cbarg_t /*into*/, double */*latency*/){
+void AsGeneric::getRouteAndLatency(RoutingEdge */*src*/, RoutingEdge */*dst*/, sg_platf_route_cbarg_t /*into*/, double */*latency*/){
   THROW_IMPOSSIBLE;
 }
 
   THROW_IMPOSSIBLE;
 }
 
@@ -42,17 +42,17 @@ AsGeneric::~AsGeneric() {
   xbt_dict_free(&p_bypassRoutes);
 }
 
   xbt_dict_free(&p_bypassRoutes);
 }
 
-int AsGeneric::parsePU(RoutingEdgePtr elm)
+int AsGeneric::parsePU(RoutingEdge *elm)
 {
   XBT_DEBUG("Load process unit \"%s\"", elm->getName());
 {
   XBT_DEBUG("Load process unit \"%s\"", elm->getName());
-  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdgePtr, elm);
+  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
   return xbt_dynar_length(p_indexNetworkElm)-1;
 }
 
   return xbt_dynar_length(p_indexNetworkElm)-1;
 }
 
-int AsGeneric::parseAS(RoutingEdgePtr elm)
+int AsGeneric::parseAS(RoutingEdge *elm)
 {
   XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
 {
   XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
-  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdgePtr, elm);
+  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
   return xbt_dynar_length(p_indexNetworkElm)-1;
 }
 
   return xbt_dynar_length(p_indexNetworkElm)-1;
 }
 
@@ -149,13 +149,13 @@ void AsGeneric::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 
 
   for (src = 0; src < table_size; src++) {
 
 
   for (src = 0; src < table_size; src++) {
-    RoutingEdgePtr my_src =
-        xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdgePtr);
+    RoutingEdge *my_src =
+        xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdge*);
     for (dst = 0; dst < table_size; dst++) {
       if (src == dst)
         continue;
     for (dst = 0; dst < table_size; dst++) {
       if (src == dst)
         continue;
-      RoutingEdgePtr my_dst =
-          xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdgePtr);
+      RoutingEdge *my_dst =
+          xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdge*);
 
       sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
       route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
 
       sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
       route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
@@ -179,7 +179,7 @@ void AsGeneric::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
       }
 
       xbt_dynar_foreach(route->link_list, cpt, link) {
       }
 
       xbt_dynar_foreach(route->link_list, cpt, link) {
-        const char *link_name = ((ResourcePtr) link)->getName();
+        const char *link_name = static_cast<Resource*>(link)->getName();
         current = new_xbt_graph_node(graph, link_name, nodes);
         current_name = link_name;
         new_xbt_graph_edge(graph, previous, current, edges);
         current = new_xbt_graph_node(graph, link_name, nodes);
         current_name = link_name;
         new_xbt_graph_edge(graph, previous, current, edges);
@@ -204,8 +204,8 @@ void AsGeneric::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
   }
 }
 
   }
 }
 
-sg_platf_route_cbarg_t AsGeneric::getBypassRoute(RoutingEdgePtr src,
-                                               RoutingEdgePtr dst,
+sg_platf_route_cbarg_t AsGeneric::getBypassRoute(RoutingEdge *src,
+                                               RoutingEdge *dst,
                                                double *lat)
 {
   // If never set a bypass route return NULL without any further computations
                                                double *lat)
 {
   // If never set a bypass route return NULL without any further computations
@@ -224,13 +224,13 @@ sg_platf_route_cbarg_t AsGeneric::getBypassRoute(RoutingEdgePtr src,
     free(route_name);
   }
   else{
     free(route_name);
   }
   else{
-    AsPtr src_as, dst_as;
+    As *src_as, *dst_as;
     int index_src, index_dst;
     xbt_dynar_t path_src = NULL;
     xbt_dynar_t path_dst = NULL;
     int index_src, index_dst;
     xbt_dynar_t path_src = NULL;
     xbt_dynar_t path_dst = NULL;
-    AsPtr current = NULL;
-    AsPtr *current_src = NULL;
-    AsPtr *current_dst = NULL;
+    As *current = NULL;
+    As **current_src = NULL;
+    As **current_dst = NULL;
 
     if (src == NULL || dst == NULL)
       xbt_die("Ask for route \"from\"(%s) or \"to\"(%s) no found at AS \"%s\"",
 
     if (src == NULL || dst == NULL)
       xbt_die("Ask for route \"from\"(%s) or \"to\"(%s) no found at AS \"%s\"",
@@ -241,13 +241,13 @@ sg_platf_route_cbarg_t AsGeneric::getBypassRoute(RoutingEdgePtr src,
     dst_as = dst->getRcComponent();
 
     /* (2) find the path to the root routing component */
     dst_as = dst->getRcComponent();
 
     /* (2) find the path to the root routing component */
-    path_src = xbt_dynar_new(sizeof(AsPtr), NULL);
+    path_src = xbt_dynar_new(sizeof(As*), NULL);
     current = src_as;
     while (current != NULL) {
       xbt_dynar_push(path_src, &current);
       current = current->p_routingFather;
     }
     current = src_as;
     while (current != NULL) {
       xbt_dynar_push(path_src, &current);
       current = current->p_routingFather;
     }
-    path_dst = xbt_dynar_new(sizeof(AsPtr), NULL);
+    path_dst = xbt_dynar_new(sizeof(As*), NULL);
     current = dst_as;
     while (current != NULL) {
       xbt_dynar_push(path_dst, &current);
     current = dst_as;
     while (current != NULL) {
       xbt_dynar_push(path_dst, &current);
@@ -257,15 +257,15 @@ sg_platf_route_cbarg_t AsGeneric::getBypassRoute(RoutingEdgePtr src,
     /* (3) find the common father */
     index_src = path_src->used - 1;
     index_dst = path_dst->used - 1;
     /* (3) find the common father */
     index_src = path_src->used - 1;
     index_dst = path_dst->used - 1;
-    current_src = (AsPtr *) xbt_dynar_get_ptr(path_src, index_src);
-    current_dst = (AsPtr *) xbt_dynar_get_ptr(path_dst, index_dst);
+    current_src = (As **) xbt_dynar_get_ptr(path_src, index_src);
+    current_dst = (As **) xbt_dynar_get_ptr(path_dst, index_dst);
     while (index_src >= 0 && index_dst >= 0 && *current_src == *current_dst) {
       xbt_dynar_pop_ptr(path_src);
       xbt_dynar_pop_ptr(path_dst);
       index_src--;
       index_dst--;
     while (index_src >= 0 && index_dst >= 0 && *current_src == *current_dst) {
       xbt_dynar_pop_ptr(path_src);
       xbt_dynar_pop_ptr(path_dst);
       index_src--;
       index_dst--;
-      current_src = (AsPtr *) xbt_dynar_get_ptr(path_src, index_src);
-      current_dst = (AsPtr *) xbt_dynar_get_ptr(path_dst, index_dst);
+      current_src = (As **) xbt_dynar_get_ptr(path_src, index_src);
+      current_dst = (As **) xbt_dynar_get_ptr(path_dst, index_dst);
     }
 
     int max_index_src = path_src->used - 1;
     }
 
     int max_index_src = path_src->used - 1;
@@ -278,9 +278,9 @@ sg_platf_route_cbarg_t AsGeneric::getBypassRoute(RoutingEdgePtr src,
       for (i = 0; i < max; i++) {
         if (i <= max_index_src && max <= max_index_dst) {
           char *route_name = bprintf("%s#%s",
       for (i = 0; i < max; i++) {
         if (i <= max_index_src && max <= max_index_dst) {
           char *route_name = bprintf("%s#%s",
-              (*(AsPtr *)
+              (*(As **)
                   (xbt_dynar_get_ptr(path_src, i)))->p_name,
                   (xbt_dynar_get_ptr(path_src, i)))->p_name,
-                  (*(AsPtr *)
+                  (*(As **)
                       (xbt_dynar_get_ptr(path_dst, max)))->p_name);
           e_route_bypass = (sg_platf_route_cbarg_t) xbt_dict_get_or_null(dict_bypassRoutes, route_name);
           xbt_free(route_name);
                       (xbt_dynar_get_ptr(path_dst, max)))->p_name);
           e_route_bypass = (sg_platf_route_cbarg_t) xbt_dict_get_or_null(dict_bypassRoutes, route_name);
           xbt_free(route_name);
@@ -289,9 +289,9 @@ sg_platf_route_cbarg_t AsGeneric::getBypassRoute(RoutingEdgePtr src,
           break;
         if (max <= max_index_src && i <= max_index_dst) {
           char *route_name = bprintf("%s#%s",
           break;
         if (max <= max_index_src && i <= max_index_dst) {
           char *route_name = bprintf("%s#%s",
-              (*(AsPtr *)
+              (*(As **)
                   (xbt_dynar_get_ptr(path_src, max)))->p_name,
                   (xbt_dynar_get_ptr(path_src, max)))->p_name,
-                  (*(AsPtr *)
+                  (*(As **)
                       (xbt_dynar_get_ptr(path_dst, i)))->p_name);
           e_route_bypass = (sg_platf_route_cbarg_t) xbt_dict_get_or_null(dict_bypassRoutes, route_name);
           xbt_free(route_name);
                       (xbt_dynar_get_ptr(path_dst, i)))->p_name);
           e_route_bypass = (sg_platf_route_cbarg_t) xbt_dict_get_or_null(dict_bypassRoutes, route_name);
           xbt_free(route_name);
@@ -305,9 +305,9 @@ sg_platf_route_cbarg_t AsGeneric::getBypassRoute(RoutingEdgePtr src,
 
       if (max <= max_index_src && max <= max_index_dst) {
         char *route_name = bprintf("%s#%s",
 
       if (max <= max_index_src && max <= max_index_dst) {
         char *route_name = bprintf("%s#%s",
-            (*(AsPtr *)
+            (*(As **)
                 (xbt_dynar_get_ptr(path_src, max)))->p_name,
                 (xbt_dynar_get_ptr(path_src, max)))->p_name,
-                (*(AsPtr *)
+                (*(As **)
                     (xbt_dynar_get_ptr(path_dst, max)))->p_name);
         e_route_bypass = (sg_platf_route_cbarg_t) xbt_dict_get_or_null(dict_bypassRoutes, route_name);
         xbt_free(route_name);
                     (xbt_dynar_get_ptr(path_dst, max)))->p_name);
         e_route_bypass = (sg_platf_route_cbarg_t) xbt_dict_get_or_null(dict_bypassRoutes, route_name);
         xbt_free(route_name);
@@ -383,13 +383,13 @@ sg_platf_route_cbarg_t AsGeneric::newExtendedRoute(e_surf_routing_hierarchy_t hi
 
 
 
 
 
 
-AsPtr AsGeneric::asExist(AsPtr to_find)
+As *AsGeneric::asExist(As *to_find)
 {
   //return to_find; // FIXME: BYPASSERROR OF FOREACH WITH BREAK
   xbt_dict_cursor_t cursor = NULL;
   char *key;
   int found = 0;
 {
   //return to_find; // FIXME: BYPASSERROR OF FOREACH WITH BREAK
   xbt_dict_cursor_t cursor = NULL;
   char *key;
   int found = 0;
-  AsGenericPtr elem;
+  AsGeneric *elem;
   xbt_dict_foreach(p_routingSons, cursor, key, elem) {
     if (to_find == elem || elem->asExist(to_find)) {
       found = 1;
   xbt_dict_foreach(p_routingSons, cursor, key, elem) {
     if (to_find == elem || elem->asExist(to_find)) {
       found = 1;
@@ -401,16 +401,16 @@ AsPtr AsGeneric::asExist(AsPtr to_find)
   return NULL;
 }
 
   return NULL;
 }
 
-AsPtr AsGeneric::autonomousSystemExist(char *element)
+As *AsGeneric::autonomousSystemExist(char *element)
 {
   //return rc; // FIXME: BYPASSERROR OF FOREACH WITH BREAK
 {
   //return rc; // FIXME: BYPASSERROR OF FOREACH WITH BREAK
-  AsPtr element_as, result, elem;
+  As *element_as, *result, *elem;
   xbt_dict_cursor_t cursor = NULL;
   char *key;
   xbt_dict_cursor_t cursor = NULL;
   char *key;
-  element_as = ((RoutingEdgePtr)
+  element_as = ((RoutingEdge*)
       xbt_lib_get_or_null(as_router_lib, element,
           ROUTING_ASR_LEVEL))->getRcComponent();
       xbt_lib_get_or_null(as_router_lib, element,
           ROUTING_ASR_LEVEL))->getRcComponent();
-  result = ((AsPtr) - 1);
+  result = ((As*) - 1);
   if (element_as != this)
     result = asExist(element_as);
 
   if (element_as != this)
     result = asExist(element_as);
 
@@ -427,15 +427,15 @@ AsPtr AsGeneric::autonomousSystemExist(char *element)
   return NULL;
 }
 
   return NULL;
 }
 
-AsPtr AsGeneric::processingUnitsExist(char *element)
+As *AsGeneric::processingUnitsExist(char *element)
 {
 {
-  AsPtr element_as = sg_host_edge(sg_host_by_name(element)) ->getRcComponent();
+  As *element_as = sg_host_edge(sg_host_by_name(element)) ->getRcComponent();
   if (element_as == this)
     return element_as;
   return asExist(element_as);
 }
 
   if (element_as == this)
     return element_as;
   return asExist(element_as);
 }
 
-void AsGeneric::srcDstCheck(RoutingEdgePtr src, RoutingEdgePtr dst)
+void AsGeneric::srcDstCheck(RoutingEdge *src, RoutingEdge *dst)
 {
   if (src == NULL || dst == NULL)
     xbt_die("Ask for route \"from\"(%s) or \"to\"(%s) no found at AS \"%s\"",
 {
   if (src == NULL || dst == NULL)
     xbt_die("Ask for route \"from\"(%s) or \"to\"(%s) no found at AS \"%s\"",
@@ -443,8 +443,8 @@ void AsGeneric::srcDstCheck(RoutingEdgePtr src, RoutingEdgePtr dst)
             dst ? dst->getName() : "(null)",
             p_name);
 
             dst ? dst->getName() : "(null)",
             p_name);
 
-  AsPtr src_as = src->getRcComponent();
-  AsPtr dst_as = dst->getRcComponent();
+  As *src_as = src->getRcComponent();
+  As *dst_as = dst->getRcComponent();
 
   if (src_as != dst_as)
     xbt_die("The src(%s in %s) and dst(%s in %s) are in differents AS",
 
   if (src_as != dst_as)
     xbt_die("The src(%s in %s) and dst(%s in %s) are in differents AS",
index 53928b1..fd386a6 100644 (file)
@@ -10,7 +10,6 @@
 #define SURF_ROUTING_GENERIC_HPP_
 
 class AsGeneric;
 #define SURF_ROUTING_GENERIC_HPP_
 
 class AsGeneric;
-typedef AsGeneric *AsGenericPtr;
 
 void generic_free_route(sg_platf_route_cbarg_t route);
 
 
 void generic_free_route(sg_platf_route_cbarg_t route);
 
@@ -19,26 +18,26 @@ public:
   AsGeneric();
   ~AsGeneric();
 
   AsGeneric();
   ~AsGeneric();
 
-  virtual void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t into, double *latency);
+  virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency);
   virtual xbt_dynar_t getOneLinkRoutes();
   virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
   virtual xbt_dynar_t getOneLinkRoutes();
   virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  virtual sg_platf_route_cbarg_t getBypassRoute(RoutingEdgePtr src, RoutingEdgePtr dst, double *lat);
+  virtual sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
-  virtual int parsePU(RoutingEdgePtr elm); /* A host or a router, whatever */
-  virtual int parseAS( RoutingEdgePtr elm);
+  virtual int parsePU(RoutingEdge *elm); /* A host or a router, whatever */
+  virtual int parseAS(RoutingEdge *elm);
   virtual void parseRoute(sg_platf_route_cbarg_t route);
   virtual void parseASroute(sg_platf_route_cbarg_t route);
   virtual void parseBypassroute(sg_platf_route_cbarg_t e_route);
 
   virtual sg_platf_route_cbarg_t newExtendedRoute(e_surf_routing_hierarchy_t hierarchy, sg_platf_route_cbarg_t routearg, int change_order);
   virtual void parseRoute(sg_platf_route_cbarg_t route);
   virtual void parseASroute(sg_platf_route_cbarg_t route);
   virtual void parseBypassroute(sg_platf_route_cbarg_t e_route);
 
   virtual sg_platf_route_cbarg_t newExtendedRoute(e_surf_routing_hierarchy_t hierarchy, sg_platf_route_cbarg_t routearg, int change_order);
-  virtual AsPtr asExist(AsPtr to_find);
-  virtual AsPtr autonomousSystemExist(char *element);
-  virtual AsPtr processingUnitsExist(char *element);
-  virtual void srcDstCheck(RoutingEdgePtr src, RoutingEdgePtr dst);
+  virtual As *asExist(As *to_find);
+  virtual As *autonomousSystemExist(char *element);
+  virtual As *processingUnitsExist(char *element);
+  virtual void srcDstCheck(RoutingEdge *src, RoutingEdge *dst);
 };
 
 #endif /* SURF_ROUTING_GENERIC_HPP_ */
 };
 
 #endif /* SURF_ROUTING_GENERIC_HPP_ */
index 1ea0e4a..a1a97e8 100644 (file)
@@ -17,7 +17,7 @@ xbt_dynar_t AsNone::getOneLinkRoutes() {
   return NULL;
 }
 
   return NULL;
 }
 
-void AsNone::getRouteAndLatency(RoutingEdgePtr /*src*/, RoutingEdgePtr /*dst*/,
+void AsNone::getRouteAndLatency(RoutingEdge */*src*/, RoutingEdge */*dst*/,
                                 sg_platf_route_cbarg_t /*res*/, double *lat)
 {
   *lat = 0.0;
                                 sg_platf_route_cbarg_t /*res*/, double *lat)
 {
   *lat = 0.0;
@@ -28,20 +28,20 @@ void AsNone::getGraph(xbt_graph_t /*graph*/, xbt_dict_t /*nodes*/, xbt_dict_t /*
        XBT_INFO("No routing no graph");
 }
 
        XBT_INFO("No routing no graph");
 }
 
-sg_platf_route_cbarg_t AsNone::getBypassRoute(RoutingEdgePtr /*src*/, RoutingEdgePtr /*dst*/, double */*lat*/) {
+sg_platf_route_cbarg_t AsNone::getBypassRoute(RoutingEdge */*src*/, RoutingEdge */*dst*/, double */*lat*/) {
   return NULL;
 }
 
   return NULL;
 }
 
-int AsNone::parsePU(RoutingEdgePtr elm) {
+int AsNone::parsePU(RoutingEdge *elm) {
   XBT_DEBUG("Load process unit \"%s\"", elm->getName());
   XBT_DEBUG("Load process unit \"%s\"", elm->getName());
-  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdgePtr, elm);
+  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
   /* don't care about PUs */
   return -1;
 }
 
   /* don't care about PUs */
   return -1;
 }
 
-int AsNone::parseAS(RoutingEdgePtr elm) {
+int AsNone::parseAS(RoutingEdge *elm) {
   XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
   XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
-  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdgePtr, elm);
+  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
   /* even don't care about sub-ASes -- I'm as nihilist as an old punk*/
   return -1;
 }
   /* even don't care about sub-ASes -- I'm as nihilist as an old punk*/
   return -1;
 }
index 042161e..8fab504 100644 (file)
@@ -14,17 +14,17 @@ public:
   AsNone();
   ~AsNone();
 
   AsNone();
   ~AsNone();
 
-  void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t into, double *latency);
+  void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency);
   xbt_dynar_t getOneLinkRoutes();
   void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
   xbt_dynar_t getOneLinkRoutes();
   void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  sg_platf_route_cbarg_t getBypassRoute(RoutingEdgePtr src, RoutingEdgePtr dst, double *lat);
+  sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
-  int parsePU(RoutingEdgePtr elm); /* A host or a router, whatever */
-  int parseAS( RoutingEdgePtr elm);
+  int parsePU(RoutingEdge *elm); /* A host or a router, whatever */
+  int parseAS( RoutingEdge *elm);
   void parseRoute(sg_platf_route_cbarg_t route);
   void parseASroute(sg_platf_route_cbarg_t route);
   void parseBypassroute(sg_platf_route_cbarg_t e_route);
   void parseRoute(sg_platf_route_cbarg_t route);
   void parseASroute(sg_platf_route_cbarg_t route);
   void parseBypassroute(sg_platf_route_cbarg_t e_route);
index 4dbfad4..99479c6 100644 (file)
@@ -66,9 +66,9 @@ void model_floyd_parse_route(AS_t rc, sg_platf_route_cbarg_t route);
 /* ************************************************** */
 /* **************  Cluster ROUTING   **************** */
 
 /* ************************************************** */
 /* **************  Cluster ROUTING   **************** */
 
-AsPtr model_cluster_create(void);      /* create structures for cluster routing model */
-AsPtr model_torus_cluster_create(void); 
-AsPtr model_fat_tree_cluster_create(void);
+As *model_cluster_create(void);      /* create structures for cluster routing model */
+As *model_torus_cluster_create(void);
+As *model_fat_tree_cluster_create(void);
 
 /* ************************************************** */
 /* **************  Vivaldi ROUTING   **************** */
 
 /* ************************************************** */
 /* **************  Vivaldi ROUTING   **************** */
index 783b99d..2865fa0 100644 (file)
@@ -23,7 +23,7 @@ AS_t model_vivaldi_create(void)
   return new AsVivaldi();
 }
 
   return new AsVivaldi();
 }
 
-void AsVivaldi::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t route, double *lat)
+void AsVivaldi::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat)
 {
   s_surf_parsing_link_up_down_t info;
 
 {
   s_surf_parsing_link_up_down_t info;
 
@@ -101,7 +101,7 @@ void AsVivaldi::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
   }
 }
 
   }
 }
 
-int AsVivaldi::parsePU(RoutingEdgePtr elm) {
+int AsVivaldi::parsePU(RoutingEdge *elm) {
   XBT_DEBUG("Load process unit \"%s\"", elm->getName());
   xbt_dynar_push_as(p_indexNetworkElm, sg_routing_edge_t, elm);
   return xbt_dynar_length(p_indexNetworkElm)-1;
   XBT_DEBUG("Load process unit \"%s\"", elm->getName());
   xbt_dynar_push_as(p_indexNetworkElm, sg_routing_edge_t, elm);
   return xbt_dynar_length(p_indexNetworkElm)-1;
index ee0ab65..a85bb93 100644 (file)
@@ -20,7 +20,6 @@ AS_t model_vivaldi_create(void);      /* create structures for vivaldi routing m
  * Classes *
  ***********/
 class AsVivaldi;
  * Classes *
  ***********/
 class AsVivaldi;
-typedef AsVivaldi *AsVivaldiPtr;
 
 class AsVivaldi: public AsGeneric {
 public:
 
 class AsVivaldi: public AsGeneric {
 public:
@@ -29,16 +28,16 @@ public:
   AsVivaldi() : AsGeneric() {};
   ~AsVivaldi() {};
 
   AsVivaldi() : AsGeneric() {};
   ~AsVivaldi() {};
 
-  void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t into, double *latency);
+  void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency);
   //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
   //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdgePtr src, RoutingEdgePtr dst, double *lat);
+  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
-  int parsePU(RoutingEdgePtr elm); /* A host or a router, whatever */
-  //virtual int parseAS( RoutingEdgePtr elm)=0;
+  int parsePU(RoutingEdge *elm); /* A host or a router, whatever */
+  //virtual int parseAS( RoutingEdge *elm)=0;
 
   //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
 };
 
   //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
 };
index e72a628..ff60c24 100644 (file)
@@ -12,7 +12,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_vm);
 void surf_vm_model_init_HL13(void){
   if (surf_cpu_model_vm) {
     surf_vm_model = new VMHL13Model();
 void surf_vm_model_init_HL13(void){
   if (surf_cpu_model_vm) {
     surf_vm_model = new VMHL13Model();
-    ModelPtr model = surf_vm_model;
+    Model *model = surf_vm_model;
 
     xbt_dynar_push(model_list, &model);
     xbt_dynar_push(model_list_invoke, &model);
 
     xbt_dynar_push(model_list, &model);
     xbt_dynar_push(model_list_invoke, &model);
@@ -31,16 +31,16 @@ void VMHL13Model::updateActionsState(double /*now*/, double /*delta*/){
   return;
 }
 
   return;
 }
 
-ActionPtr VMHL13Model::communicate(HostPtr src, HostPtr dst, double size, double rate){
+Action *VMHL13Model::communicate(Host *src, Host *dst, double size, double rate){
   return surf_network_model->communicate(src->p_netElm, dst->p_netElm, size, rate);
 }
 
 /* ind means ''indirect'' that this is a reference on the whole dict_elm
  * structure (i.e not on the surf_resource_private infos) */
 
   return surf_network_model->communicate(src->p_netElm, dst->p_netElm, size, rate);
 }
 
 /* ind means ''indirect'' that this is a reference on the whole dict_elm
  * structure (i.e not on the surf_resource_private infos) */
 
-VMPtr VMHL13Model::createVM(const char *name, surf_resource_t host_PM)
+VM *VMHL13Model::createVM(const char *name, surf_resource_t host_PM)
 {
 {
-  VMHL13Ptr ws = new VMHL13(this, name, NULL, host_PM);
+  VMHL13 *ws = new VMHL13(this, name, NULL, host_PM);
 
   xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, ws);
 
 
   xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, ws);
 
@@ -50,7 +50,7 @@ VMPtr VMHL13Model::createVM(const char *name, surf_resource_t host_PM)
   return ws;
 }
 
   return ws;
 }
 
-static inline double get_solved_value(CpuActionPtr cpu_action)
+static inline double get_solved_value(CpuAction *cpu_action)
 {
   return cpu_action->getVariable()->value;
 }
 {
   return cpu_action->getVariable()->value;
 }
@@ -70,8 +70,8 @@ double VMHL13Model::shareResources(double now)
   /* 0. Make sure that we already calculated the resource share at the physical
    * machine layer. */
   {
   /* 0. Make sure that we already calculated the resource share at the physical
    * machine layer. */
   {
-    _XBT_GNUC_UNUSED ModelPtr ws_model = surf_host_model;
-    _XBT_GNUC_UNUSED ModelPtr vm_ws_model = surf_vm_model;
+    _XBT_GNUC_UNUSED Model *ws_model = surf_host_model;
+    _XBT_GNUC_UNUSED Model *vm_ws_model = surf_vm_model;
     _XBT_GNUC_UNUSED unsigned int index_of_pm_ws_model = xbt_dynar_search(model_list_invoke, &ws_model);
     _XBT_GNUC_UNUSED unsigned int index_of_vm_ws_model = xbt_dynar_search(model_list_invoke, &vm_ws_model);
     xbt_assert((index_of_pm_ws_model < index_of_vm_ws_model), "Cannot assume surf_host_model comes before");
     _XBT_GNUC_UNUSED unsigned int index_of_pm_ws_model = xbt_dynar_search(model_list_invoke, &ws_model);
     _XBT_GNUC_UNUSED unsigned int index_of_vm_ws_model = xbt_dynar_search(model_list_invoke, &vm_ws_model);
     xbt_assert((index_of_pm_ws_model < index_of_vm_ws_model), "Cannot assume surf_host_model comes before");
@@ -111,8 +111,8 @@ double VMHL13Model::shareResources(double now)
          VMModel::ws_vms.begin();
        iter !=  VMModel::ws_vms.end(); ++iter) {
 
          VMModel::ws_vms.begin();
        iter !=  VMModel::ws_vms.end(); ++iter) {
 
-    VMPtr ws_vm = &*iter;
-    CpuPtr cpu = ws_vm->p_cpu;
+    VM *ws_vm = &*iter;
+    Cpu *cpu = ws_vm->p_cpu;
     xbt_assert(cpu, "cpu-less host");
 
     double solved_value = get_solved_value(ws_vm->p_action);
     xbt_assert(cpu, "cpu-less host");
 
     double solved_value = get_solved_value(ws_vm->p_action);
@@ -158,7 +158,7 @@ double VMHL13Model::shareResources(double now)
 
     {
 #if 0
 
     {
 #if 0
-      VM2013Ptr ws_vm2013 = static_cast<VM2013Ptr>(&*iter);
+      VM2013 *ws_vm2013 = static_cast<VM2013Ptr>(&*iter);
       XBT_INFO("cost %f remains %f start %f finish %f", ws_vm2013->cpu_action->cost,
           ws_vm2013->cpu_action->remains,
           ws_vm2013->cpu_action->start,
       XBT_INFO("cost %f remains %f start %f finish %f", ws_vm2013->cpu_action->cost,
           ws_vm2013->cpu_action->remains,
           ws_vm2013->cpu_action->start,
@@ -181,7 +181,7 @@ double VMHL13Model::shareResources(double now)
   return ret;
 }
 
   return ret;
 }
 
-ActionPtr VMHL13Model::executeParallelTask(int host_nb,
+Action *VMHL13Model::executeParallelTask(int host_nb,
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
                                         void **host_list,
                                         double *flops_amount,
                                         double *bytes_amount,
@@ -189,10 +189,10 @@ ActionPtr VMHL13Model::executeParallelTask(int host_nb,
 #define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
   if ((host_nb == 1)
       && (cost_or_zero(bytes_amount, 0) == 0.0))
 #define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
   if ((host_nb == 1)
       && (cost_or_zero(bytes_amount, 0) == 0.0))
-    return ((HostCLM03Ptr)host_list[0])->execute(flops_amount[0]);
+    return static_cast<HostCLM03*>(host_list[0])->execute(flops_amount[0]);
   else if ((host_nb == 1)
            && (cost_or_zero(flops_amount, 0) == 0.0))
   else if ((host_nb == 1)
            && (cost_or_zero(flops_amount, 0) == 0.0))
-    return communicate((HostCLM03Ptr)host_list[0], (HostCLM03Ptr)host_list[0],bytes_amount[0], rate);
+    return communicate(static_cast<HostCLM03*>(host_list[0]), static_cast<HostCLM03*>(host_list[0]),bytes_amount[0], rate);
   else if ((host_nb == 2)
              && (cost_or_zero(flops_amount, 0) == 0.0)
              && (cost_or_zero(flops_amount, 1) == 0.0)) {
   else if ((host_nb == 2)
              && (cost_or_zero(flops_amount, 0) == 0.0)
              && (cost_or_zero(flops_amount, 1) == 0.0)) {
@@ -206,7 +206,7 @@ ActionPtr VMHL13Model::executeParallelTask(int host_nb,
       }
     }
     if (nb == 1)
       }
     }
     if (nb == 1)
-      return communicate((HostCLM03Ptr)host_list[0], (HostCLM03Ptr)host_list[1],value, rate);
+      return communicate(static_cast<HostCLM03*>(host_list[0]), static_cast<HostCLM03*>(host_list[1]),value, rate);
   }
 #undef cost_or_zero
 
   }
 #undef cost_or_zero
 
@@ -218,11 +218,11 @@ ActionPtr VMHL13Model::executeParallelTask(int host_nb,
  * Resource *
  ************/
 
  * Resource *
  ************/
 
-VMHL13::VMHL13(VMModelPtr model, const char* name, xbt_dict_t props,
+VMHL13::VMHL13(VMModel *model, const char* name, xbt_dict_t props,
                                                   surf_resource_t host_PM)
  : VM(model, name, props, NULL, NULL)
 {
                                                   surf_resource_t host_PM)
  : VM(model, name, props, NULL, NULL)
 {
-  HostPtr sub_ws = static_cast<HostPtr>(surf_host_resource_priv(host_PM));
+  Host *sub_ws = static_cast<Host*>(surf_host_resource_priv(host_PM));
 
   /* Currently, we assume a VM has no storage. */
   p_storage = NULL;
 
   /* Currently, we assume a VM has no storage. */
   p_storage = NULL;
@@ -242,7 +242,7 @@ VMHL13::VMHL13(VMModelPtr model, const char* name, xbt_dict_t props,
 
   // //// CPU  RELATED STUFF ////
   // Roughly, create a vcpu resource by using the values of the sub_cpu one.
 
   // //// CPU  RELATED STUFF ////
   // Roughly, create a vcpu resource by using the values of the sub_cpu one.
-  CpuCas01Ptr sub_cpu = static_cast<CpuCas01Ptr>(sg_host_surfcpu(host_PM));
+  CpuCas01 *sub_cpu = static_cast<CpuCas01*>(sg_host_surfcpu(host_PM));
 
   p_cpu = surf_cpu_model_vm->createCpu(name, // name
       sub_cpu->getPowerPeakList(),        // host->power_peak,
 
   p_cpu = surf_cpu_model_vm->createCpu(name, // name
       sub_cpu->getPowerPeakList(),        // host->power_peak,
@@ -328,7 +328,7 @@ void VMHL13::restore()
 void VMHL13::migrate(surf_resource_t ind_dst_pm)
 {
    /* ind_dst_pm equals to smx_host_t */
 void VMHL13::migrate(surf_resource_t ind_dst_pm)
 {
    /* ind_dst_pm equals to smx_host_t */
-   HostPtr ws_dst = static_cast<HostPtr>(surf_host_resource_priv(ind_dst_pm));
+   Host *ws_dst = static_cast<Host*>(surf_host_resource_priv(ind_dst_pm));
    const char *vm_name = getName();
    const char *pm_name_src = p_subWs->getName();
    const char *pm_name_dst = ws_dst->getName();
    const char *vm_name = getName();
    const char *pm_name_src = p_subWs->getName();
    const char *pm_name_dst = ws_dst->getName();
@@ -336,8 +336,8 @@ void VMHL13::migrate(surf_resource_t ind_dst_pm)
    xbt_assert(ws_dst);
 
    /* update net_elm with that of the destination physical host */
    xbt_assert(ws_dst);
 
    /* update net_elm with that of the destination physical host */
-   RoutingEdgePtr old_net_elm = p_netElm;
-   RoutingEdgePtr new_net_elm = new RoutingEdgeWrapper(sg_host_edge(sg_host_by_name(pm_name_dst)));
+   RoutingEdge *old_net_elm = p_netElm;
+   RoutingEdge *new_net_elm = new RoutingEdgeWrapper(sg_host_edge(sg_host_by_name(pm_name_dst)));
    xbt_assert(new_net_elm);
 
    /* Unregister the current net_elm from host_lib. Do not call the free callback. */
    xbt_assert(new_net_elm);
 
    /* Unregister the current net_elm from host_lib. Do not call the free callback. */
@@ -362,8 +362,8 @@ void VMHL13::migrate(surf_resource_t ind_dst_pm)
 #endif
 
      /* create a cpu action bound to the pm model at the destination. */
 #endif
 
      /* create a cpu action bound to the pm model at the destination. */
-     CpuActionPtr new_cpu_action = static_cast<CpuActionPtr>(
-                                           static_cast<CpuPtr>(sg_host_surfcpu(ind_dst_pm))->execute(0));
+     CpuAction *new_cpu_action = static_cast<CpuAction*>(
+                                           static_cast<Cpu*>(sg_host_surfcpu(ind_dst_pm))->execute(0));
 
      e_surf_action_state_t state = p_action->getState();
      if (state != SURF_ACTION_DONE)
 
      e_surf_action_state_t state = p_action->getState();
      if (state != SURF_ACTION_DONE)
@@ -393,7 +393,7 @@ void VMHL13::setBound(double bound){
  p_action->setBound(bound);
 }
 
  p_action->setBound(bound);
 }
 
-void VMHL13::setAffinity(CpuPtr cpu, unsigned long mask){
+void VMHL13::setAffinity(Cpu *cpu, unsigned long mask){
  p_action->setAffinity(cpu, mask);
 }
 
  p_action->setAffinity(cpu, mask);
 }
 
@@ -407,7 +407,7 @@ surf_resource_t VMHL13::getPm()
 }
 
 /* Adding a task to a VM updates the VCPU task on its physical machine. */
 }
 
 /* Adding a task to a VM updates the VCPU task on its physical machine. */
-ActionPtr VMHL13::execute(double size)
+Action *VMHL13::execute(double size)
 {
   double old_cost = p_action->getCost();
   double new_cost = old_cost + size;
 {
   double old_cost = p_action->getCost();
   double new_cost = old_cost + size;
@@ -421,7 +421,7 @@ ActionPtr VMHL13::execute(double size)
   return p_cpu->execute(size);
 }
 
   return p_cpu->execute(size);
 }
 
-ActionPtr VMHL13::sleep(double duration) {
+Action *VMHL13::sleep(double duration) {
   return p_cpu->sleep(duration);
 }
 
   return p_cpu->sleep(duration);
 }
 
index 397bac5..41b06ef 100644 (file)
  ***********/
 
 class VMHL13Model;
  ***********/
 
 class VMHL13Model;
-typedef VMHL13Model *VMHL13ModelPtr;
-
 class VMHL13;
 class VMHL13;
-typedef VMHL13 *VMHL13Ptr;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -31,11 +28,11 @@ public:
   VMHL13Model();
   ~VMHL13Model(){};
 
   VMHL13Model();
   ~VMHL13Model(){};
 
-  VMPtr createVM(const char *name, surf_resource_t host_PM);
+  VM *createVM(const char *name, surf_resource_t host_PM);
   double shareResources(double now);
   void adjustWeightOfDummyCpuActions() {};
   double shareResources(double now);
   void adjustWeightOfDummyCpuActions() {};
-  ActionPtr communicate(HostPtr src, HostPtr dst, double size, double rate);
-  ActionPtr executeParallelTask(int host_nb,
+  Action *communicate(Host *src, Host *dst, double size, double rate);
+  Action *executeParallelTask(int host_nb,
                                           void **host_list,
                                           double *flops_amount,
                                           double *bytes_amount,
                                           void **host_list,
                                           double *flops_amount,
                                           double *bytes_amount,
@@ -49,7 +46,7 @@ public:
 
 class VMHL13 : public VM {
 public:
 
 class VMHL13 : public VM {
 public:
-  VMHL13(VMModelPtr model, const char* name, xbt_dict_t props, surf_resource_t host_PM);
+  VMHL13(VMModel *model, const char* name, xbt_dict_t props, surf_resource_t host_PM);
   ~VMHL13();
 
   void suspend();
   ~VMHL13();
 
   void suspend();
@@ -66,14 +63,14 @@ public:
   surf_resource_t getPm(); // will be vm_ws_get_pm()
 
   void setBound(double bound);
   surf_resource_t getPm(); // will be vm_ws_get_pm()
 
   void setBound(double bound);
-  void setAffinity(CpuPtr cpu, unsigned long mask);
+  void setAffinity(Cpu *cpu, unsigned long mask);
 
   //FIXME: remove
   void updateState(tmgr_trace_event_t event_type, double value, double date);
   bool isUsed();
 
 
   //FIXME: remove
   void updateState(tmgr_trace_event_t event_type, double value, double date);
   bool isUsed();
 
-  ActionPtr execute(double size);
-  ActionPtr sleep(double duration);
+  Action *execute(double size);
+  Action *sleep(double duration);
 };
 
 /**********
 };
 
 /**********
index c72689d..d7b0e5c 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf,
                                 "Logging specific to the SURF VM module");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf,
                                 "Logging specific to the SURF VM module");
 
-VMModelPtr surf_vm_model = NULL;
+VMModel *surf_vm_model = NULL;
 
 /*************
  * Callbacks *
  *************/
 
 
 /*************
  * Callbacks *
  *************/
 
-surf_callback(void, VMPtr) VMCreatedCallbacks;
-surf_callback(void, VMPtr) VMDestructedCallbacks;
-surf_callback(void, VMPtr) VMStateChangedCallbacks;
+surf_callback(void, VM*) VMCreatedCallbacks;
+surf_callback(void, VM*) VMDestructedCallbacks;
+surf_callback(void, VM*) VMStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -34,8 +34,8 @@ VMModel::vm_list_t VMModel::ws_vms;
  * Resource *
  ************/
 
  * Resource *
  ************/
 
-VM::VM(ModelPtr model, const char *name, xbt_dict_t props,
-                       RoutingEdgePtr netElm, CpuPtr cpu)
+VM::VM(Model *model, const char *name, xbt_dict_t props,
+                       RoutingEdge *netElm, Cpu *cpu)
 : Host(model, name, props, NULL, netElm, cpu)
 {
   VMModel::ws_vms.push_back(*this);
 : Host(model, name, props, NULL, netElm, cpu)
 {
   VMModel::ws_vms.push_back(*this);
index a8ddce8..0dede2e 100644 (file)
  ***********/
 
 class VMModel;
  ***********/
 
 class VMModel;
-typedef VMModel *VMModelPtr;
-
 class VM;
 class VM;
-typedef VM *VMPtr;
-
-class VMLmm;
-typedef VMLmm *VMLmmPtr;
 
 /*************
  * Callbacks *
 
 /*************
  * Callbacks *
@@ -33,19 +27,19 @@ typedef VMLmm *VMLmmPtr;
  * @brief Callbacks handler which emit the callbacks after VM creation *
  * @details Callback functions have the following signature: `void(VMPtr)`
  */
  * @brief Callbacks handler which emit the callbacks after VM creation *
  * @details Callback functions have the following signature: `void(VMPtr)`
  */
-extern surf_callback(void, VMPtr) VMCreatedCallbacks;
+extern surf_callback(void, VM*) VMCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after VM destruction *
  * @details Callback functions have the following signature: `void(VMPtr)`
  */
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after VM destruction *
  * @details Callback functions have the following signature: `void(VMPtr)`
  */
-extern surf_callback(void, VMPtr) VMDestructedCallbacks;
+extern surf_callback(void, VM*) VMDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after VM State changed *
  * @details Callback functions have the following signature: `void(VMActionPtr)`
  */
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after VM State changed *
  * @details Callback functions have the following signature: `void(VMActionPtr)`
  */
-extern surf_callback(void, VMPtr) VMStateChangedCallbacks;
+extern surf_callback(void, VM*) VMStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -59,7 +53,7 @@ public:
   VMModel();
   ~VMModel(){};
 
   VMModel();
   ~VMModel(){};
 
-  HostPtr createHost(const char *name){DIE_IMPOSSIBLE;}
+  Host *createHost(const char *name){DIE_IMPOSSIBLE;}
 
   /**
    * @brief Create a new VM
 
   /**
    * @brief Create a new VM
@@ -68,7 +62,7 @@ public:
    * @param host_PM The real machine hosting the VM
    *
    */
    * @param host_PM The real machine hosting the VM
    *
    */
-  virtual VMPtr createVM(const char *name, surf_resource_t host_PM)=0;
+  virtual VM *createVM(const char *name, surf_resource_t host_PM)=0;
   void adjustWeightOfDummyCpuActions() {};
 
   typedef boost::intrusive::list<VM,
   void adjustWeightOfDummyCpuActions() {};
 
   typedef boost::intrusive::list<VM,
@@ -97,8 +91,8 @@ public:
    * @param netElm The RoutingEdge associated to this VM
    * @param cpu The Cpu associated to this VM
    */
    * @param netElm The RoutingEdge associated to this VM
    * @param cpu The Cpu associated to this VM
    */
-  VM(ModelPtr model, const char *name, xbt_dict_t props,
-                       RoutingEdgePtr netElm, CpuPtr cpu);
+  VM(Model *model, const char *name, xbt_dict_t props,
+                       RoutingEdge *netElm, Cpu *cpu);
 
   /**
    * @brief WdorkstationVM destructor
 
   /**
    * @brief WdorkstationVM destructor
@@ -141,11 +135,11 @@ public:
   virtual surf_resource_t getPm()=0;
 
   virtual void setBound(double bound)=0;
   virtual surf_resource_t getPm()=0;
 
   virtual void setBound(double bound)=0;
-  virtual void setAffinity(CpuPtr cpu, unsigned long mask)=0;
+  virtual void setAffinity(Cpu *cpu, unsigned long mask)=0;
 
   /* The vm object of the lower layer */
 
   /* The vm object of the lower layer */
-  CpuActionPtr p_action;
-  HostPtr p_subWs;  // Pointer to the ''host'' OS
+  CpuAction *p_action;
+  Host *p_subWs;  // Pointer to the ''host'' OS
   e_surf_vm_state_t p_currentState;
 };
 
   e_surf_vm_state_t p_currentState;
 };