#include <CommandProcessor.h>
Inherits ARSTD::ICommandHandler.
Public Member Functions | |
void | execute (std::shared_ptr< Command > pCommand) |
virtual void | repeat () |
virtual bool | push () |
virtual bool | pop () |
virtual void | cleanupHistory () |
void | cleanup () |
void | skipCurrent () |
bool | isBusy () |
double | getCurrentCommandProgress () const |
std::string | getCurrentCommandName () const |
unsigned int | getNumWaitingCommands () const |
This class encapsulates the management of commands. If commands are executed by the commandprocessor, they will be stored and executed one after another till all done.
void ARSTD::CommandProcessor::cleanup | ( | ) |
Removes all (executed and waiting) stored commands from the queue.
|
virtual |
Removes only executed commands that are stored.
void ARSTD::CommandProcessor::execute | ( | std::shared_ptr< Command > | pCommand | ) |
Execute the given command. If other commands are currently executed this command will be stored and executed next.
pCommand | The command that will be added to the execution queue. |
std::string ARSTD::CommandProcessor::getCurrentCommandName | ( | ) | const |
Returns the name of the currently executing command.
double ARSTD::CommandProcessor::getCurrentCommandProgress | ( | ) | const |
Returns the progress of the currently executing command.
unsigned int ARSTD::CommandProcessor::getNumWaitingCommands | ( | ) | const |
Returns the number of commands that currently waits of its execution.
bool ARSTD::CommandProcessor::isBusy | ( | ) |
Returns true if the processor is currently executing a command otherwise false.
|
virtual |
Restores the topmost context from a stack and makes it current.
|
virtual |
Copies the current context to a stack.
|
virtual |
Repeates all commands that were previously executed.
void ARSTD::CommandProcessor::skipCurrent | ( | ) |
Removes the currently executing command and do the next (if available).