Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
frame a concept of execution, that will become a s4u::Async
[simgrid.git] / src / surf / cpu_cas01.hpp
index 04d2896..88c6386 100644 (file)
@@ -42,18 +42,17 @@ public:
  ************/
 
 class CpuCas01 : public Cpu {
+  friend CpuCas01Model;
 public:
   CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
         int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
         int initiallyOn, tmgr_trace_t stateTrace) ;
   ~CpuCas01();
   void updateState(tmgr_trace_iterator_t event_type, double value, double date) override;
-  CpuAction *execute(double size) override;
+  CpuAction *execution_start(double size) override;
   CpuAction *sleep(double duration) override;
 
   bool isUsed() override;
-  void setStateEvent(tmgr_trace_iterator_t stateEvent);
-  void setPowerEvent(tmgr_trace_iterator_t stateEvent);
 
   xbt_dynar_t getSpeedPeakList(); // FIXME: killme to hide our internals
 
@@ -62,15 +61,15 @@ protected:
 
 private:
 
-  tmgr_trace_iterator_t p_stateEvent;
-  tmgr_trace_iterator_t p_speedEvent;
+  tmgr_trace_iterator_t p_stateEvent = nullptr;
+  tmgr_trace_iterator_t p_speedEvent = nullptr;
 };
 
 /**********
  * Action *
  **********/
 class CpuCas01Action: public CpuAction {
-  friend CpuAction *CpuCas01::execute(double size);
+  friend CpuAction *CpuCas01::execution_start(double size);
   friend CpuAction *CpuCas01::sleep(double duration);
 public:
   CpuCas01Action(Model *model, double cost, bool failed, double speed,