WRENCH  1.10
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(std::string mailbox_name, OperationType operation_type) : mailbox_name(mailbox_name), operation_type(operation_type) {}
48 
49  std::unique_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::unique_ptr<SimulationMessage> simulation_message;
66  std::string mailbox_name;
68  OperationType operation_type;
69  };
70 
71  /*******************/
73  /*******************/
74 
75 };
76 
77 
78 #endif //WRENCH_S4U_PENDINGCOMMUNICATION_H
wrench
Definition: Alarm.cpp:20