Extendable class that allows to send commands to components using MAL.
More...
#include <commandRequestor.hpp>
|
template<typename T > |
std::unique_ptr< T > | MakeInterface (std::string const &name) |
| Make a new MAL interface. More...
|
|
void | RegisterCommand (std::string const &id, std::function< elt::mal::future< std::string >(std::string const &)> fun) |
| Register a new command. More...
|
|
Extendable class that allows to send commands to components using MAL.
◆ CommandRequestor()
rtctk::componentFramework::CommandRequestor::CommandRequestor |
( |
const elt::mal::Uri & |
uri, |
|
|
std::optional< std::chrono::milliseconds > |
timeout = std::nullopt |
|
) |
| |
Create a new CommandRequestor object.
- Parameters
-
uri | ip and port of the component |
timeout | timeout for requests in milliseconds |
◆ ~CommandRequestor()
virtual rtctk::componentFramework::CommandRequestor::~CommandRequestor |
( |
| ) |
|
|
virtualdefault |
◆ MakeInterface()
template<typename T >
std::unique_ptr<T> rtctk::componentFramework::CommandRequestor::MakeInterface |
( |
std::string const & |
name | ) |
|
|
inlineprotected |
Make a new MAL interface.
- Template Parameters
-
T | type of the MAL interface |
- Parameters
-
id | identifyer of the MAL interface |
◆ RegisterCommand()
void rtctk::componentFramework::CommandRequestor::RegisterCommand |
( |
std::string const & |
id, |
|
|
std::function< elt::mal::future< std::string >(std::string const &)> |
fun |
|
) |
| |
|
protected |
Register a new command.
- Parameters
-
id | identifyer of the command |
fun | function that executes the command using the async MAL interface |
◆ SendCommandAsync()
elt::mal::future< std::string > rtctk::componentFramework::CommandRequestor::SendCommandAsync |
( |
std::string const & |
id, |
|
|
std::string const & |
args |
|
) |
| |
Send asynchronous command to a component.
- Parameters
-
id | identifyer of the command |
args | command arguments a serialised string |
◆ SendCommandSync()
std::string rtctk::componentFramework::CommandRequestor::SendCommandSync |
( |
std::string const & |
id, |
|
|
std::string const & |
args |
|
) |
| |
Send synchronous command to a component.
- Parameters
-
id | identifyer of the command |
args | command arguments a serialised string |
The documentation for this class was generated from the following files: