Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rework SleepImpl (and save a cast)
[simgrid.git] / src / kernel / activity / SleepImpl.hpp
index 2713736..30a004c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -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