|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <SlotTable.h>
Public Member Functions | |
| T * | lookup (int id) |
| 1-based lookup. Returns nullptr if id is out of range or slot unused. | |
| T * | allocate (int &out_id) |
Static Public Member Functions | |
| static constexpr std::size_t | capacity () |
Public Attributes | |
| std::array< T, N > | slots {} |
Definition at line 20 of file SlotTable.h.
|
inline |
First-fit allocate. Returns the slot and writes 1-based id to out_id. Returns nullptr if the table is full; out_id is set to 0 in that case. Does NOT mark the slot used - caller initialises the slot then sets used = true once setup succeeds.
Definition at line 37 of file SlotTable.h.
References slots.
Referenced by host_event_subscribe(), host_http_open(), and host_socket_open().
|
inlinestaticconstexpr |
Definition at line 23 of file SlotTable.h.
|
inline |
1-based lookup. Returns nullptr if id is out of range or slot unused.
Definition at line 26 of file SlotTable.h.
References slots.
| std::array<T, N> cdc::plugin_manager::SlotTable< T, N >::slots {} |
Definition at line 21 of file SlotTable.h.
Referenced by allocate(), lookup(), plg_http_on_unload(), and plg_socket_on_unload().