TriggerQueue is behaves exactly like a normal queue (fifo) except that this queue is threadsafe and offers a blocking push which blocks the the caller until the queue has space for at least one element which can be pushed.
More...
#include <trigger_queue.hpp>
|
bool | push (const T &in) noexcept |
| Pushs an element into the trigger queue. If the queue is full it blocks until there is space again. If in the meantime destroy() was called the block is released and push returns false.
|
|
cxx::optional< T > | pop () noexcept |
| If the queue already contains an element it writes the contents of that element in out and returns true, otherwise false. More...
|
|
bool | empty () const noexcept |
| Returns true if the queue is empty, otherwise false.
|
|
uint64_t | size () const noexcept |
| Returns the number of elements which are currently in the queue.
|
|
void | destroy () noexcept |
| when someone is waiting in push since the queue is full it unblocks push. after that call it is impossible to push elements.
|
|
bool | setCapacity (const uint64_t capacity) noexcept |
| resizes the queue. More...
|
|
|
static constexpr uint64_t | capacity () noexcept |
| Returns the capacity of the trigger queue.
|
|
|
static constexpr uint64_t | CAPACITY = Capacity |
|
template<typename T, uint64_t Capacity, template< typename, uint64_t > class QueueType>
class iox::concurrent::TriggerQueue< T, Capacity, QueueType >
TriggerQueue is behaves exactly like a normal queue (fifo) except that this queue is threadsafe and offers a blocking push which blocks the the caller until the queue has space for at least one element which can be pushed.
◆ pop()
template<typename T , uint64_t Capacity, template< typename, uint64_t > class QueueType>
If the queue already contains an element it writes the contents of that element in out and returns true, otherwise false.
- Returns
- if an element could be removed the optional contains it, otherwise when the queue is empty the optional is empty
◆ setCapacity()
template<typename T , uint64_t Capacity, template< typename, uint64_t > class QueueType>
resizes the queue.
- Returns
- true if resize was successful otherwise false
The documentation for this class was generated from the following files:
- iceoryx_utils/internal/concurrent/trigger_queue.hpp
- iceoryx_utils/internal/concurrent/trigger_queue.inl