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 
31  public:
32 
37  SENDING,
38  RECEIVING
39  };
40 
48 
49  std::shared_ptr<SimulationMessage> wait();
50 
51  static unsigned long waitForSomethingToHappen(
52  std::vector<std::shared_ptr<S4U_PendingCommunication>> pending_comms,
53  double timeout);
54 
55  static unsigned long waitForSomethingToHappen(
56  std::vector<S4U_PendingCommunication*> pending_comms,
57  double timeout);
58 
59 // ~S4U_PendingCommunication() default;
60 
62  simgrid::s4u::CommPtr comm_ptr;
64  std::shared_ptr<SimulationMessage> simulation_message;
66  std::string mailbox_name;
69  };
70 
71  /*******************/
73  /*******************/
74 
75 };
76 
77 
78 #endif //WRENCH_S4U_PENDINGCOMMUNICATION_H
simgrid::s4u::CommPtr comm_ptr
The SimGrid communication handle.
Definition: S4U_PendingCommunication.h:62
OperationType operation_type
The operation type.
Definition: S4U_PendingCommunication.h:68
This is a simple wrapper class around S4U asynchronous communication checking methods.
Definition: S4U_PendingCommunication.h:30
Definition: Alarm.cpp:20
static unsigned long waitForSomethingToHappen(std::vector< std::shared_ptr< S4U_PendingCommunication >> pending_comms, double timeout)
Wait for any pending communication completion.
Definition: S4U_PendingCommunication.cpp:61
std::shared_ptr< SimulationMessage > simulation_message
The message.
Definition: S4U_PendingCommunication.h:64
OperationType
The communication operation's type.
Definition: S4U_PendingCommunication.h:36
std::string mailbox_name
The mailbox name.
Definition: S4U_PendingCommunication.h:66
S4U_PendingCommunication(std::string mailbox_name, OperationType operation_type)
Constructor.
Definition: S4U_PendingCommunication.h:47
std::shared_ptr< SimulationMessage > wait()
Wait for the pending communication to complete.
Definition: S4U_PendingCommunication.cpp:34