solarpowerlog trunk
CAsyncCommand Class Reference

#include <CAsyncCommand.h>

Collaboration diagram for CAsyncCommand:

List of all members.

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
ICommandcallback

Detailed Description

Definition at line 14 of file CAsyncCommand.h.


Member Enumeration Documentation

Enumerator:
DISCONNECT 
CONNECT 

Tear down a connection.

SEND 

Connect.

RECEIVE 

Send data.

Definition at line 17 of file CAsyncCommand.h.


Constructor & Destructor Documentation

CAsyncCommand::CAsyncCommand ( enum Commando  c,
ICommand callback,
sem_t *  sem = NULL 
)

Constructor which create the object

Parameters:
cCommando to be used
callbackICommand used as callback. Might be NULL. In this case the semaphore mechanism is used.
semSemaphore. 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.


Member Function Documentation

void CAsyncCommand::HandleCompletion ( void  )

Handle this jobs completion by notifying the sender

Definition at line 40 of file CAsyncCommand.cpp.

Here is the call graph for this function:

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.


Member Data Documentation

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.


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