#include <framework.h>
Inheritance diagram for AAA_QueueJob< T, LOCK >:
Public Member Functions | |
AAA_QueueJob (AAA_JobData *d=0, char *name=0, unsigned numPriority=1, unsigned maxWeight=1) throw (int) | |
Constructor. | |
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 |
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.
|
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. |
|
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. |
|
Remove all entries that match specified entry. Returns total number of returned entries. |