Wyatt
1.0.1
|
#include <CommandManager.h>
Public Member Functions | |
CommandManager () | |
~CommandManager () | |
bool | runCommand (Command *command) |
bool | cancel (Command *command) |
bool | cancelAll () |
void * | run () |
int | join () |
int | kill () |
unsigned long | inFlight () |
Public Member Functions inherited from Thread | |
int | start () |
int | join () |
int | detach () |
void | signal (int signal) |
pthread_t | self () |
Additional Inherited Members | |
Protected Attributes inherited from Thread | |
std::atomic< int > | m_signal |
Class to manange the various system commands. Commands injected into the CommandManager are run periodically until the command is done. Once the command is done, the command manager cleans up the command and removes it from the run queue.
Definition at line 17 of file CommandManager.h.
CommandManager::CommandManager | ( | ) |
Creates the command manager object.
Definition at line 7 of file CommandManager.cpp.
CommandManager::~CommandManager | ( | ) |
Destroys the command manager object.
Definition at line 13 of file CommandManager.cpp.
bool CommandManager::cancel | ( | Command * | command | ) |
Cancel a command. Pass in the pointer to the command you want canceled, and it will be canceled and un-scheduled.
command | A pointer to a command object. |
Definition at line 27 of file CommandManager.cpp.
bool CommandManager::cancelAll | ( | ) |
Cancel all running commands.
Definition at line 35 of file CommandManager.cpp.
unsigned long CommandManager::inFlight | ( | ) |
Get how many commands are in flight in the command manager.
Definition at line 85 of file CommandManager.cpp.
int CommandManager::join | ( | ) |
Re-join the thread and end command execution.
Definition at line 73 of file CommandManager.cpp.
int CommandManager::kill | ( | ) |
Re-join the thread and end command execution.
Definition at line 80 of file CommandManager.cpp.
|
virtual |
Threading run function
Implements Thread.
Definition at line 45 of file CommandManager.cpp.
bool CommandManager::runCommand | ( | Command * | command | ) |
Add a command to be run. Create your command, and then pass a pointer to it in to this method. It will be run along with all other scheduled commands.
command | A pointer to a command object. |
Definition at line 18 of file CommandManager.cpp.