Macros | |
| #define | PW_VARIABLE_LENGTH_ENTRY_QUEUE_DECLARE(variable, max_size_bytes) |
Typedefs | |
| typedef uint32_t * | pw_InlineVarLenEntryQueue_Handle |
| typedef const uint32_t * | pw_InlineVarLenEntryQueue_ConstHandle |
Functions | |
| void | pw_InlineVarLenEntryQueue_Init (uint32_t array[], size_t array_size_uint32) |
| pw_InlineVarLenEntryQueue_Iterator | pw_InlineVarLenEntryQueue_Begin (pw_InlineVarLenEntryQueue_Handle queue) |
Returns an iterator to the start of the queue. | |
| pw_InlineVarLenEntryQueue_ConstIterator | pw_InlineVarLenEntryQueue_ConstBegin (pw_InlineVarLenEntryQueue_ConstHandle queue) |
| pw_InlineVarLenEntryQueue_Iterator | pw_InlineVarLenEntryQueue_End (pw_InlineVarLenEntryQueue_Handle queue) |
Returns an iterator to the end of the queue. | |
| pw_InlineVarLenEntryQueue_ConstIterator | pw_InlineVarLenEntryQueue_ConstEnd (pw_InlineVarLenEntryQueue_ConstHandle queue) |
| bool | pw_InlineVarLenEntryQueue_Empty (pw_InlineVarLenEntryQueue_ConstHandle queue) |
| Returns true if the queue is empty, false if it has at least one entry. | |
| uint32_t | pw_InlineVarLenEntryQueue_Size (pw_InlineVarLenEntryQueue_ConstHandle queue) |
| uint32_t | pw_InlineVarLenEntryQueue_MaxSize (pw_InlineVarLenEntryQueue_ConstHandle queue) |
| uint32_t | pw_InlineVarLenEntryQueue_SizeBytes (pw_InlineVarLenEntryQueue_ConstHandle queue) |
| uint32_t | pw_InlineVarLenEntryQueue_MaxSizeBytes (pw_InlineVarLenEntryQueue_ConstHandle queue) |
| void | pw_InlineVarLenEntryQueue_Push (pw_InlineVarLenEntryQueue_Handle queue, const void *data, uint32_t data_size_bytes) |
| bool | pw_InlineVarLenEntryQueue_TryPush (pw_InlineVarLenEntryQueue_Handle queue, const void *data, const uint32_t data_size_bytes) |
| void | pw_InlineVarLenEntryQueue_PushOverwrite (pw_InlineVarLenEntryQueue_Handle queue, const void *data, uint32_t data_size_bytes) |
| void | pw_InlineVarLenEntryQueue_Pop (pw_InlineVarLenEntryQueue_Handle queue) |
| void | pw_InlineVarLenEntryQueue_Clear (pw_InlineVarLenEntryQueue_Handle queue) |
| Empties the queue. | |
| uint32_t | pw_InlineVarLenEntryQueue_RawStorageSizeBytes (pw_InlineVarLenEntryQueue_ConstHandle queue) |
| void | pw_InlineVarLenEntryQueue_CopyEntries (pw_InlineVarLenEntryQueue_ConstHandle from, pw_InlineVarLenEntryQueue_Handle to) |
| void | pw_InlineVarLenEntryQueue_CopyEntriesOverwrite (pw_InlineVarLenEntryQueue_ConstHandle from, pw_InlineVarLenEntryQueue_Handle to) |
| void | pw_InlineVarLenEntryQueue_MoveEntries (pw_InlineVarLenEntryQueue_Handle from, pw_InlineVarLenEntryQueue_Handle to) |
| void | pw_InlineVarLenEntryQueue_MoveEntriesOverwrite (pw_InlineVarLenEntryQueue_Handle from, pw_InlineVarLenEntryQueue_Handle to) |
| #define PW_VARIABLE_LENGTH_ENTRY_QUEUE_DECLARE | ( | variable, | |
| max_size_bytes | |||
| ) |
Declares and initializes an array that can back an InlineVarLenEntryQueue that can hold up to max_size_bytes bytes when using the C API. max_size_bytes is the largest supported size for a single entry; attempting to store larger entries is invalid and will fail an assertion.
See also pw_InlineVarLenEntryQueue_Init.
| variable | variable name for the queue |
| max_size_bytes | the capacity of the queue |
| pw_InlineVarLenEntryQueue_Iterator pw_InlineVarLenEntryQueue_Begin | ( | pw_InlineVarLenEntryQueue_Handle | queue | ) |
Returns an iterator to the start of the queue.
| void pw_InlineVarLenEntryQueue_Clear | ( | pw_InlineVarLenEntryQueue_Handle | queue | ) |
Empties the queue.
| pw_InlineVarLenEntryQueue_ConstIterator pw_InlineVarLenEntryQueue_ConstBegin | ( | pw_InlineVarLenEntryQueue_ConstHandle | queue | ) |
| pw_InlineVarLenEntryQueue_ConstIterator pw_InlineVarLenEntryQueue_ConstEnd | ( | pw_InlineVarLenEntryQueue_ConstHandle | queue | ) |
| void pw_InlineVarLenEntryQueue_CopyEntries | ( | pw_InlineVarLenEntryQueue_ConstHandle | from, |
| pw_InlineVarLenEntryQueue_Handle | to | ||
| ) |
Copies as many consecutive entries as will fit in the destination queue from a source queue to another, and returns the number of bytes copied.
| void pw_InlineVarLenEntryQueue_CopyEntriesOverwrite | ( | pw_InlineVarLenEntryQueue_ConstHandle | from, |
| pw_InlineVarLenEntryQueue_Handle | to | ||
| ) |
Copies consecutive entries from one queue to another, discarding entries from the destination queue as needed to make room. Some entries may not be copied if the data in the source queue is larger the destination queue's capacity. Returns the number of bytes copied.
| bool pw_InlineVarLenEntryQueue_Empty | ( | pw_InlineVarLenEntryQueue_ConstHandle | queue | ) |
Returns true if the queue is empty, false if it has at least one entry.
| pw_InlineVarLenEntryQueue_Iterator pw_InlineVarLenEntryQueue_End | ( | pw_InlineVarLenEntryQueue_Handle | queue | ) |
Returns an iterator to the end of the queue.
| void pw_InlineVarLenEntryQueue_Init | ( | uint32_t | array[], |
| size_t | array_size_uint32 | ||
| ) |
Initializes a BasicInlineVarLenEntryQueue in place within a uint32_t array. The array MUST be larger than PW_VARIABLE_LENGTH_ENTRY_QUEUE_HEADER_SIZE_UINT32 (3) elements.
| uint32_t pw_InlineVarLenEntryQueue_MaxSize | ( | pw_InlineVarLenEntryQueue_ConstHandle | queue | ) |
Returns the maximum number of entries in the queue. This is only attainable if all entries are empty.
| uint32_t pw_InlineVarLenEntryQueue_MaxSizeBytes | ( | pw_InlineVarLenEntryQueue_ConstHandle | queue | ) |
Returns the maximum number of bytes that can be stored in the queue. This is largest possible value of size_bytes(), and the size of the largest single entry that can be stored in this queue. Attempting to store a larger entry is invalid and results in a crash.
| void pw_InlineVarLenEntryQueue_MoveEntries | ( | pw_InlineVarLenEntryQueue_Handle | from, |
| pw_InlineVarLenEntryQueue_Handle | to | ||
| ) |
Moves as many consecutive entries as will fit in the destination queue from a source queue to another, and returns the number of bytes moved.
| void pw_InlineVarLenEntryQueue_MoveEntriesOverwrite | ( | pw_InlineVarLenEntryQueue_Handle | from, |
| pw_InlineVarLenEntryQueue_Handle | to | ||
| ) |
Moves consecutive entries from one queue to another, discarding entries from the destination queue as needed to make room. Some entries may not be moved if the data in the source queue is larger the destination queue's capacity. Returns the number of bytes moved.
| void pw_InlineVarLenEntryQueue_Pop | ( | pw_InlineVarLenEntryQueue_Handle | queue | ) |
Removes the first entry from queue.
| void pw_InlineVarLenEntryQueue_Push | ( | pw_InlineVarLenEntryQueue_Handle | queue, |
| const void * | data, | ||
| uint32_t | data_size_bytes | ||
| ) |
Appends an entry to the end of the queue.
max_size_bytes(). | void pw_InlineVarLenEntryQueue_PushOverwrite | ( | pw_InlineVarLenEntryQueue_Handle | queue, |
| const void * | data, | ||
| uint32_t | data_size_bytes | ||
| ) |
Appends an entry to the end of the queue, removing entries with Pop as necessary to make room. Calling this function drops old entries to make room for new; call try_push() to drop new entries instead.
max_size_bytes(). | uint32_t pw_InlineVarLenEntryQueue_RawStorageSizeBytes | ( | pw_InlineVarLenEntryQueue_ConstHandle | queue | ) |
Underlying storage of the variable-length entry queue. May be used to memcpy the queue.
| uint32_t pw_InlineVarLenEntryQueue_Size | ( | pw_InlineVarLenEntryQueue_ConstHandle | queue | ) |
Returns the number of variable-length entries in the queue. This is at most O(n) in the number of entries in the queue.
| uint32_t pw_InlineVarLenEntryQueue_SizeBytes | ( | pw_InlineVarLenEntryQueue_ConstHandle | queue | ) |
Returns the combined size in bytes of all entries in the queue, excluding metadata. This is at most O(n) in the number of entries in the queue.
| bool pw_InlineVarLenEntryQueue_TryPush | ( | pw_InlineVarLenEntryQueue_Handle | queue, |
| const void * | data, | ||
| const uint32_t | data_size_bytes | ||
| ) |
Appends an entry to the end of the queue, but only if there is sufficient space for it.
max_size_bytes().