X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5d6ee66c4a278f168be501318e781c0853085bdc..acfd3860433a79c8620f7976ba1764d04253675b:/include/simgrid/s4u/Exec.hpp diff --git a/include/simgrid/s4u/Exec.hpp b/include/simgrid/s4u/Exec.hpp index f9a4007f41..a5d1079494 100644 --- a/include/simgrid/s4u/Exec.hpp +++ b/include/simgrid/s4u/Exec.hpp @@ -30,14 +30,19 @@ namespace s4u { * @endrst */ class XBT_PUBLIC Exec : public Activity_T { + friend kernel::activity::ExecImpl; double priority_ = 1.0; double bound_ = 0.0; - double timeout_ = 0.0; + double timeout_ = -1.0; // Infinite timeout by default std::vector flops_amounts_; std::vector bytes_amounts_; std::vector hosts_; bool parallel_ = false; - Exec(); + double start_time_ = -1.0; + double finish_time_ = -1.0; + +protected: + explicit Exec(kernel::activity::ExecImplPtr pimpl); public: ~Exec() override = default; @@ -77,11 +82,12 @@ public: Exec* cancel() override; Host* get_host() const; unsigned int get_host_number() const; - double get_start_time() const; - double get_finish_time() const; + double get_start_time() const { return start_time_; } + double get_finish_time() const { return finish_time_; } + void set_finish_time(double finish_time) { finish_time_ = finish_time; } double get_cost() const; bool is_parallel() const { return parallel_; } - bool is_assigned() { return not hosts_.empty(); } + bool is_assigned() const override { return not hosts_.empty(); } }; } // namespace s4u