Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Register ExecImpls with ActorImpl.
[simgrid.git] / src / kernel / activity / ExecImpl.hpp
index ab92675..b7ae692 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2020. 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. */
@@ -15,16 +15,19 @@ namespace kernel {
 namespace activity {
 
 class XBT_PUBLIC ExecImpl : public ActivityImpl_T<ExecImpl> {
-  resource::Action* timeout_detector_ = nullptr;
+  std::unique_ptr<resource::Action, std::function<void(resource::Action*)>> timeout_detector_{
+      nullptr, [](resource::Action* a) { a->unref(); }};
+  actor::ActorImpl* actor_            = nullptr;
   double sharing_penalty_             = 1.0;
   double bound_                       = 0.0;
   std::vector<s4u::Host*> hosts_;
   std::vector<double> flops_amounts_;
   std::vector<double> bytes_amounts_;
-  ~ExecImpl();
 
 public:
-  ExecImpl& set_timeout(double timeout);
+  ExecImpl();
+
+  ExecImpl& set_timeout(double timeout) override;
   ExecImpl& set_bound(double bound);
   ExecImpl& set_sharing_penalty(double sharing_penalty);