WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Alarm.h
1 
10 #ifndef WRENCH_ALARM_H
11 #define WRENCH_ALARM_H
12 
13 #include <string>
14 #include <memory>
15 #include "wrench/services/Service.h"
16 #include "wrench/simulation/SimulationMessage.h"
17 
18 namespace wrench {
19 
20  /***********************/
22  /***********************/
23 
24 
25  class Simulation;
26 
30  class Alarm : public Service {
31 
32  friend class S4U_Daemon;
33 
34  public:
35 
36  static std::shared_ptr<Alarm> createAndStartAlarm(Simulation *simulation, double date, std::string hostname,
37  simgrid::s4u::Mailbox *reply_mailbox_name,
38  SimulationMessage *msg, std::string suffix);
39 
40  void kill();
41 
42  private:
43  Alarm(double date, std::string hostname, simgrid::s4u::Mailbox *reply_mailbox,
44  SimulationMessage *msg, std::string suffix);
45 
46  double date;
47 // std::string reply_mailbox_name;
48  simgrid::s4u::Mailbox *reply_mailbox;
49  SimulationMessage *msg;
50 
51  int main() override;
52 
53  };
54 
55  /***********************/
57  /***********************/
58 
59 }
60 
61 #endif //WRENCH_ALARM_H
wrench::SimulationMessage
Top-level class to describe a message communicated by processes in the simulation.
Definition: SimulationMessage.h:28
wrench::Alarm::kill
void kill()
Immediately (i.e., brutally) terminate the alarm service.
Definition: Alarm.cpp:102
wrench
Definition: Action.cpp:28
wrench::Alarm::createAndStartAlarm
static std::shared_ptr< Alarm > createAndStartAlarm(Simulation *simulation, double date, std::string hostname, simgrid::s4u::Mailbox *reply_mailbox_name, SimulationMessage *msg, std::string suffix)
Create and start an alarm service.
Definition: Alarm.cpp:85
wrench::S4U_Daemon
A generic "running daemon" abstraction that serves as a basis for all simulated processes.
Definition: S4U_Daemon.h:32
wrench::S4U_Daemon::hostname
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:60
wrench::Simulation
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:48
wrench::Alarm
A one-shot service that sends a message to a mailbox after some specified amount of time and terminat...
Definition: Alarm.h:30
wrench::Service
A service that can be added to the simulation and that can be used by a WMS when executing a workflow...
Definition: Service.h:31
wrench::S4U_Daemon::simulation
Simulation * simulation
a pointer to the simulation object
Definition: S4U_Daemon.h:125