Helper class that reduces code size by providing type-erased static methods for the functionality of the templated GenericVarLenEntryQueue types.
|
| static constexpr Info | GetInfo (ConstByteSpan bytes, size_t head, size_t tail) |
| |
|
static constexpr size_t | AvailableBytes (ConstByteSpan bytes, size_t head, size_t tail) |
| | Returns the number of bytes not being used to store entries.
|
| |
|
static constexpr bool | Push (ConstByteSpan data, bool overwrite, ByteSpan bytes, size_t &head, size_t &tail) |
| | Add an entry to the tail of the queue.
|
| |
|
static constexpr size_t | PopNonEmpty (ConstByteSpan bytes, size_t &head) |
| | Removes an entry from the head of the queue. Must not be empty.
|
| |
| static constexpr void | CopyEntries (ConstByteSpan src_bytes, size_t &src_head, size_t src_tail, ByteSpan dst_bytes, size_t &dst_head, size_t &dst_tail, bool overwrite) |
| |
|
static constexpr void | CopyAndWrap (ConstByteSpan data, ByteSpan bytes, size_t &tail) |
| | Copies data to the buffer, wrapping around the end if needed.
|
| |
| static constexpr std::pair< ConstByteSpan, ConstByteSpan > | ContiguousRawStorage (ConstByteSpan bytes, size_t head, size_t tail) |
| |
|
static void | Dering (ByteSpan bytes, size_t head) |
| | Moves entries to be contiguous and start from the beginning of the buffer.
|
| |
|
|
template<typename D1 , typename T1 , typename D2 , typename T2 > |
| constexpr void | CopyVarLenEntriesImpl (const GenericVarLenEntryQueue< D1, T1 > &src, GenericVarLenEntryQueue< D2, T2 > &dst, bool overwrite) |
| |
|
template<typename D1 , typename T1 , typename D2 , typename T2 > |
| constexpr void | MoveVarLenEntriesImpl (GenericVarLenEntryQueue< D1, T1 > &src, GenericVarLenEntryQueue< D2, T2 > &dst, bool overwrite) |
| |
◆ ContiguousRawStorage()
Returns views of the contiguous raw storage backing this queue. If empty, both returned spans will be empty. If the data does not wrap, only the first returned span will be non-empty. If the data wraps around, both contiguous regions will be returned, from the head to the tail.
◆ CopyEntries()
| constexpr void pw::containers::internal::GenericVarLenEntryQueueBase::CopyEntries |
( |
ConstByteSpan |
src_bytes, |
|
|
size_t & |
src_head, |
|
|
size_t |
src_tail, |
|
|
ByteSpan |
dst_bytes, |
|
|
size_t & |
dst_head, |
|
|
size_t & |
dst_tail, |
|
|
bool |
overwrite |
|
) |
| |
|
staticconstexprprotected |
Copies entries from another queue to this one.
This will discard existing entries as needed to make room if allowed to overwrite.
◆ GetInfo()
Returns the number, total data, and total size of the variable-length entries in the buffer. This is at most O(n) in the number of entries in the queue.
The documentation for this class was generated from the following file:
- pw_containers/public/pw_containers/internal/generic_var_len_entry_queue.h