Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
give a default value at field declaration, not everywhere in subclasses
[simgrid.git] / src / surf / cpu_ti.hpp
index a23b38c..9d6d922 100644 (file)
@@ -13,6 +13,9 @@
 /* Epsilon */
 #define EPSILON 0.000000001
 
+namespace simgrid {
+namespace surf {
+
 /***********
  * Classes *
  ***********/
@@ -65,7 +68,7 @@ public:
   double m_value;                 /*< Percentage of cpu speed available. Value fixed between 0 and 1 */
 
   /* Dynamic */
-  double m_lastTime;             /*< Integral interval last point (discret time) */
+  double m_lastTime;             /*< Integral interval last point (discrete time) */
   double m_total;                 /*< Integral total between 0 and last_pointn */
 
   CpuTiTrace *p_trace;
@@ -78,10 +81,6 @@ public:
 
 class CpuTiAction: public CpuAction {
   friend class CpuTi;
-  // 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:
   CpuTiAction(CpuTiModel *model, double cost, bool failed,
                    CpuTi *cpu);
@@ -100,7 +99,7 @@ public:
 
   CpuTi *p_cpu;
   int m_indexHeap;
-  int m_suspended;
+  int m_suspended = 0;
 public:
   boost::intrusive::list_member_hook<> action_ti_hook;
 };
@@ -116,10 +115,9 @@ typedef boost::intrusive::list<
 class CpuTi : public Cpu {
 public:
   CpuTi() {};
-  CpuTi(CpuTiModel *model, const char *name, xbt_dynar_t speedPeak,
+  CpuTi(CpuTiModel *model, simgrid::Host *host, xbt_dynar_t speedPeak,
         int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
-        e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
-       xbt_dict_t properties) ;
+        e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace) ;
   ~CpuTi();
 
   void updateState(tmgr_trace_event_t event_type, double value, double date);
@@ -162,12 +160,11 @@ class CpuTiModel : public CpuModel {
 public:
   CpuTiModel();
   ~CpuTiModel();
-  Cpu *createCpu(const char *name,  xbt_dynar_t speedPeak,
+  Cpu *createCpu(simgrid::Host *host,  xbt_dynar_t speedPeak,
                           int pstate, double speedScale,
                           tmgr_trace_t speedTrace, int core,
                           e_surf_resource_state_t state_initial,
-                          tmgr_trace_t state_trace,
-                          xbt_dict_t cpu_properties);
+                          tmgr_trace_t state_trace);
   double shareResources(double now);
   void updateActionsState(double now, double delta);
   void addTraces();
@@ -177,10 +174,13 @@ public:
   xbt_heap_t p_tiActionHeap;
 
 protected:
-  void NotifyResourceTurnedOn(Resource*){};
-  void NotifyResourceTurnedOff(Resource*){};
+  void NotifyResourceTurnedOn(simgrid::surf::Resource*){};
+  void NotifyResourceTurnedOff(simgrid::surf::Resource*){};
 
   void NotifyActionCancel(Action*){};
   void NotifyActionResume(Action*){};
   void NotifyActionSuspend(Action*){};
 };
+
+}
+}