|void||push (Data *data)|
|Pushes data into the end of the queue. |
|Data *||pop ()|
|Pops the next element off the front of the queue. |
|Data *||wait_pop (int timeout=-1)|
|Pops the next element off the front of the queue, and waits until one exists if empty. |
|void||append_from (DataQueue &other)|
|Pops all data from other and appends it to this. |
|bool||empty () const|
|Returns true if the queue is empty. |
|size_t||size () const|
|Returns number of items in the queue. |
It uses similar member names as std::queue<>, for consistency.
|void Barry::DataQueue::append_from||(||DataQueue &||other||)|
Pops all data from other and appends it to this.
After calling this function, other will be empty, and this will contain all its data.
In the case of an exception, any uncopied data will remain in other.
This is a locking optimization, so all copying can happen inside one lock, instead of locking for each copy.
Referenced by Barry::SocketRoutingQueue::UnregisterInterest().
|Data * Barry::DataQueue::pop||(||)|
|void Barry::DataQueue::push||(||Data *||data||)|
Pushes data into the end of the queue.
The queue owns this pointer as soon as the function is called. In the case of an exception, it will be freed. Performs a thread broadcast once new data has been added.
|Data * Barry::DataQueue::wait_pop||(||int|| timeout =
Pops the next element off the front of the queue, and waits until one exists if empty.
If still no data on timeout, returns null. (unlock the access mutex while waiting!)
Timeout specified in milliseconds. Default is wait forever.