23 #ifndef __ccxx_BoundedQueue_hxx 24 #define __ccxx_BoundedQueue_hxx 126 {
return(_capacity); }
153 {
return(_terminated); }
158 std::deque<T> _queue;
159 mutable Mutex _mutex;
165 #include <commonc++/BoundedQueueImpl.h++> 169 #endif // __ccxx_BoundedQueue_hxx T tryTake(timespan_ms_t timeout=0)
Take an item from the queue.
BoundedQueue(uint_t capacity)
Construct a new BoundedQueue.
T take()
Take an item from the queue.
void reset()
Reset the queue.
bool isShutdown() const
Test if the queue has been shut down.
Definition: BoundedQueue.h++:152
void put(T item)
Put an item in the queue.
void setCapacity(uint_t capacity)
Change the capacity of the queue.
unsigned int uint_t
An alias for unsigned int.
Definition: Integers.h++:74
void shutdown()
Shut down the queue.
A mutual-exclusion lock.
Definition: Mutex.h++:49
virtual ~BoundedQueue()
Destructor.
void tryPut(T item, timespan_ms_t timeout=0)
Put an item in the queue.
void interrupt()
Interrupt the queue.
uint_t getCapacity() const
Get the capacity of the queue, that is, the maximum number of items that the queue can hold...
Definition: BoundedQueue.h++:125
int timespan_ms_t
A timespan expressed in milliseconds.
Definition: Integers.h++:104
uint_t getSize() const
Get the size of the queue, that is, the number of items currently in the queue.
void clear()
Clear the queue.
Definition: AllocationMap.c++:25
A condition variable – a synchronization mechanism used to coordinate the actions of multiple thread...
Definition: ConditionVar.h++:45
A bounded, threadsafe FIFO processing queue.
Definition: BoundedQueue.h++:44