RTC Toolkit 6.0.0-pre2
Loading...
Searching...
No Matches
serviceDiscovery.hpp
Go to the documentation of this file.
1
12
13#ifndef RTCTK_COMPONENTFRAMEWORK_SERVICEDISCOVERY_HPP
14#define RTCTK_COMPONENTFRAMEWORK_SERVICEDISCOVERY_HPP
15
16#include <memory>
17#include <string>
18#include <vector>
19
20#include <mal/Cii.hpp>
21
24
26
34public:
36
43 explicit ServiceDiscovery(std::unique_ptr<ServiceRegistryIf>&& adapter,
44 const std::string& comp_name = "");
45
53 explicit ServiceDiscovery(const elt::mal::Uri& registry, const std::string& comp_name = "");
54
65 std::vector<std::string>
66 ListComponents(const std::string& service_type = ServiceRegistryIf::COMPONENT_TYPE);
67
94 GetReqRepEndpoint(const std::string& name = "",
95 const std::string& service_type = ServiceRegistryIf::COMPONENT_TYPE,
96 const bool health_check = true);
107 GetPubSubEndpoint(const std::string& component_name = "",
108 const std::string& service_type = ServiceRegistryIf::COMPONENT_TYPE,
109 const bool health_check = true);
110
111private:
115 std::unique_ptr<ServiceRegistryIf> m_adapter;
119 const std::string m_component_name;
120};
121
122} // namespace rtctk::componentFramework
123
124#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:86
ServiceEndpoint GetPersistentRepoEndpoint()
Get the Persistent Repository Endpoint from the ServiceDiscovery.
Definition serviceDiscovery.cpp:68
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:104
ServiceDiscovery(std::unique_ptr< ServiceRegistryIf > &&adapter, const std::string &comp_name="")
Create a new ServiceDiscovery object.
Definition serviceDiscovery.cpp:21
ServiceEndpoint GetOldbEndpoint()
Get the Oldb Endpoint from the ServiceDiscovery.
Definition serviceDiscovery.cpp:51
ServiceRegistryIf::ServiceEndpoint ServiceEndpoint
Definition serviceDiscovery.hpp:35
ServiceEndpoint GetTelegrafEndpoint()
Get the Telegraf Endpoint from the ServiceDiscovery.
Definition serviceDiscovery.cpp:77
std::vector< std::string > ListComponents(const std::string &service_type=ServiceRegistryIf::COMPONENT_TYPE)
Get known components.
Definition serviceDiscovery.cpp:43
ServiceEndpoint GetRuntimeRepoEndpoint()
Get the Runtime Repository Endpoint from the ServiceDiscovery.
Definition serviceDiscovery.cpp:59
static const std::string COMPONENT_TYPE
the string for component type (default)
Definition serviceRegistryIf.hpp:60
elt::mal::Uri ServiceEndpoint
Definition serviceRegistryIf.hpp:43
Provides macros and utilities for exception handling.
Definition commandReplier.cpp:22
Class that implements the service registry interface.