NetworkProximityMessage.h
1 
10 #ifndef WRENCH_NETWORKPROXIMITYMESSAGE_H
11 #define WRENCH_NETWORKPROXIMITYMESSAGE_H
12 
13 #include <wrench/services/network_proximity/NetworkProximityDaemon.h>
14 #include <wrench/services/ServiceMessage.h>
15 
16 namespace wrench {
17 
18  /***********************/
20  /***********************/
21 
26  protected:
27  NetworkProximityMessage(std::string name, double payload);
28 
29  };
30 
31 
36  public:
37  NetworkProximityLookupRequestMessage(std::string answer_mailbox, std::pair<std::string, std::string> hosts,
38  double payload);
39 
41  std::string answer_mailbox;
43  std::pair<std::string, std::string> hosts;
44  };
45 
46 
51  public:
52  NetworkProximityLookupAnswerMessage(std::pair<std::string, std::string> hosts, double proximity_value,
53  double timestamp, double payload);
54 
56  std::pair<std::string, std::string> hosts;
60  double timestamp;
61  };
62 
63 
68  public:
69  NetworkProximityComputeAnswerMessage(std::pair<std::string, std::string> hosts, double proximity_value,
70  double payload);
71 
73  std::pair<std::string, std::string> hosts;
76  };
77 
82  public:
84 
85  };
86 
91  public:
92  NextContactDaemonRequestMessage(std::shared_ptr<NetworkProximityDaemon> daemon, double payload);
93 
95  std::shared_ptr<NetworkProximityDaemon> daemon;
96  };
97 
102  public:
103  NextContactDaemonAnswerMessage(std::string next_host_to_send,
104  std::shared_ptr<NetworkProximityDaemon> next_daemon_to_send,
105  std::string next_mailbox_to_send, double payload);
106 
108  std::string next_host_to_send;
109 
111  std::shared_ptr<NetworkProximityDaemon> next_daemon_to_send;
112 
114  std::string next_mailbox_to_send;
115  };
116 
121  public:
122  CoordinateLookupRequestMessage(std::string answer_mailbox, std::string requested_host, double payload);
123 
125  std::string answer_mailbox;
126 
128  std::string requested_host;
129  };
130 
135  public:
136  CoordinateLookupAnswerMessage(std::string requested_host, bool success, std::pair<double, double> xy_coordinate,
137  double timestamp, double payload);
138 
140  std::string requested_host;
141 
143  bool success;
144 
146  std::pair<double, double> xy_coordinate;
148  double timestamp;
149  };
150 
151  /***********************/
153  /***********************/
154 }
155 
156 
157 #endif //WRENCH_NETWORKPROXIMITYMESSAGE_H
std::string next_mailbox_to_send
The next mailbox for the network daemon to contact.
Definition: NetworkProximityMessage.h:114
std::pair< std::string, std::string > hosts
The hosts whose proximity values were calculated.
Definition: NetworkProximityMessage.h:73
A message received by a NetworkProximityService that updates its database of proximity values...
Definition: NetworkProximityMessage.h:67
double proximity_value
The calculated proximity value.
Definition: NetworkProximityMessage.h:58
A message sent by a NetworkProximityService to a NetworkProximityDaemon to tell it which other Networ...
Definition: NetworkProximityMessage.h:101
std::pair< std::string, std::string > hosts
The hosts between which to calculate a proximity value.
Definition: NetworkProximityMessage.h:43
NetworkProximityMessage(std::string name, double payload)
Constructor.
Definition: NetworkProximityMessage.cpp:18
A message sent to a NetworkProximityService to request a network proximity lookup.
Definition: NetworkProximityMessage.h:35
double timestamp
The timestamp of the oldest measurement data used to calculate the proximity value.
Definition: NetworkProximityMessage.h:148
double payload
The message size in bytes.
Definition: SimulationMessage.h:39
std::string requested_host
The name of the host whose coordinates are being requested.
Definition: NetworkProximityMessage.h:128
std::string answer_mailbox
The mailbox to which the answer should be sent back.
Definition: NetworkProximityMessage.h:125
std::string name
The message name.
Definition: SimulationMessage.h:37
Top-level class for messages received/sent by a NetworkProximityService.
Definition: NetworkProximityMessage.h:25
double proximity_value
The computed proximity value.
Definition: NetworkProximityMessage.h:75
A message sent to a NetworkProximityService to request a coordinate lookup.
Definition: NetworkProximityMessage.h:120
Top-level class for messages received/sent by a Service.
Definition: ServiceMessage.h:27
std::pair< std::string, std::string > hosts
The hosts whose proximity values were calculated.
Definition: NetworkProximityMessage.h:56
std::string answer_mailbox
The mailbox to which the answer message should be sent.
Definition: NetworkProximityMessage.h:41
A message sent by a NetworkProximityService in answer to a network proximity lookup request...
Definition: NetworkProximityMessage.h:50
std::string requested_host
The name of the host whose coordinates were requested.
Definition: NetworkProximityMessage.h:140
bool success
Whether the lookup was successful or not.
Definition: NetworkProximityMessage.h:143
A message sent to a NetworkProximityService by a NetworkProximityDaemon to ask which other NetworkPro...
Definition: NetworkProximityMessage.h:90
std::string next_host_to_send
The next host for the NetworkProximityDaemon to contact.
Definition: NetworkProximityMessage.h:108
std::shared_ptr< NetworkProximityDaemon > daemon
The NetworkProximityDaemon daemon to return the answer to.
Definition: NetworkProximityMessage.h:95
A message sent between NetworkProximityDaemon processes to perform network measurements.
Definition: NetworkProximityMessage.h:81
A message sent by a NetworkProximityService in answer to a coordinate lookup request.
Definition: NetworkProximityMessage.h:134
double timestamp
The timestamp of the oldest measurement data used to calculate the proximity value.
Definition: NetworkProximityMessage.h:60
std::pair< double, double > xy_coordinate
The current (x,y) coordinates of the requested host.
Definition: NetworkProximityMessage.h:146
std::shared_ptr< NetworkProximityDaemon > next_daemon_to_send
The next NetworkProximityDaemon for the NetworkProximityDaemon to contact.
Definition: NetworkProximityMessage.h:111
Definition: Alarm.cpp:19