coral
A C++ library for distributed co-simulation
runner.hpp
Go to the documentation of this file.
1 
10 #ifndef CORAL_SLAVE_RUNNER_HPP
11 #define CORAL_SLAVE_RUNNER_HPP
12 
13 #include <chrono>
14 #include <memory>
15 #include <coral/config.h>
16 #include <coral/net.hpp>
17 #include <coral/slave/instance.hpp>
18 
19 
20 namespace coral
21 {
22 
23 // Forward declarations to avoid dependencies on internal classes.
24 namespace bus { class SlaveAgent; }
25 namespace net { class Reactor; }
26 
27 namespace slave
28 {
29 
30 
32 class Runner
33 {
34 public:
35  Runner(
36  std::shared_ptr<Instance> slaveInstance,
37  const coral::net::Endpoint& controlEndpoint,
38  const coral::net::Endpoint& dataPubEndpoint,
39  std::chrono::seconds commTimeout);
40 
41  Runner(Runner&&) CORAL_NOEXCEPT;
42 
43  Runner& operator=(Runner&&) CORAL_NOEXCEPT;
44 
45  ~Runner();
46 
47  coral::net::Endpoint BoundControlEndpoint();
48  coral::net::Endpoint BoundDataPubEndpoint();
49 
50  void Run();
51 
52 private:
53  std::shared_ptr<Instance> m_slaveInstance;
56 };
57 
58 
59 }} // namespace
60 #endif // header guard
Main module header for coral::net.
A class for running a slave instance.
Definition: runner.hpp:32
A protocol/transport independent endpoint address specification.
Definition: net.hpp:34
Definition: variable_io.hpp:28
Defines the coral::slave::Instance interface.