X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4de2a148bea34f550b79c07fb5e80ac36e6aa0e9..f0534a5e2af72c36c12d55f7ea323040e6e9bf36:/src/kernel/activity/CommImpl.hpp diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index 3912d23728..340a19d2ff 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2023. 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. */ @@ -10,15 +10,14 @@ #include "src/kernel/actor/ActorImpl.hpp" #include "src/kernel/actor/CommObserver.hpp" -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { enum class CommImplType { SEND, RECEIVE }; +using timeout_action_type = std::unique_ptr>; + class XBT_PUBLIC CommImpl : public ActivityImpl_T { ~CommImpl() override; - void cleanup_surf(); static std::function copy_data_callback_; @@ -71,7 +70,6 @@ public: void suspend() override; void resume() override; void cancel() override; - void post() override; void set_exception(actor::ActorImpl* issuer) override; void finish() override; @@ -81,9 +79,10 @@ looking if a given communication matches my needs. For that, myself must match t expectations of the other side, too. See */ std::function copy_data_fun; - /* Surf action data */ - resource::Action* src_timeout_ = nullptr; /* Surf's actions to instrument the timeouts */ - resource::Action* dst_timeout_ = nullptr; /* Surf's actions to instrument the timeouts */ + /* Model actions */ + timeout_action_type src_timeout_{nullptr, [](resource::Action* a) { a->unref(); }}; /* timeout set by the sender */ + timeout_action_type dst_timeout_{nullptr, [](resource::Action* a) { a->unref(); }}; /* timeout set by the receiver */ + actor::ActorImplPtr src_actor_ = nullptr; actor::ActorImplPtr dst_actor_ = nullptr; @@ -95,11 +94,7 @@ expectations of the other side, too. See */ void* src_data_ = nullptr; /* User data associated to the communication */ void* dst_data_ = nullptr; - static xbt::signal on_start; - static xbt::signal on_completion; }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif