coral
A C++ library for distributed co-simulation
cluster.hpp
Go to the documentation of this file.
1 
10 #ifndef CORAL_MASTER_CLUSTER_HPP
11 #define CORAL_MASTER_CLUSTER_HPP
12 
13 #include <chrono>
14 #include <cstdint>
15 #include <memory>
16 #include <string>
17 #include <vector>
18 
19 #include "coral/config.h"
20 #include "coral/model.hpp"
21 #include "coral/net.hpp"
22 
23 
24 namespace coral
25 {
26 namespace master
27 {
28 
29 
45 {
46 public:
48  struct SlaveType
49  {
51  std::vector<std::string> providers;
52  };
53 
65  const coral::net::ip::Address& networkInterface,
66  coral::net::ip::Port discoveryPort);
67 
69  ~ProviderCluster() CORAL_NOEXCEPT;
70 
71  // Disable copying
72  ProviderCluster(const ProviderCluster&) = delete;
73  ProviderCluster& operator=(const ProviderCluster&) = delete;
74 
76  ProviderCluster(ProviderCluster&&) CORAL_NOEXCEPT;
77 
79  ProviderCluster& operator=(ProviderCluster&&) CORAL_NOEXCEPT;
80 
88 
111  const std::string& slaveProviderID,
112  const std::string& slaveTypeUUID,
113  std::chrono::milliseconds timeout);
114 
115 private:
116  class Private;
117  std::unique_ptr<Private> m_private;
118 };
119 
120 
121 }} //namespace
122 #endif // header guard
An object which represents an internet port number.
Definition: net.hpp:156
coral::net::SlaveLocator InstantiateSlave(const std::string &slaveProviderID, const std::string &slaveTypeUUID, std::chrono::milliseconds timeout)
Instantiates a slave.
ProviderCluster(const coral::net::ip::Address &networkInterface, coral::net::ip::Port discoveryPort)
Constructor.
Main module header for coral::net.
A common communication interface to a cluster of slave providers.
Definition: cluster.hpp:44
STL class.
An object which identifies an internet host or network interface as either an IPv4 address or a textu...
Definition: net.hpp:80
A description of a slave type.
Definition: model.hpp:148
Definition: variable_io.hpp:28
~ProviderCluster() CORAL_NOEXCEPT
Destructor.
Information about a slave type.
Definition: cluster.hpp:48
Class which represents the network location(s) of a slave.
Definition: net.hpp:292
std::vector< SlaveType > GetSlaveTypes(std::chrono::milliseconds timeout)
Returns available slave types.
Main module header for coral::model.