RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
commandReplier.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_COMPONENTFRAMEWORK_COMMANDREPLIER_HPP
13#define RTCTK_COMPONENTFRAMEWORK_COMMANDREPLIER_HPP
14
15#include <mal/Mal.hpp>
16#include <mal/rr/RrEntity.hpp>
17#include <mal/rr/Server.hpp>
18#include <mal/utility/Uri.hpp>
19#include <memory>
20#include <thread>
21
23
30public:
31 explicit CommandReplier(const ::elt::mal::Uri& uri);
32 virtual ~CommandReplier();
33
34 template <typename T>
35 void
36 RegisterService(const std::string& name, std::shared_ptr<elt::mal::rr::RrEntity>& service) {
37 m_rr_server->registerService<T, false>(name, service);
38 }
39
40 std::vector<std::pair<std::string, std::string>>
41 GetServiceDescriptions(const std::string& service_name = std::string()) {
42 return m_rr_server->getServiceDescriptions(service_name);
43 }
44
45 std::shared_ptr<elt::mal::Mal> GetMal() {
46 return m_mal;
47 }
48
49private:
50 std::shared_ptr<elt::mal::Mal> m_mal;
51 std::unique_ptr<elt::mal::rr::Server> m_rr_server;
52 std::thread m_rr_thread;
53};
54} // namespace rtctk::componentFramework
55
56#endif
void RegisterService(const std::string &name, std::shared_ptr< elt::mal::rr::RrEntity > &service)
Definition commandReplier.hpp:36
std::vector< std::pair< std::string, std::string > > GetServiceDescriptions(const std::string &service_name=std::string())
Definition commandReplier.hpp:41
CommandReplier(const ::elt::mal::Uri &uri)
Definition commandReplier.cpp:22
std::shared_ptr< elt::mal::Mal > GetMal()
Definition commandReplier.hpp:45
virtual ~CommandReplier()
Definition commandReplier.cpp:36
Definition commandReplier.cpp:21