Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar don't like comments ending with ';'
[simgrid.git] / src / kernel / activity / ExecImpl.hpp
1 /* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #ifndef SIMIX_SYNCHRO_EXEC_HPP
7 #define SIMIX_SYNCHRO_EXEC_HPP
8
9 #include "src/kernel/activity/ActivityImpl.hpp"
10 #include "surf/surf.hpp"
11
12 namespace simgrid {
13 namespace kernel {
14 namespace activity {
15
16 XBT_PUBLIC_CLASS ExecImpl : public ActivityImpl
17 {
18   ~ExecImpl() override;
19
20 public:
21   explicit ExecImpl(const char* name, sg_host_t host);
22   void suspend() override;
23   void resume() override;
24   void post() override;
25   double remains();
26   double remainingRatio();
27   void setBound(double bound);
28   virtual ActivityImpl* migrate(s4u::Host* to);
29
30   /* The host where the execution takes place. nullptr means this is a parallel exec (and only surf knows the hosts) */
31   sg_host_t host_               = nullptr;
32   surf_action_t surfAction_     = nullptr; /* The Surf execution action encapsulated */
33   surf::Action* timeoutDetector = nullptr;
34   static simgrid::xbt::signal<void(kernel::activity::ExecImplPtr)> onCreation;
35   static simgrid::xbt::signal<void(kernel::activity::ExecImplPtr)> onCompletion;
36   static simgrid::xbt::signal<void(simgrid::kernel::activity::ExecImplPtr, simgrid::s4u::Host*)> onMigration;
37
38 };
39 }
40 }
41 } // namespace simgrid::kernel::activity
42 #endif