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 "S4U_PendingCommunication.h"
18 
19 namespace wrench {
20 
21  class SimulationMessage;
22 
23  /*******************/
25  /*******************/
26 
29  public:
30  S4U_PendingCommunication(std::string mailbox);
31 
32  std::unique_ptr<SimulationMessage> wait();
33 
34  static unsigned long waitForSomethingToHappen(
35  std::vector<std::unique_ptr<S4U_PendingCommunication>> pending_comms,
36  double timeout);
37 
38  static unsigned long waitForSomethingToHappen(
39  std::vector<S4U_PendingCommunication*> pending_comms,
40  double timeout);
41 
43  simgrid::s4u::CommPtr comm_ptr;
45  std::unique_ptr<SimulationMessage> simulation_message;
47  std::string mailbox_name;
48  };
49 
50  /*******************/
52  /*******************/
53 
54 };
55 
56 
57 #endif //WRENCH_S4U_PENDINGCOMMUNICATION_H
simgrid::s4u::CommPtr comm_ptr
The SimGrid communication handle.
Definition: S4U_PendingCommunication.h:43
std::string mailbox_name
The mailbox name.
Definition: S4U_PendingCommunication.h:47
std::unique_ptr< SimulationMessage > wait()
Wait for the pending communication to complete.
Definition: S4U_PendingCommunication.cpp:31
This is a simple wrapper class around S4U asynchronous communication checking methods.
Definition: S4U_PendingCommunication.h:28
std::unique_ptr< SimulationMessage > simulation_message
The message.
Definition: S4U_PendingCommunication.h:45
S4U_PendingCommunication(std::string mailbox)
Constructor.
Definition: S4U_PendingCommunication.cpp:131
static unsigned long waitForSomethingToHappen(std::vector< std::unique_ptr< S4U_PendingCommunication >> pending_comms, double timeout)
Wait for any pending communication completion.
Definition: S4U_PendingCommunication.cpp:60
Definition: TerminalOutput.cpp:15