Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

AAA_QueueJob< T, LOCK > Class Template Reference

#include <framework.h>

Inheritance diagram for AAA_QueueJob< T, LOCK >:

AAA_Job List of all members.

Public Member Functions

 AAA_QueueJob (AAA_JobData *d=0, char *name=0, unsigned numPriority=1, unsigned maxWeight=1) throw (int)

virtual ~AAA_QueueJob ()
 Overloaded by derived class's destractors.

virtual int Serve ()=0
 Inherited from the base class.

virtual int Schedule (AAA_Job *, size_t backlogSize=1)=0
 Inherited from the base class.

bool ExistBacklog ()
 Reimplemented from AAA_Job.

size_t BacklogSize ()
 The number of backlog.

int Enqueue (T entry, bool blocking=false, unsigned priority=1, unsigned weight=1)
int Dequeue (T &entry, bool blocking=false) throw (int)
int Remove (T entry)
virtual void Flush ()
 Flush the event queue.

void Signal ()
size_t MaxSize ()
 Returns the maximum size of the queue.

Protected Attributes

LOCK lock
 lock associated with list

Detailed Description

template<class T, class LOCK = ACE_Thread_Mutex>
class AAA_QueueJob< T, LOCK >

queueJob Job with Queue

This class defines a job with a single FIFO queue to store objects of any type. Enqueue, dequeue, remove and flush operations are defined in this class. The LOCK parameter must be either ACE_Thread_Mutex, ACE_Recursive_Thread_Mutex, or ACE_Null_Mutex.

Member Function Documentation

template<class T, class LOCK = ACE_Thread_Mutex>
int AAA_QueueJob< T, LOCK >::Dequeue T &  entry,
bool  blocking = false
throw (int) [inline]

Dequeue an entry. When blocking is false and the queue is empty, Dequeue() immediately return 0 without performing dequeue. When blocking is true, Dequeue() wait until the queue entry is availble. When "signaled" is true, (this is the case when job serving threads need to be deleted), -1 is returned. When an entry is successfuly dequeued, 1 is returned.

template<class T, class LOCK = ACE_Thread_Mutex>
int AAA_QueueJob< T, LOCK >::Enqueue entry,
bool  blocking = false,
unsigned  priority = 1,
unsigned  weight = 1

Enqueue an entry. Returns the total number of entries after the enqueue operation. Enqueue() can be blocking when "blocking" argument is true and the queue is full.

template<class T, class LOCK = ACE_Thread_Mutex>
int AAA_QueueJob< T, LOCK >::Remove entry  )  [inline]

Remove all entries that match specified entry. Returns total number of returned entries.

The documentation for this class was generated from the following file:
Generated on Fri Jun 25 17:35:03 2004 for Framework API for Task Management and Protocol State Machines by doxygen 1.3.5