Class Command
Abstract base class for commands in the command pattern. More...
#include <command.h>
Inherited by the following classes: AutoCommand, AutoCommand, AutoCommand, AutoCommand, AutoCommand, FireControl, SetStanceCommand, SetStrategyCommand, TargetSelection
Public Attributes
| Type | Name |
|---|---|
| uint64_t | id = 0Unique identifier for the command, typically based on a timestamp. |
| uint64_t | run_after = 0The time at which the command should be executed. |
Public Functions
| Type | Name |
|---|---|
| Command (uint64_t initial_run_after=0) Constructs a new Command object. |
|
| virtual void | Execute (SystemState * state) = 0 |
| virtual constexpr const std::string_view | Type () const = 0 |
| virtual | ~Command () = default |
Detailed Description
This class defines an interface for executing operations. Each command is a standalone object that encapsulates a request.
Public Attributes Documentation
variable id
Unique identifier for the command, typically based on a timestamp.
uint64_t Command::id;
variable run_after
The time at which the command should be executed.
uint64_t Command::run_after;
Public Functions Documentation
function Command
Constructs a new Command object.
Command::Command (
uint64_t initial_run_after=0
)
Initializes the command with a unique ID based on the current time and calculates the absolute time at which it should be executed.
Parameters:
initial_run_afterThe time delay (in microseconds) after which the command should be executed.
function Execute
virtual void Command::Execute (
SystemState * state
) = 0
function Type
virtual constexpr const std::string_view Command::Type () const = 0
function ~Command
virtual Command::~Command () = default
The documentation for this class was generated from the following file command.h