RTC Toolkit 4.0.1
Loading...
Searching...
No Matches
serviceRegistryIf.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_SERVICEREGISTRYIF_HPP
14#define RTCTK_COMPONENTFRAMEWORK_SERVICEREGISTRYIF_HPP
15
16#include <memory>
17#include <string>
18
19#include <mal/Cii.hpp>
20
22
24
32public:
41 using AdapterIdType = elt::mal::Uri;
42
43 using ServiceEndpoint = elt::mal::Uri;
44
49 static const std::string REQ_REP_ENDPOINT;
50
54 static const std::string PUB_SUB_ENDPOINT;
55
57 public:
58 explicit InvalidComponent(const std::string& component, const std::string& service);
59 explicit InvalidComponent(const std::string& component,
60 const std::string& service,
61 const std::string& reason);
62 };
64 public:
65 explicit InvalidService(const std::string& service);
66 explicit InvalidService(const std::string& service, const std::string& reason);
67 };
69 public:
70 explicit ConsulUnavailable(const std::string& message, const std::string& service);
71 };
75 virtual ~ServiceRegistryIf() = default;
76
84 virtual std::vector<std::string> ListComponents() = 0;
85
98
111 virtual ServiceEndpoint Get(const std::string& comp_name,
112 const std::string& service_name,
113 const bool health_check = true) = 0;
114
135 static std::unique_ptr<ServiceRegistryIf> CreateAdapter(const elt::mal::Uri& uri);
136};
137
138} // namespace rtctk::componentFramework
139
140#endif // RTCTK_COMPONENTFRAMEWORK_SERVICEREGISTRYIF_HPP
The RtctkException class is the base class for all Rtctk exceptions.
Definition: exceptions.hpp:237
Class that implements a service registry to be used by the service discovery.
Definition: serviceRegistryIf.hpp:31
virtual ServiceEndpoint GetOldbEndpoint()=0
Get the Oldb Endpoint from the service registry.
static const std::string REQ_REP_ENDPOINT
the string used to identify the Request/Reply endpoint of a service when using the Get function.
Definition: serviceRegistryIf.hpp:49
elt::mal::Uri AdapterIdType
The type used to distinguish between different adapters implementing ServiceRegistryIf.
Definition: serviceRegistryIf.hpp:41
virtual ServiceEndpoint GetRuntimeRepoEndpoint()=0
Get the Runtime Repository Endpoint from the service registry.
virtual std::vector< std::string > ListComponents()=0
Get known components.
static const std::string PUB_SUB_ENDPOINT
the string used to identify the PubSub endpoint of a service when using the Get function.
Definition: serviceRegistryIf.hpp:54
virtual ~ServiceRegistryIf()=default
virtual destructor
virtual ServiceEndpoint Get(const std::string &comp_name, const std::string &service_name, const bool health_check=true)=0
Get endpoint of specific service of a specific component.
virtual ServiceEndpoint GetPersistentRepoEndpoint()=0
Get the Persistent Repository Endpoint from the service registry.
elt::mal::Uri ServiceEndpoint
Definition: serviceRegistryIf.hpp:43
static std::unique_ptr< ServiceRegistryIf > CreateAdapter(const elt::mal::Uri &uri)
Factory method used to create the appropriate service registry adapter depending on the URI scheme.
Definition: serviceRegistryIf.cpp:63
Provides macros and utilities for exception handling.
Definition: commandReplier.cpp:22