Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rework SleepImpl (and save a cast)
[simgrid.git] / src / kernel / activity / SleepImpl.hpp
index dbc0a7d..30a004c 100644 (file)
@@ -14,16 +14,19 @@ namespace kernel {
 namespace activity {
 
 class XBT_PUBLIC SleepImpl : public ActivityImpl {
+  sg_host_t host_  = nullptr;
+  double duration_ = 0;
+
 public:
-  void suspend() override;
-  void resume() override;
+  SleepImplPtr set_name(const std::string& name);
+  SleepImplPtr set_host(s4u::Host* host);
+  SleepImplPtr set_duration(double duration);
   void post() override;
-
-  sg_host_t host           = nullptr; /* The host that is sleeping */
-  simgrid::kernel::resource::Action* surf_sleep = nullptr; /* The Surf sleeping action encapsulated */
+  void finish() override;
+  SleepImpl* start();
 };
-}
-}
-} // namespace simgrid::kernel::activity
+} // namespace activity
+} // namespace kernel
+} // namespace simgrid
 
 #endif