ariba::utility::SystemQueue Class Reference

#include <source/ariba/utility/system/SystemQueue.h>

Collaboration diagram for ariba::utility::SystemQueue:

Collaboration graph
[legend]

List of all members.

Classes

class  QueueThread
class  QueueThreadDelay
class  QueueThreadDirect

Public Member Functions

void scheduleEvent (const SystemEvent &event, uint32_t delay=0)
void run ()
void cancel ()
bool isEmpty ()
bool isRunning ()

Static Public Member Functions

static SystemQueueinstance ()

Protected Member Functions

void enterMethod ()
void leaveMethod ()
 SystemQueue ()
 ~SystemQueue ()

Private Types

typedef vector< SystemEventEventQueue

Private Member Functions

 use_logging_h (SystemQueue)

Private Attributes

QueueThreadDirect directScheduler
QueueThreadDelay delayScheduler
volatile bool systemQueueRunning

Friends

class EnterMethod


Detailed Description

This class implements a simple system event queue to allow a simulation of cooperative multitasking. It also allows events to be scheduled from other tasks. This allows dispatching asynchronous tasks.

Author:
Christoph Mayer, Sebastian Mies

Definition at line 78 of file SystemQueue.h.


Member Typedef Documentation

Definition at line 170 of file SystemQueue.h.


Constructor & Destructor Documentation

ariba::utility::SystemQueue::SystemQueue (  )  [protected]

Constructs a system queue.

Definition at line 45 of file SystemQueue.cpp.

ariba::utility::SystemQueue::~SystemQueue (  )  [protected]

Destroys the system queue. Beware that all events are canceled

Definition at line 52 of file SystemQueue.cpp.


Member Function Documentation

void ariba::utility::SystemQueue::cancel (  ) 

Cancels the system queue and ends the processing after the currently processed event is processed.

This method is thread-safe.

Definition at line 89 of file SystemQueue.cpp.

References ariba::utility::SystemQueue::SystemQueue::QueueThread::cancel(), delayScheduler, directScheduler, and systemQueueRunning.

Referenced by ariba::utility::StartupWrapper::stopSystem().

void ariba::utility::SystemQueue::enterMethod (  )  [protected]

static SystemQueue& ariba::utility::SystemQueue::instance (  )  [inline, static]

bool ariba::utility::SystemQueue::isEmpty (  ) 

Check wheter this queue has items or not.

Returns:
True, if this queue is empty.

Definition at line 97 of file SystemQueue.cpp.

References delayScheduler, directScheduler, and ariba::utility::SystemQueue::SystemQueue::QueueThread::isEmpty().

bool ariba::utility::SystemQueue::isRunning (  ) 

Is the system queue already started and running?

Returns:
True, if the system queue is running.

Definition at line 105 of file SystemQueue.cpp.

References systemQueueRunning.

void ariba::utility::SystemQueue::leaveMethod (  )  [protected]

void ariba::utility::SystemQueue::run (  ) 

Starts the processing and waiting for events. Use cancel() to end system queue processing and isEmpty() to check wheter the queue is empty.

Definition at line 81 of file SystemQueue.cpp.

References delayScheduler, directScheduler, ariba::utility::SystemQueue::SystemQueue::QueueThread::run(), and systemQueueRunning.

Referenced by ariba::utility::StartupWrapper::startSystem().

void ariba::utility::SystemQueue::scheduleEvent ( const SystemEvent event,
uint32_t  delay = 0 
)

ariba::utility::SystemQueue::use_logging_h ( SystemQueue   )  [private]


Friends And Related Function Documentation

friend class EnterMethod [friend]

Definition at line 84 of file SystemQueue.h.


Member Data Documentation

Definition at line 228 of file SystemQueue.h.

Referenced by cancel(), isEmpty(), run(), and scheduleEvent().

Definition at line 227 of file SystemQueue.h.

Referenced by cancel(), enterMethod(), isEmpty(), leaveMethod(), run(), and scheduleEvent().

Definition at line 229 of file SystemQueue.h.

Referenced by cancel(), isRunning(), and run().


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

Generated on Fri Aug 14 23:39:39 2009 for Ariba by  doxygen 1.5.8