RTC Toolkit 4.0.1
Loading...
Searching...
No Matches
measCmdsImpl.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_MEASCMDSIMPL_HPP
14#define RTCTK_COMPONENTFRAMEWORK_MEASCMDSIMPL_HPP
15
16#include <Rtctkif.hpp>
18#include <rtctk/componentFramework/events.rad.hpp>
22
23#include <mal/Cii.hpp>
24
25#include <memory>
26#include <string>
27
29
35class MeasCmdsImpl : public rtctkif::AsyncMeasCmds {
36public:
37 static void Register(CommandReplier& replier, StateMachineEngine& engine) {
38 std::shared_ptr<elt::mal::rr::RrEntity> rr_service = std::make_shared<MeasCmdsImpl>(engine);
39 replier.RegisterService<rtctkif::AsyncMeasCmds>("MeasCmds", rr_service);
40 }
41
43 : m_logger(GetLogger("rtctk")), m_engine(engine) {
44 }
45
46 ::elt::mal::future<std::string> Measure(std::string const& args) override {
47 LOG4CPLUS_TRACE(m_logger, "Received command 'Measure' with payload '" + args + "'");
48 return InjectReqRepEvent<events::Measure>(this->m_engine, args);
49 }
50
51private:
52 log4cplus::Logger& m_logger;
53 StateMachineEngine& m_engine;
54};
55
56} // namespace rtctk::componentFramework
57
58#endif
Class that handles reception of commands using MAL.
Definition: commandReplier.hpp:29
void RegisterService(std::string const &name, std::shared_ptr< elt::mal::rr::RrEntity > &service)
Definition: commandReplier.hpp:36
Class that handles reception of command Measure using MAL.
Definition: measCmdsImpl.hpp:35
static void Register(CommandReplier &replier, StateMachineEngine &engine)
Definition: measCmdsImpl.hpp:37
::elt::mal::future< std::string > Measure(std::string const &args) override
Definition: measCmdsImpl.hpp:46
MeasCmdsImpl(StateMachineEngine &engine)
Definition: measCmdsImpl.hpp:42
Definition: stateMachineEngine.hpp:35
Receive commands via MAL.
log4cplus::Logger & GetLogger(const std::string &name="app")
Get handle to a specific logger.
Definition: logger.cpp:180
Logging Support Library based on log4cplus.
Provides core functionality of an RTC Component.
Definition: commandReplier.cpp:22
Wrapper around the SCXML State Machine Engine.