RTC Toolkit 4.0.1
Loading...
Searching...
No Matches
commandReplier.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_COMMANDREPLIER_HPP
14#define RTCTK_COMPONENTFRAMEWORK_COMMANDREPLIER_HPP
15
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(std::string const& 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
45private:
46 std::unique_ptr<elt::mal::rr::Server> m_rr_server;
47 std::thread m_rr_thread;
48};
49} // namespace rtctk::componentFramework
50
51#endif
Class that handles reception of commands using MAL.
Definition: commandReplier.hpp:29
std::vector< std::pair< std::string, std::string > > GetServiceDescriptions(const std::string &service_name=std::string())
Definition: commandReplier.hpp:41
void RegisterService(std::string const &name, std::shared_ptr< elt::mal::rr::RrEntity > &service)
Definition: commandReplier.hpp:36
virtual ~CommandReplier()
Definition: commandReplier.cpp:35
Definition: commandReplier.cpp:22