RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
serviceDiscovery.hpp
Go to the documentation of this file.
1
11
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
25
33public:
35
42 explicit ServiceDiscovery(std::unique_ptr<ServiceRegistryIf>&& adapter,
43 const std::string& comp_name = "");
44
52 explicit ServiceDiscovery(const elt::mal::Uri& registry, const std::string& comp_name = "");
53
64 std::vector<std::string>
65 ListComponents(const std::string& service_type = ServiceRegistryIf::COMPONENT_TYPE);
66
93 GetReqRepEndpoint(const std::string& name = "",
94 const std::string& service_type = ServiceRegistryIf::COMPONENT_TYPE,
95 const bool health_check = true);
106 GetPubSubEndpoint(const std::string& component_name = "",
107 const std::string& service_type = ServiceRegistryIf::COMPONENT_TYPE,
108 const bool health_check = true);
109
110private:
114 std::unique_ptr<ServiceRegistryIf> m_adapter;
118 const std::string m_component_name;
119};
120
121} // namespace rtctk::componentFramework
122
123#endif // RTCTK_COMPONENTFRAMEWORK_SERVICEDISCOVERY_HPP
ServiceEndpoint GetReqRepEndpoint(const std::string &name="", const std::string &service_type=ServiceRegistryIf::COMPONENT_TYPE, const bool health_check=true)
Get the Request/Reply Endpoint of a service like component.
Definition serviceDiscovery.cpp:85
ServiceEndpoint GetPersistentRepoEndpoint()
Get the Persistent Repository Endpoint from the ServiceDiscovery.
Definition serviceDiscovery.cpp:67
ServiceEndpoint GetPubSubEndpoint(const std::string &component_name="", const std::string &service_type=ServiceRegistryIf::COMPONENT_TYPE, const bool health_check=true)
Get the PubSub Endpoint of a component.
Definition serviceDiscovery.cpp:103
ServiceDiscovery(std::unique_ptr< ServiceRegistryIf > &&adapter, const std::string &comp_name="")
Create a new ServiceDiscovery object.
Definition serviceDiscovery.cpp:20
ServiceEndpoint GetOldbEndpoint()
Get the Oldb Endpoint from the ServiceDiscovery.
Definition serviceDiscovery.cpp:50
ServiceRegistryIf::ServiceEndpoint ServiceEndpoint
Definition serviceDiscovery.hpp:34
ServiceEndpoint GetTelegrafEndpoint()
Get the Telegraf Endpoint from the ServiceDiscovery.
Definition serviceDiscovery.cpp:76
std::vector< std::string > ListComponents(const std::string &service_type=ServiceRegistryIf::COMPONENT_TYPE)
Get known components.
Definition serviceDiscovery.cpp:42
ServiceEndpoint GetRuntimeRepoEndpoint()
Get the Runtime Repository Endpoint from the ServiceDiscovery.
Definition serviceDiscovery.cpp:58
static const std::string COMPONENT_TYPE
the string for component type (default)
Definition serviceRegistryIf.hpp:59
elt::mal::Uri ServiceEndpoint
Definition serviceRegistryIf.hpp:42
Provides macros and utilities for exception handling.
Definition commandReplier.cpp:21
Class that implements the service registry interface.