RTC Toolkit  0.1.0-alpha
commandReplier.hpp
Go to the documentation of this file.
1 
9 #ifndef RTCTK_COMPONENTFRAMEWORK_COMMANDREPLIER_HPP
10 #define RTCTK_COMPONENTFRAMEWORK_COMMANDREPLIER_HPP
11 
12 #include "Rtctkif.hpp"
13 #include <mal/utility/Uri.hpp>
14 #include <thread>
15 #include <memory>
16 
17 namespace rtctk::componentFramework {
18 
20  public:
21  CommandReplier(const ::elt::mal::Uri& uri);
22  virtual ~CommandReplier();
23 
24  template<typename T>
25  void RegisterService(const std::string& name, std::shared_ptr<elt::mal::rr::RrEntity>& service) {
26  m_rr_server->registerService<T, false>(name, service);
27  }
28 
29  private:
30  std::unique_ptr<elt::mal::rr::Server> m_rr_server;
31  std::thread m_rr_thread;
32  };
33 }
34 
35 #endif
rtctk::componentFramework
Definition: rtcComponent.hpp:17
rtctk::componentFramework::CommandReplier::~CommandReplier
virtual ~CommandReplier()
Definition: commandReplier.cpp:20
rtctk::componentFramework::CommandReplier::CommandReplier
CommandReplier(const ::elt::mal::Uri &uri)
Definition: commandReplier.cpp:11
rtctk::componentFramework::CommandReplier
Definition: commandReplier.hpp:19
rtctk::componentFramework::CommandReplier::RegisterService
void RegisterService(const std::string &name, std::shared_ptr< elt::mal::rr::RrEntity > &service)
Definition: commandReplier.hpp:25