Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplify calls to CommImpl::isend and CommImpl::irecv
[simgrid.git] / src / kernel / activity / CommImpl.hpp
index 5f69a59..8e5ea13 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2022. 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. */
@@ -8,8 +8,7 @@
 
 #include "src/kernel/activity/ActivityImpl.hpp"
 #include "src/kernel/actor/ActorImpl.hpp"
-#include "surf/surf.hpp"
-
+#include "src/kernel/actor/SimcallObserver.hpp"
 
 namespace simgrid {
 namespace kernel {
@@ -48,11 +47,14 @@ public:
   MailboxImpl* get_mailbox() const { return mbox_; }
   bool detached() const { return detached_; }
 
+  std::vector<s4u::Link*> get_traversed_links() const;
   void copy_data();
 
-  bool test() override;
+  static ActivityImplPtr isend(actor::CommIsendSimcall* observer);
+  static ActivityImplPtr irecv(actor::CommIrecvSimcall* observer);
+
+  bool test(actor::ActorImpl* issuer) override;
   void wait_for(actor::ActorImpl* issuer, double timeout) override;
-  static int test_any(actor::ActorImpl* issuer, const std::vector<CommImpl*>& comms);
   static void wait_any_for(actor::ActorImpl* issuer, const std::vector<CommImpl*>& comms, double timeout);
 
   CommImpl* start();
@@ -60,6 +62,7 @@ public:
   void resume() override;
   void cancel() override;
   void post() override;
+  void set_exception(actor::ActorImpl* issuer) override;
   void finish() override;
 
   const Type type_ = Type::SEND; /* Type of the communication (SEND or RECEIVE) */
@@ -90,6 +93,8 @@ expectations of the other side, too. See  */
 
   void* src_data_ = nullptr; /* User data associated to the communication */
   void* dst_data_ = nullptr;
+  static xbt::signal<void(CommImpl const&)> on_start;
+  static xbt::signal<void(CommImpl const&)> on_completion;
 };
 } // namespace activity
 } // namespace kernel