RTC Toolkit  1.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 
18 #include <mal/Cii.hpp>
19 
21 
22 namespace rtctk::componentFramework {
23 
24 class FileRepository;
25 
30 public:
39 
46  explicit ServiceDiscovery(const elt::mal::Uri& endpoint, const std::string& comp_name = "");
48 
59  elt::mal::Uri Get(const std::string& service_name);
60 
71  elt::mal::Uri Get(const std::string& service_name, const std::string& comp_name);
72 
73 private:
74  DataPointPath CalcDatapointUri(const std::string& comp_name, const std::string& service_name);
75 
76  const std::string& m_component_name;
77  std::unique_ptr<FileRepository> m_service_registry;
78 };
79 
80 } // namespace rtctk::componentFramework
81 
82 #endif
rtctk::componentFramework::ServiceDiscovery::ServiceDiscovery
ServiceDiscovery(const elt::mal::Uri &endpoint, const std::string &comp_name="")
Create a new ServiceDiscovery object.
Definition: serviceDiscovery.cpp:32
rtctk::componentFramework::ServiceDiscovery::Get
elt::mal::Uri Get(const std::string &service_name, const std::string &comp_name)
Get endpoint of specific service.
rtctk::componentFramework
Definition: commandReplier.cpp:20
rtctk::componentFramework::ServiceDiscovery::RUNTIME_REPO_ENDPOINT
static const DataPointPath RUNTIME_REPO_ENDPOINT
Definition: serviceDiscovery.hpp:36
rtctk::componentFramework::ServiceDiscovery::PERSIST_REPO_ENDPOINT
static const DataPointPath PERSIST_REPO_ENDPOINT
Definition: serviceDiscovery.hpp:37
rtctk::componentFramework::ServiceDiscovery
Class that implements a very basic service discovery mechanism.
Definition: serviceDiscovery.hpp:29
rtctk::componentFramework::ServiceDiscovery::~ServiceDiscovery
~ServiceDiscovery()
rtctk::componentFramework::ServiceDiscovery::REQ_REP_ENDPOINT
static const DataPointPath REQ_REP_ENDPOINT
There is a fixed set of supported service types.
Definition: serviceDiscovery.hpp:34
rtctk::componentFramework::ServiceDiscovery::Get
elt::mal::Uri Get(const std::string &service_name)
Get endpoint of specific service.
dataPointPath.hpp
Header file for RepositoryIf and related base classes.
rtctk::componentFramework::DataPointPath
This class provides a wraper for DataPoint paths which ensures that they only contain valid character...
Definition: dataPointPath.hpp:34
rtctk::componentFramework::ServiceDiscovery::PUB_SUB_ENDPOINT
static const DataPointPath PUB_SUB_ENDPOINT
Definition: serviceDiscovery.hpp:35
rtctk::componentFramework::ServiceDiscovery::OLDB_ENDPOINT
static const DataPointPath OLDB_ENDPOINT
Definition: serviceDiscovery.hpp:38