|
moddef-cpp
Idiomatic C++ runtime for ModDef
|
One armed command run. More...
#include <command.hpp>
Public Member Functions | |
| CommandStatus | tick (std::uint32_t now_ms) noexcept |
Advance the run; now_ms is any monotonic millisecond clock. | |
| Error | error () const noexcept |
| The failure cause after CommandStatus::Error (Error::Ok otherwise). | |
| Result< Value > | result (std::string_view field) const |
| Numeric result by CommandResult.field, after Done. | |
| Result< std::span< const std::uint8_t > > | result_data (std::string_view field) const |
| String/bytes result: a view into the caller's data sink. | |
| CommandExecutor (CommandExecutor &&) noexcept=default | |
| CommandExecutor & | operator= (CommandExecutor &&) noexcept=default |
| CommandExecutor (const CommandExecutor &)=delete | |
| CommandExecutor & | operator= (const CommandExecutor &)=delete |
Static Public Member Functions | |
| static Result< CommandExecutor > | begin (Device &dev, std::string_view command_id, const md_cmd_params_t *params, std::span< std::uint8_t > sink={}) |
Locate command_id in the device profile, validate required params, and arm the run. | |
One armed command run.
Movable; non-copyable. The Device, param storage, and data sink must outlive the executor.
|
defaultnoexcept |
|
delete |
|
inlinestatic |
Locate command_id in the device profile, validate required params, and arm the run.
sink receives string/bytes read-step payloads (pass an empty span when the command reads none).
|
inlinenoexcept |
Advance the run; now_ms is any monotonic millisecond clock.
|
inlinenoexcept |
The failure cause after CommandStatus::Error (Error::Ok otherwise).
Numeric result by CommandResult.field, after Done.
|
inline |
String/bytes result: a view into the caller's data sink.
|
defaultnoexcept |
|
delete |