![]() |
Barst
2.0
A server that controls lab hardware.
|
#include <cpl queue.h>
Public Member Functions | |
CQueue (HANDLE hEvent) | |
void | Push (T pHead) |
T | Front (bool bPop, bool &bValid) |
int | GetSize () |
void | ResetIfEmpty () |
Defines a thread safe queue. Defines a thread safe general FIFO queue. When an object is added to the queue, we only set the event if the queue was empty, if the queue had an element we don't set the event. Also, we never reset the event; it's the users responsibility to reset the event when finished proccesing an element and the queue is empty (or whatever scheme the user wants).
Definition at line 17 of file cpl queue.h.
Creates the queue. You pass in a valid event which is set when the queue is empty and you enque an element.
Definition at line 22 of file cpl queue.h.
|
inline |
Removes or previews an elemnt from the queue. If bPop is true we return and remove the front element from the queue, if false, we only return it but do not remove it from the queue. bValid returns true if the object returned is valid and false otherwise. The returned object can be invalid if the queue was empty.
Definition at line 38 of file cpl queue.h.
|
inline |
Returns the current # of items in queue.
Definition at line 52 of file cpl queue.h.
|
inline |
Adds an element to the back of the queue and sets the event (if the queue was empty).
Definition at line 26 of file cpl queue.h.
|
inline |
Resets queue event safely only if the queue is empty.
Definition at line 59 of file cpl queue.h.