1 /* Copyright (c) 2017. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMGRID_S4U_EXEC_HPP
7 #define SIMGRID_S4U_EXEC_HPP
9 #include <simgrid/forward.h>
10 #include <simgrid/s4u/Activity.hpp>
11 #include <simgrid/s4u/forward.hpp>
18 XBT_PUBLIC_CLASS Exec : public Activity
20 Exec() : Activity() {}
22 friend void intrusive_ptr_release(simgrid::s4u::Exec * e);
23 friend void intrusive_ptr_add_ref(simgrid::s4u::Exec * e);
24 friend Actor; // Factory of Exec
28 void start() override;
30 void wait(double timeout) override;
33 ExecPtr setPriority(double priority);
35 double getRemains() override;
36 double getRemainingRatio();
39 smx_actor_t runner_ = nullptr;
40 double flops_amount_ = 0.0;
41 double priority_ = 1.0;
43 std::atomic_int_fast32_t refcount_{0};
46 }; // Namespace simgrid::s4u
48 #endif /* SIMGRID_S4U_EXEC_HPP */