PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Generic queue based on the linked list class defined in libuavcan. More...
#include <uavcan_virtual_can_driver.hpp>
Classes | |
struct | Item |
Public Member Functions | |
Queue (uavcan::IPoolAllocator &arg_allocator, std::size_t block_allocation_quota) | |
~Queue () | |
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... | |
Private Attributes | |
uavcan::LimitedPoolAllocator | allocator_ |
uavcan::LinkedListRoot< Item > | list_ |
Generic queue based on the linked list class defined in libuavcan.
This class does not use heap memory.
Definition at line 97 of file uavcan_virtual_can_driver.hpp.
|
inline |
Definition at line 110 of file uavcan_virtual_can_driver.hpp.
Definition at line 116 of file uavcan_virtual_can_driver.hpp.
|
inline |
Definition at line 123 of file uavcan_virtual_can_driver.hpp.
Referenced by VirtualCanIface::addRxFrame(), VirtualCanIface::hasDataInRxQueue(), and VirtualCanIface::receive().
|
inline |
Accesses the first element.
Nullptr will be returned if the queue is empty. Complexity is O(1).
Definition at line 168 of file uavcan_virtual_can_driver.hpp.
Referenced by VirtualCanIface::receive().
|
inline |
Definition at line 169 of file uavcan_virtual_can_driver.hpp.
|
inline |
Removes the first element.
If the queue is empty, nothing will be done and assertion failure will be triggered. Complexity is O(1).
Definition at line 176 of file uavcan_virtual_can_driver.hpp.
Referenced by VirtualCanIface::addRxFrame(), and VirtualCanIface::receive().
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.
Definition at line 131 of file uavcan_virtual_can_driver.hpp.
Referenced by VirtualCanIface::addRxFrame().
|
private |
Definition at line 106 of file uavcan_virtual_can_driver.hpp.
Definition at line 107 of file uavcan_virtual_can_driver.hpp.