Queue
Queue
#include <icy/queue.h>template<typename T>
class QueueDefined in src/base/include/icy/queue.h:30
Subclassed by:
RunnableQueue< IPacket >,RunnableQueue< PacketT >,PlanarAudioPacket >,RunnableQueue< VisionFramePacket >
Thread-safe queue container.
List of all members
| Name | Kind | Owner |
|---|---|---|
push | function | Declared here |
push | function | Declared here |
empty | function | Declared here |
front | function | Declared here |
back | function | Declared here |
pop | function | Declared here |
sort | function | Declared here |
size | function | Declared here |
queue | function | Declared here |
_queue | variable | Declared here |
_mutex | variable | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
void | push inline | Appends an item to the back of the queue (thread-safe). |
void | push inline | Appends an item to the back of the queue by move (thread-safe). |
bool | empty const inline | |
T | front const inline | |
T | back const inline | |
void | pop inline | Removes the front item from the queue (thread-safe). |
void | sort inline | Sorts all queued items using the given comparator (thread-safe). |
size_t | size const inline | |
std::deque< T > | queue const inline |
push
inline
inline void push(const T & data)Defined in src/base/include/icy/queue.h:35
Appends an item to the back of the queue (thread-safe).
Parameters
dataItem to enqueue.
push
inline
inline void push(T && data)Defined in src/base/include/icy/queue.h:43
Appends an item to the back of the queue by move (thread-safe).
Parameters
dataItem to enqueue.
empty
const inline
inline bool empty() constDefined in src/base/include/icy/queue.h:50
Returns
True if the queue contains no items.
front
const inline
inline T front() constDefined in src/base/include/icy/queue.h:57
Returns
Copy of the front item.
back
const inline
inline T back() constDefined in src/base/include/icy/queue.h:64
Returns
Copy of the back item.
pop
inline
inline void pop()Defined in src/base/include/icy/queue.h:71
Removes the front item from the queue (thread-safe).
sort
inline
template<typename Compare> inline void sort()Defined in src/base/include/icy/queue.h:80
Sorts all queued items using the given comparator (thread-safe).
Parameters
CompareComparator type compatible withstd::sort.
size
const inline
inline size_t size() constDefined in src/base/include/icy/queue.h:87
Returns
Number of items currently in the queue (thread-safe).
queue
const inline
inline std::deque< T > queue() constDefined in src/base/include/icy/queue.h:94
Returns
Copy of the underlying deque.
Protected Attributes
_queue
std::deque< T > _queueDefined in src/base/include/icy/queue.h:101
_mutex
std::mutex _mutex