Purpose:
Implements a thread safe queue of pointers to CObject elements.
Support blocking and non-blocking access to queue.
Methods:
BOOL Enqueue (CObject* pNewElement) - Insert new object into the queue.
BOOL Enqueue (CObject* pNewElement, DWORD dwKey) - Insert new object to sorted Q
BOOL Dequeue(CObject*&) - Remove an object out of the queue
int GetQueueSize() - Return the size of the queue (number of elements)
CSemaphore& ExposeSemaphore() - Expose the queue's semaphore for blocking mode.
void Empty() - Empties the queue (also deletes objects pointed to by elements in the queue).