|
| | Queue () |
| | Constructs and initialises the queue.
|
| |
|
| ~Queue () |
| | Destroys the queue, releasing the underlying kernel resource.
|
| |
|
| Queue (const Queue &)=delete |
| |
|
Queue & | operator= (const Queue &)=delete |
| |
| | Queue (Queue &&other) noexcept |
| | Move constructor — transfers ownership of the kernel handle.
|
| |
| Queue & | operator= (Queue &&other) noexcept |
| | Move-assignment operator — transfers ownership of the kernel handle.
|
| |
| int | send (const T &item, uint32_t timeout_ms=OVE_WAIT_FOREVER) |
| | Sends an item to the back of the queue from task context.
|
| |
| int | receive (T *item, uint32_t timeout_ms=OVE_WAIT_FOREVER) |
| | Receives an item from the front of the queue from task context.
|
| |
| int | send_from_isr (const T &item) |
| | Sends an item to the queue from an ISR context (non-blocking).
|
| |
| int | receive_from_isr (T *item) |
| | Receives an item from the queue from an ISR context (non-blocking).
|
| |
| bool | valid () const |
| | Returns true if the underlying kernel handle is non-null.
|
| |
| ove_queue_t | handle () const |
| | Returns the raw oveRTOS queue handle.
|
| |
template<typename T, size_t MaxItems = 0>
class ove::Queue< T, MaxItems >
RAII wrapper around an oveRTOS typed message queue.
Queue<T, MaxItems> stores items of type T in a FIFO buffer. Items are copied into the queue on send() and out of it on receive(), so T must be trivially copyable (or at least safe to copy via memcpy).
In zero-heap mode MaxItems must be greater than zero; the backing buffer is allocated inside the wrapper. On heap-enabled builds MaxItems is also required at compile time (it is passed to the kernel at construction).
- Template Parameters
-
| T | Type of message items; should be trivially copyable. |
| MaxItems | Compile-time capacity of the queue (must be > 0). |
- Note
- Not copyable. Move-only when heap allocation is enabled.
-
send(), receive(), and their ISR variants are marked [[nodiscard]].