RTC Toolkit  2.0.0
serviceDiscovery.hpp
Go to the documentation of this file.
1 
12 #ifndef RTCTK_COMPONENTFRAMEWORK_SERVICEDISCOVERY_HPP
13 #define RTCTK_COMPONENTFRAMEWORK_SERVICEDISCOVERY_HPP
14 
15 #include <memory>
16 #include <string>
17 #include <vector>
18 
19 #include <mal/Cii.hpp>
20 
23 
24 namespace rtctk::componentFramework {
25 
30 public:
32 
39  explicit ServiceDiscovery(std::unique_ptr<ServiceRegistryIf>&& adapter, const std::string& comp_name = "");
40 
47  explicit ServiceDiscovery(const elt::mal::Uri& registry, const std::string& comp_name = "");
48 
56  std::vector<std::string> ListComponents();
57 
75  ServiceEndpoint GetReqRepEndpoint (const std::string& component_name = "");
81  ServiceEndpoint GetPubSubEndpoint (const std::string& component_name = "");
82 
83 
84 private:
88  std::unique_ptr<ServiceRegistryIf> m_adapter;
92  const std::string m_component_name;
93 };
94 
95 } // namespace rtctk::componentFramework
96 
97 #endif // RTCTK_COMPONENTFRAMEWORK_SERVICEDISCOVERY_HPP
rtctk::componentFramework::ServiceDiscovery::GetRuntimeRepoEndpoint
ServiceEndpoint GetRuntimeRepoEndpoint()
Get the Runtime Repository Endpoint from the ServiceDiscovery.
Definition: serviceDiscovery.cpp:35
exceptions.hpp
Provides macros and utilities for exception handling.
rtctk::componentFramework::ServiceDiscovery::ListComponents
std::vector< std::string > ListComponents()
Get known components.
Definition: serviceDiscovery.cpp:27
rtctk::componentFramework::ServiceDiscovery::ServiceDiscovery
ServiceDiscovery(std::unique_ptr< ServiceRegistryIf > &&adapter, const std::string &comp_name="")
Create a new ServiceDiscovery object.
Definition: serviceDiscovery.cpp:17
rtctk::componentFramework::ServiceDiscovery::GetPubSubEndpoint
ServiceEndpoint GetPubSubEndpoint(const std::string &component_name="")
Get the PubSub Endpoint of a component.
Definition: serviceDiscovery.cpp:51
rtctk::componentFramework
Definition: commandReplier.cpp:20
rtctk::componentFramework::ServiceRegistryIf::ServiceEndpoint
elt::mal::Uri ServiceEndpoint
Definition: serviceRegistryIf.hpp:30
rtctk::componentFramework::ServiceDiscovery
Class that implements a very basic service discovery mechanism.
Definition: serviceDiscovery.hpp:29
serviceRegistryIf.hpp
Class that implements a very basic service discover mechanism.
rtctk::componentFramework::ServiceDiscovery::ServiceEndpoint
ServiceRegistryIf::ServiceEndpoint ServiceEndpoint
Definition: serviceDiscovery.hpp:31
rtctk::componentFramework::ServiceDiscovery::GetOldbEndpoint
ServiceEndpoint GetOldbEndpoint()
Get the Oldb Endpoint from the ServiceDiscovery.
Definition: serviceDiscovery.cpp:31
rtctk::componentFramework::ServiceDiscovery::GetPersistentRepoEndpoint
ServiceEndpoint GetPersistentRepoEndpoint()
Get the Persistent Repository Endpoint from the ServiceDiscovery.
Definition: serviceDiscovery.cpp:39
rtctk::componentFramework::ServiceDiscovery::GetReqRepEndpoint
ServiceEndpoint GetReqRepEndpoint(const std::string &component_name="")
Get the Request/Reply Endpoint of a component.
Definition: serviceDiscovery.cpp:43