|
Firmware
|
Generic queue based on the linked list class defined in libuavcan. More...
#include <uavcan_virtual_can_driver.hpp>
Public Member Functions | |
| Queue (uavcan::IPoolAllocator &arg_allocator, std::size_t block_allocation_quota) | |
| bool | isEmpty () const |
| template<typename... Args> | |
| bool | tryEmplace (Args... args) |
| Creates one item in-place at the end of the list. More... | |
| T * | peek () |
| Accesses the first element. More... | |
| const T * | peek () const |
| void | pop () |
| Removes the first element. More... | |
Generic queue based on the linked list class defined in libuavcan.
This class does not use heap memory.
|
inline |
Accesses the first element.
Nullptr will be returned if the queue is empty. Complexity is O(1).
|
inline |
Removes the first element.
If the queue is empty, nothing will be done and assertion failure will be triggered. Complexity is O(1).
Creates one item in-place at the end of the list.
Returns true if the item was appended successfully, false if there's not enough memory. Complexity is O(N) where N is queue length.
1.8.12