Wyatt  1.0.1
Public Member Functions | List of all members
CommandManager Class Reference

#include <CommandManager.h>

Inheritance diagram for CommandManager:
Inheritance graph
[legend]
Collaboration diagram for CommandManager:
Collaboration graph
[legend]

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
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

Parameters
commandA pointer to a command object.
Returns
true if successful.

Definition at line 27 of file CommandManager.cpp.

bool CommandManager::cancelAll ( )

Cancel all running commands.

Returns
true if successful.

Definition at line 35 of file CommandManager.cpp.

unsigned long CommandManager::inFlight ( )

Get how many commands are in flight in the command manager.

Returns
a long, the number of commands.

Definition at line 85 of file CommandManager.cpp.

int CommandManager::join ( )

Re-join the thread and end command execution.

Returns
result of join

Definition at line 73 of file CommandManager.cpp.

int CommandManager::kill ( )

Re-join the thread and end command execution.

Returns
result of join

Definition at line 80 of file CommandManager.cpp.

void * CommandManager::run ( )
virtual

Threading run function

Returns
nil

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.

Parameters
commandA pointer to a command object.
Returns
true if successful.

Definition at line 18 of file CommandManager.cpp.


The documentation for this class was generated from the following files: