WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
NetworkError.h
1 
10 #ifndef WRENCH_NETWORK_ERROR_H
11 #define WRENCH_NETWORK_ERROR_H
12 
13 #include <set>
14 #include <string>
15 
16 #include "FailureCause.h"
17 
18 namespace wrench {
19 
20 
21  /***********************/
23  /***********************/
24 
28  class NetworkError : public FailureCause {
29  public:
33  enum OperationType {
34  SENDING,
35  RECEIVING
36  };
37 
40  enum ErrorType {
41  TIMEOUT,
42  FAILURE
43  };
44 
45  /***********************/
47  /***********************/
48  NetworkError(NetworkError::OperationType, NetworkError::ErrorType, std::string mailbox);
49  /***********************/
51  /***********************/
52 
53  std::string toString() override;
54  bool whileReceiving();
55  bool whileSending();
56  bool isTimeout();
57  std::string getMailbox();
58 
59  private:
60  NetworkError::OperationType operation_type;
61  NetworkError::ErrorType error_type;
62  bool while_sending = false;
63  std::string mailbox = "";
64  };
65 
66 
67  /***********************/
69  /***********************/
70 };
71 
72 
73 #endif //WRENCH_NETWORK_ERROR_H
wrench::whileReceiving
bool whileReceiving()
Returns whether the network error occurred while receiving.
Definition: NetworkError.cpp:46
wrench::toString
std::string toString() override
Return an error message that describes the failure cause (to be overridden)
Definition: ComputeThreadHasDied.cpp:29
wrench::getMailbox
std::string getMailbox()
Returns the mailbox name on which the error occurred.
Definition: NetworkError.cpp:70
wrench
Definition: Action.cpp:28
wrench::isTimeout
bool isTimeout()
Returns whether the network error was a timeout.
Definition: NetworkError.cpp:62
wrench::whileSending
bool whileSending()
Returns whether the network error occurred while sending.
Definition: NetworkError.cpp:54