|
solarpowerlog trunk
|
#include <CAsyncCommand.h>

Public Types | |
| enum | Commando { DISCONNECT, CONNECT, SEND, RECEIVE } |
Public Member Functions | |
| CAsyncCommand (enum Commando c, ICommand *callback, sem_t *sem=NULL) | |
| ~CAsyncCommand () | |
| void | SetSemaphore (sem_t *sem) |
| void | HandleCompletion (void) |
| bool | IsAsynchronous () |
Public Attributes | |
| enum Commando | c |
| what to do | |
| ICommand * | callback |
Definition at line 14 of file CAsyncCommand.h.
Definition at line 17 of file CAsyncCommand.h.
Constructor which create the object
| c | Commando to be used |
| callback | ICommand used as callback. Might be NULL. In this case the semaphore mechanism is used. |
| sem | Semaphore. If callback is NULL, for the completion handling this semaphore is used. The caller just waits for the semaphore (sem_wait) and the program will wait for the completion of the async command. |
Definition at line 17 of file CAsyncCommand.cpp.
| CAsyncCommand::~CAsyncCommand | ( | ) |
Destructor
Definition at line 31 of file CAsyncCommand.cpp.
| void CAsyncCommand::HandleCompletion | ( | void | ) |
Handle this jobs completion by notifying the sender
Definition at line 40 of file CAsyncCommand.cpp.

| bool CAsyncCommand::IsAsynchronous | ( | ) | [inline] |
Is the asyncCommnd really async, or was it only pretended?
As syncronous operations are also dispatched asynchronous, but we need a ICommand-object for this, we need the information if it is sync or not to decide when to delete the object.
Definition at line 59 of file CAsyncCommand.h.
| void CAsyncCommand::SetSemaphore | ( | sem_t * | sem | ) | [inline] |
Setter for "late setting" the to-be used semaphore.
Definition at line 42 of file CAsyncCommand.h.
| enum Commando CAsyncCommand::c |
what to do
Definition at line 64 of file CAsyncCommand.h.
callback for completion handling In this ICommand, the comand data is stored, results and data... This ICommand is privately created, if private_icommand is true, and will not be executed if so, but can be still be used for storage
Definition at line 71 of file CAsyncCommand.h.