WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
S4U_PendingCommunication.h
1 
11 #ifndef WRENCH_S4U_PENDINGCOMMUNICATION_H
12 #define WRENCH_S4U_PENDINGCOMMUNICATION_H
13 
14 
15 #include <vector>
16 #include <simgrid/s4u/Comm.hpp>
17 #include "wrench/util/MessageManager.h"
18 
19 //#include "S4U_PendingCommunication.h"
20 
21 namespace wrench {
22 
23  class SimulationMessage;
24 
25  /*******************/
27  /*******************/
28 
30  class S4U_PendingCommunication {
31  public:
32 
36  enum OperationType {
37  SENDING,
38  RECEIVING
39  };
40 
47  S4U_PendingCommunication(simgrid::s4u::Mailbox *mailbox, OperationType operation_type) : mailbox(mailbox), operation_type(operation_type) {}
48 
49  std::unique_ptr<SimulationMessage> wait();
50  std::unique_ptr<SimulationMessage> wait(double timeout);
51 
52  static unsigned long waitForSomethingToHappen(
53  std::vector<std::shared_ptr<S4U_PendingCommunication>> pending_comms,
54  double timeout);
55 
56  static unsigned long waitForSomethingToHappen(
57  std::vector<S4U_PendingCommunication*> pending_comms,
58  double timeout);
59 
60 // ~S4U_PendingCommunication() default;
61 
63  simgrid::s4u::CommPtr comm_ptr;
65  std::unique_ptr<SimulationMessage> simulation_message;
67  simgrid::s4u::Mailbox *mailbox;
69  OperationType operation_type;
70  };
71 
72  /*******************/
74  /*******************/
75 
76 };
77 
78 
79 #endif //WRENCH_S4U_PENDINGCOMMUNICATION_H
wrench
Definition: Action.cpp:28