13#ifndef RTCTK_COMPONENTFRAMEWORK_COMMANDREQUESTOR_HPP
14#define RTCTK_COMPONENTFRAMEWORK_COMMANDREQUESTOR_HPP
16#include <Introspectionif.hpp>
21#include <mal/utility/Uri.hpp>
43 std::optional<std::chrono::milliseconds>
timeout = std::nullopt);
71 return m_factory.getClient<T>(elt::mal::Uri(m_uri + name), m_qos, m_props);
81 std::function<elt::mal::future<std::string>(
const std::string&)>
fun);
85 elt::mal::Mal::Properties m_props;
86 elt::mal::CiiFactory& m_factory;
87 std::vector<std::shared_ptr<elt::mal::rr::qos::QoS>> m_qos;
90 std::map<std::string, std::function<elt::mal::future<std::string>(
const std::string&)>> m_cmds;
92 std::unique_ptr<introspectionif::IntrospectionAsync> insif;
93 std::unique_ptr<stdif::StdCmdsAsync>
stdif;
94 std::unique_ptr<rtctkif::RecoverCmdsAsync> rcif;
95 std::unique_ptr<rtctkif::AlertCmdsAsync> acif;
96 std::unique_ptr<rtctkif::UpdateCmdsAsync> ucif;
97 std::unique_ptr<rtctkif::FuncCmdsAsync> fcif;
98 std::unique_ptr<rtctkif::MeasCmdsAsync> mcif;
99 std::unique_ptr<rtctkif::OptCmdsAsync> ocif;
100 std::unique_ptr<rtctkif::LoopCmdsAsync> lcif;
101 std::unique_ptr<rtctkif::SuspCmdsAsync> lsif;
102 std::unique_ptr<rtctkif::ModeCmdsAsync> smif;
103 std::unique_ptr<rtctkif::WriteBackCmdsAsync> wbif;
Extendable class that allows to send commands to components using MAL.
Definition commandRequestor.hpp:34
std::string SendCommandSync(const std::string &id, const std::string &args)
Send synchronous command to a component.
Definition commandRequestor.cpp:96
void RegisterCommand(const std::string &id, std::function< elt::mal::future< std::string >(const std::string &)> fun)
Register a new command.
Definition commandRequestor.cpp:88
CommandRequestor(const elt::mal::Uri &uri, std::optional< std::chrono::milliseconds > timeout=std::nullopt)
Create a new CommandRequestor object.
Definition commandRequestor.cpp:24
elt::mal::future< std::string > SendCommandAsync(const std::string &id, const std::string &args)
Send asynchronous command to a component.
Definition commandRequestor.cpp:112
std::unique_ptr< T > MakeInterface(const std::string &name)
Make a new MAL interface.
Definition commandRequestor.hpp:70
virtual ~CommandRequestor()=default
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Definition statePublisher.hpp:25