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 
49 {
50 public:
52  struct SlaveType
53  {
56 
59  };
60 
73  const coral::net::ip::Address& networkInterface,
74  coral::net::ip::Port discoveryPort);
75 
77  ~ProviderCluster() CORAL_NOEXCEPT;
78 
79  // Disable copying
80  ProviderCluster(const ProviderCluster&) = delete;
81  ProviderCluster& operator=(const ProviderCluster&) = delete;
82 
84  ProviderCluster(ProviderCluster&&) CORAL_NOEXCEPT;
85 
87  ProviderCluster& operator=(ProviderCluster&&) CORAL_NOEXCEPT;
88 
102  std::vector<SlaveType> GetSlaveTypes(std::chrono::milliseconds timeout);
103 
128  coral::net::SlaveLocator InstantiateSlave(
129  const std::string& slaveProviderID,
130  const std::string& slaveTypeUUID,
131  std::chrono::milliseconds timeout);
132 
133 private:
134  class Private;
135  std::unique_ptr<Private> m_private;
136 };
137 
138 
139 }} //namespace
140 #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)
Requests that a slave be spawned by a specific slave provider.
ProviderCluster(const coral::net::ip::Address &networkInterface, coral::net::ip::Port discoveryPort)
Constructor.
Main module header for coral::net.
STL namespace.
A common communication interface to a cluster of slave providers.
Definition: cluster.hpp:48
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.
coral::model::SlaveTypeDescription description
A description of the slave type.
Definition: cluster.hpp:55
std::vector< std::string > providers
A list of IDs of slave providers that offer this slave type.
Definition: cluster.hpp:58
Information about a slave type.
Definition: cluster.hpp:52
std::vector< SlaveType > GetSlaveTypes(std::chrono::milliseconds timeout)
Returns the slave types which are offered by all slave providers discovered so far.
Main module header for coral::model.