NetworkConnection.h
1 
10 #ifndef WRENCH_NETWORKCONNECTION_H
11 #define WRENCH_NETWORKCONNECTION_H
12 
13 
14 #include <string>
15 #include <memory>
16 #include <wrench/simgrid_S4U_util/S4U_PendingCommunication.h>
17 #include <wrench/workflow/execution_events/FailureCause.h>
18 
19 namespace wrench {
20 
21  /***********************/
23  /***********************/
24 
25  class WorkflowFile;
26  class SimulationTimestampFileCopyStart;
27 
34 
35  public:
36 
41  INCOMING_DATA,
42  OUTGOING_DATA,
43  INCOMING_CONTROL
44  };
45 
47  bool start();
48  bool hasFailed();
49  std::unique_ptr<SimulationMessage> getMessage();
50 
52  int type;
56  std::string file_partition;
58  std::string mailbox;
60  std::unique_ptr<S4U_PendingCommunication> comm;
62  std::shared_ptr<FailureCause> failure_cause;
64  std::string ack_mailbox;
67  };
68 
69  /***********************/
71  /***********************/
72 
73 };
74 
75 
76 #endif //WRENCH_NETWORKCONNECTION_H
std::unique_ptr< SimulationMessage > getMessage()
Retrieve the message for a communication.
Definition: NetworkConnection.cpp:144
NetworkConnectionType
An enumerated type that denotes whether a network connection is incoming or outgoing, and whether it&#39;s about data or about control.
Definition: NetworkConnection.h:40
std::unique_ptr< S4U_PendingCommunication > comm
The low-level pending communication.
Definition: NetworkConnection.h:60
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
std::shared_ptr< FailureCause > failure_cause
The failure cause, in case the communication fails.
Definition: NetworkConnection.h:62
bool start()
star a network connection
Definition: NetworkConnection.cpp:69
int type
: the connection type
Definition: NetworkConnection.h:52
NetworkConnection(int type, WorkflowFile *file, std::string file_partition, std::string mailbox, std::string ack_mailbox, SimulationTimestampFileCopyStart *start_timestamp=nullptr)
Constructor.
Definition: NetworkConnection.cpp:36
std::string file_partition
: the file partition inside the storage service where the file will be stored to/read from ...
Definition: NetworkConnection.h:56
WorkflowFile * file
: the file (for a DATA connection)
Definition: NetworkConnection.h:54
std::string mailbox
: the mailbox for this connection
Definition: NetworkConnection.h:58
A simulation timestamp class for file copy start times.
Definition: SimulationTimestampTypes.h:195
SimulationTimestampFileCopyStart * start_timestamp
: if this is a file copy, a start timestamp associated with it
Definition: NetworkConnection.h:66
bool hasFailed()
Returns true if the connection has failed, false otherwise.
Definition: NetworkConnection.cpp:111
A helper class that implements a network connection abstraction to be used by a service, e.g., when the service needs to limit its number of concurrent connections.
Definition: NetworkConnection.h:33
Definition: TerminalOutput.cpp:15
std::string ack_mailbox
: the mailbox to which to send an ack when this connection completes/fails
Definition: NetworkConnection.h:64