Public Member Functions | List of all members
BlockingQueue< T > Class Template Referenceabstract

Base interface for blocking queues. More...

#include <BlockingQueue.hpp>

Inheritance diagram for BlockingQueue< T >:
[legend]
Collaboration diagram for BlockingQueue< T >:
[legend]

Public Member Functions

virtual T dequeue ()=0
 Dequeue an object, waiting for an object to become available if the queue is empty. More...
 
virtual bool empty () const =0
 Returns true if the queue is empty. More...
 
virtual void enqueue (T &&element)=0
 Enqueue an object, waiting for space to be available if the queue is full. More...
 
virtual bool full () const =0
 Returns true if the queue is full. More...
 
virtual T tryDequeue ()=0
 Try to dequeue an object. More...
 
virtual T tryDequeue (std::chrono::milliseconds waitTime)=0
 Try to dequeue an object, waiting for the specified time if the queue is empty. More...
 

Detailed Description

template<typename T>
class Balau::Container::BlockingQueue< T >

Base interface for blocking queues.

Member Function Documentation

◆ dequeue()

virtual T dequeue ( )
pure virtual

Dequeue an object, waiting for an object to become available if the queue is empty.

Implements Queue< T >.

Implemented in SharedMemoryQueue< T >, and ArrayBlockingQueue< T >.

◆ empty()

virtual bool empty ( ) const
pure virtual

Returns true if the queue is empty.

Given the concurrent nature of block queues, this operation is approximate.

Implements Queue< T >.

Implemented in SharedMemoryQueue< T >, and ArrayBlockingQueue< T >.

◆ enqueue()

virtual void enqueue ( T &&  element)
pure virtual

Enqueue an object, waiting for space to be available if the queue is full.

The supplied element is moved during enqueuing.

Implements Queue< T >.

Implemented in SharedMemoryQueue< T >, and ArrayBlockingQueue< T >.

◆ full()

virtual bool full ( ) const
pure virtual

Returns true if the queue is full.

Given the concurrent nature of block queues, this operation is approximate.

Implemented in SharedMemoryQueue< T >, and ArrayBlockingQueue< T >.

◆ tryDequeue() [1/2]

virtual T tryDequeue ( )
pure virtual

Try to dequeue an object.

if no dequeue was made, a default constructed object is returned.

Implemented in SharedMemoryQueue< T >, and ArrayBlockingQueue< T >.

◆ tryDequeue() [2/2]

virtual T tryDequeue ( std::chrono::milliseconds  waitTime)
pure virtual

Try to dequeue an object, waiting for the specified time if the queue is empty.

if no dequeue was made, a default constructed object is returned.

Implemented in SharedMemoryQueue< T >, and ArrayBlockingQueue< T >.


The documentation for this class was generated from the following file: