#include <ThreadMessageQueue.h>
Public Methods | |
ThreadMessageQueue () | |
Create the queue. More... | |
~ThreadMessageQueue () | |
Delete the queue structure, but all objects that are inside the queue are not deleted. More... | |
void | add (T *object) |
Add an object to the queue. More... | |
T * | getNext () |
Get the next object in the queue. More... | |
bool | isEmpty () |
Returns true if the queue is empty. More... | |
int | getLength () |
Return the number of elements in the queue. More... | |
void | print (std::ostream &) |
Print the contents of the Queue to the specified output stream. More... | |
Private Attributes | |
std::list< T *> | m_queue |
Condition | m_ready |
Mutex | m_lock |
If the queue is empty, and you call getNext(), it will block. It is thread safe to add and remove from the queue at the same time.
Definition at line 10 of file ThreadMessageQueue.h.
|
Create the queue.
Definition at line 43 of file ThreadMessageQueue.h. |
|
Delete the queue structure, but all objects that are inside the queue are not deleted.
Definition at line 52 of file ThreadMessageQueue.h. |
|
Add an object to the queue.
Definition at line 63 of file ThreadMessageQueue.h. Referenced by PriorityPacketQueue::add(), VisualizerFrame::addMessage(), SendWindow::initialSegmentation(), ReceiveWindow::reassemble(), SendWindow::reliableSend(), ServiceTable::signalListenComplete(), and ServiceTable::~ServiceTable().
|
|
Return the number of elements in the queue.
Definition at line 105 of file ThreadMessageQueue.h. |
|
Get the next object in the queue. If the queue is empty, it will block until it receives something. Definition at line 76 of file ThreadMessageQueue.h. Referenced by VisualizerFrame::calculateNodes(), PriorityPacketQueue::getNext(), ServiceTable::listenService(), ReceiveWindow::reassemble(), and SendWindow::reliableSend().
|
|
Returns true if the queue is empty.
Definition at line 95 of file ThreadMessageQueue.h. Referenced by VisualizerFrame::calculateNodes(), PriorityPacketQueue::getNext(), PriorityPacketQueue::isEmpty(), ReceiveWindow::reassemble(), and SendWindow::reliableSend().
|
|
Print the contents of the Queue to the specified output stream.
Definition at line 115 of file ThreadMessageQueue.h. Referenced by PriorityPacketQueue::print().
|
|
Definition at line 24 of file ThreadMessageQueue.h. |
|
Definition at line 22 of file ThreadMessageQueue.h. |
|
Definition at line 23 of file ThreadMessageQueue.h. |