A Queue that supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in the queue when storing an element.
Подробнее...
|
|
| PIBlockingQueue (size_t capacity=SIZE_MAX, PIConditionVariable *cond_var_add=new PIConditionVariable(), PIConditionVariable *cond_var_rem=new PIConditionVariable()) |
| | Constructor.
|
| |
|
| PIBlockingQueue (const PIDeque< T > &other) |
| | Copy constructor. Initialize queue with copy of other queue elements. Not thread-safe for other queue.
|
| |
|
| PIBlockingQueue (PIBlockingQueue< T > &other) |
| | Thread-safe copy constructor. Initialize queue with copy of other queue elements.
|
| |
| PIBlockingQueue< T > & | put (const T &v) |
| | Inserts the specified element into this queue, waiting if necessary for space to become available. Подробнее...
|
| |
| bool | offer (const T &v, PISystemTime timeout={}) |
| | Inserts the specified element at the end of this queue if it is possible to do so immediately without exceeding the queue's capacity, returning true upon success and false if this queue is full. Подробнее...
|
| |
| T | take () |
| | Retrieves and removes the head of this queue, waiting if necessary until an element becomes available. Подробнее...
|
| |
| T | poll (PISystemTime timeout={}, const T &defaultVal=T(), bool *isOk=nullptr) |
| | Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available. Подробнее...
|
| |
| size_t | capacity () |
| | Returns the number of elements that this queue can ideally (in the absence of memory or resource constraints) contains. This is always equal to the initial capacity of this queue less the current size of this queue. Подробнее...
|
| |
| size_t | remainingCapacity () |
| | Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept. This is always equal to the initial capacity of this queue less the current size of this queue. Подробнее...
|
| |
|
size_t | size () |
| | Returns the number of elements in this collection.
|
| |
|
size_t | drainTo (PIDeque< T > &other, size_t maxCount=SIZE_MAX) |
| | Removes all available elements from this queue and adds them to other given queue.
|
| |
|
size_t | drainTo (PIBlockingQueue< T > &other, size_t maxCount=SIZE_MAX) |
| | Removes all available elements from this queue and adds them to other given queue.
|
| |
template<typename T>
class PIBlockingQueue< T >
A Queue that supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in the queue when storing an element.