C/C++ API Reference
Loading...
Searching...
No Matches
pw_containers

Oveview

Generic collections of objects for embedded devices: https://pigweed.dev/pw_containers.

Submodules

 Lists
 
 Maps
 
 Queues
 
 Sets
 
 Utilities
 
 Vectors
 

Namespaces

namespace  pw
 The Pigweed namespace.
 

Classes

class  pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >
 
class  pw::BasicInlineAsyncDeque< ValueType, SizeType, containers::internal::kGenericSized >
 
class  pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >
 
class  pw::containers::internal::VarLenEntryQueueEntry< T >
 Refers to an entry in-place in the queue. Entries may be discontiguous. More...
 
class  pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >
 
class  pw::containers::internal::VarLenEntryQueueEntryIterator< T >
 
class  pw::containers::internal::GenericAATree
 
class  pw::containers::internal::KeyedAATree< K >
 
class  pw::containers::internal::AATree< K, V >
 
class  pw::containers::internal::AATree< K, V >::Item
 
class  pw::containers::internal::AATree< K, V >::Pair
 An extension of Item that includes storage for a key. More...
 

Macros

#define _PW_VAR_QUEUE_DATA_SIZE_UINT32(max_size_bytes)    ((_PW_VAR_QUEUE_DATA_SIZE_BYTES(max_size_bytes) + 3 /* round up */) / 4)
 
#define _PW_VAR_QUEUE_DATA_SIZE_BYTES(max_size_bytes)
 
#define _PW_VAR_QUEUE_ARRAY_SIZE_BYTES   queue[0]
 
#define _PW_VAR_QUEUE_HEAD   queue[1]
 
#define _PW_VAR_QUEUE_TAIL   queue[2]
 
#define _PW_VAR_QUEUE_DATA   ((const uint8_t*)&queue[3])
 

Typedefs

template<typename T , size_t kCapacity = containers::internal::kGenericSized>
using pw::InlineAsyncDeque = BasicInlineAsyncDeque< T, uint16_t, kCapacity >
 
template<typename ValueType , typename SizeType , size_t kCapacity = containers::internal::kGenericSized>
using pw::BasicInlineDeque = containers::internal::BasicInlineDequeImpl< ValueType, containers::internal::CountAndCapacity< SizeType >, kCapacity >
 
template<typename T , size_t kCapacity = containers::internal::kGenericSized>
using pw::InlineDeque = BasicInlineDeque< T, uint16_t, kCapacity >
 
template<size_t kCapacity>
using pw::BasicInlineQueue< ValueType, SizeType, containers::internal::kGenericSized >::Derived = BasicInlineQueue< value_type, size_type, kCapacity >
 
using pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::value_type = containers::internal::VarLenEntryQueueEntry< T >
 
using pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::const_value_type = containers::internal::VarLenEntryQueueEntry< const T >
 
using pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::size_type = std::uint32_t
 
using pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::pointer = const value_type *
 
using pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::const_pointer = pointer
 
using pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::reference = const value_type &
 
using pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::const_reference = reference
 
using pw::containers::internal::VarLenEntryQueueEntryIterator< T >::difference_type = std::ptrdiff_t
 
using pw::containers::internal::VarLenEntryQueueEntryIterator< T >::value_type = std::remove_cv_t< T >
 
using pw::containers::internal::VarLenEntryQueueEntryIterator< T >::pointer = T *
 
using pw::containers::internal::VarLenEntryQueueEntryIterator< T >::reference = T &
 
using pw::containers::internal::VarLenEntryQueueEntryIterator< T >::iterator_category = std::forward_iterator_tag
 
using pw::containers::internal::VarLenEntryQueueEntry< T >::element_type = T
 
using pw::containers::internal::VarLenEntryQueueEntry< T >::value_type = std::remove_cv_t< T >
 
using pw::containers::internal::VarLenEntryQueueEntry< T >::size_type = std::uint32_t
 
using pw::containers::internal::VarLenEntryQueueEntry< T >::pointer = T *
 
using pw::containers::internal::VarLenEntryQueueEntry< T >::const_pointer = const T *
 
using pw::containers::internal::VarLenEntryQueueEntry< T >::reference = T &
 
using pw::containers::internal::VarLenEntryQueueEntry< T >::const_reference = const T &
 
using pw::containers::internal::VarLenEntryQueueEntry< T >::iterator = VarLenEntryQueueEntryIterator< T >
 
using pw::containers::internal::VarLenEntryQueueEntry< T >::const_iterator = VarLenEntryQueueEntryIterator< const T >
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::difference_type = std::ptrdiff_t
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::value_type = BasicInlineVarLenEntryQueue< T >::const_value_type
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::pointer = const value_type *
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::reference = const value_type &
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::iterator_category = std::forward_iterator_tag
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::difference_type = std::ptrdiff_t
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::value_type = BasicInlineVarLenEntryQueue< T >::value_type
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::pointer = const value_type *
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::reference = const value_type &
 
using pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::iterator_category = std::forward_iterator_tag
 
using pw::containers::internal::GenericAATree::iterator = AATreeIterator<>
 
using pw::containers::internal::KeyedAATree< K >::Key = K
 
using pw::containers::internal::KeyedAATree< K >::Compare = Function< bool(Key, Key)>
 
using pw::containers::internal::KeyedAATree< K >::GetKey = Function< Key(const AATreeItem &)>
 
using pw::containers::internal::AATree< K, V >::Base = KeyedAATree< K >
 
using pw::containers::internal::AATree< K, V >::Key = typename Base::Key
 
using pw::containers::internal::AATree< K, V >::Compare = typename Base::Compare
 
using pw::containers::internal::AATree< K, V >::GetKey = Function< Key(const V &)>
 
template<typename T >
using pw::IntrusiveList = containers::future::IntrusiveList< T >
 

Functions

constexpr pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque () noexcept=default
 Constructs with zero elements.
 
 pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque (size_type count, const_reference value)
 Constructs with count copies of value.
 
 pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque (size_type count)
 Constructs with count default-initialized elements.
 
template<typename InputIterator , typename = containers::internal::EnableIfInputIterator<InputIterator>>
 pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque (InputIterator start, InputIterator finish)
 Copy constructs from an iterator.
 
 pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque (const BasicInlineAsyncDeque &other)
 Copy constructs for matching capacity.
 
template<size_t kOtherCapacity>
 pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque (const BasicInlineAsyncDeque< ValueType, SizeType, kOtherCapacity > &other)
 
 pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque (BasicInlineAsyncDeque &&other) noexcept
 Move constructs for matching capacity.
 
template<size_t kOtherCapacity>
 pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque (BasicInlineAsyncDeque< ValueType, SizeType, kOtherCapacity > &&other) noexcept
 Move constructs for mismatched capacity.
 
 pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque (const std::initializer_list< value_type > &list)
 Copy constructs from an initializer list.
 
template<typename T , typename = containers::internal::EnableIfIterable<T>>
 pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque (const T &other)
 Copy constructor for arbitrary iterables.
 
BasicInlineAsyncDequepw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::operator= (const std::initializer_list< value_type > &list)
 Copy assigns from list.
 
BasicInlineAsyncDequepw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::operator= (const BasicInlineAsyncDeque &other)
 Copy assigns for matching capacity.
 
template<size_t kOtherCapacity>
BasicInlineAsyncDequepw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::operator= (const BasicInlineAsyncDeque< ValueType, SizeType, kOtherCapacity > &other)
 
BasicInlineAsyncDequepw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::operator= (BasicInlineAsyncDeque &&other) noexcept
 Move assigns for matching capacity.
 
template<size_t kOtherCapacity>
BasicInlineAsyncDequepw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::operator= (BasicInlineAsyncDeque< ValueType, SizeType, kOtherCapacity > &&other) noexcept
 Move assigns for mismatched capacity.
 
static constexpr size_type pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::max_size ()
 
static constexpr size_type pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::capacity ()
 
BasicInlineAsyncDequepw::BasicInlineAsyncDeque< ValueType, SizeType, containers::internal::kGenericSized >::operator= (const BasicInlineAsyncDeque &other)
 
BasicInlineAsyncDequepw::BasicInlineAsyncDeque< ValueType, SizeType, containers::internal::kGenericSized >::operator= (BasicInlineAsyncDeque &&other) noexcept
 
async2::Poll pw::BasicInlineAsyncDeque< ValueType, SizeType, containers::internal::kGenericSized >::PendHasSpace (async2::Context &context, size_type num=1)
 Returns Pending until space for num elements is available.
 
async2::Poll pw::BasicInlineAsyncDeque< ValueType, SizeType, containers::internal::kGenericSized >::PendNotEmpty (async2::Context &context)
 Returns Pending until an element is available.
 
constexpr pw::BasicInlineAsyncDeque< ValueType, SizeType, containers::internal::kGenericSized >::BasicInlineAsyncDeque (size_type capacity) noexcept
 
constexpr pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (ConstexprTag constexpr_tag) noexcept
 
 pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (size_type count, const_reference value)
 
 pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (size_type count)
 
template<typename InputIterator , typename = containers::internal::EnableIfInputIterator<InputIterator>>
 pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (InputIterator start, InputIterator finish)
 
 pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (const std::initializer_list< value_type > &list)
 
 pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (const BasicInlineQueue &other)
 Copy constructs for matching capacity.
 
template<size_t kOtherCapacity>
 pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (const BasicInlineQueue< ValueType, SizeType, kOtherCapacity > &other)
 
 pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (BasicInlineQueue &&other)
 Move constructs for matching capacity.
 
template<size_t kOtherCapacity>
 pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (BasicInlineQueue< ValueType, SizeType, kOtherCapacity > &&other)
 
template<typename T , typename = containers::internal::EnableIfIterable<T>>
 pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue (const T &other)
 
BasicInlineQueuepw::BasicInlineQueue< ValueType, SizeType, kCapacity >::operator= (const std::initializer_list< value_type > &list)
 
BasicInlineQueuepw::BasicInlineQueue< ValueType, SizeType, kCapacity >::operator= (const BasicInlineQueue &other)
 Copy assigns from matching capacity.
 
template<size_t kOtherCapacity>
BasicInlineQueuepw::BasicInlineQueue< ValueType, SizeType, kCapacity >::operator= (const BasicInlineQueue< ValueType, SizeType, kOtherCapacity > &other)
 
BasicInlineQueuepw::BasicInlineQueue< ValueType, SizeType, kCapacity >::operator= (BasicInlineQueue &&other)
 Move assigns from matching capacity.
 
template<size_t kOtherCapacity>
BasicInlineQueuepw::BasicInlineQueue< ValueType, SizeType, kCapacity >::operator= (BasicInlineQueue< ValueType, SizeType, kOtherCapacity > &&other)
 
template<typename T , typename = containers::internal::EnableIfIterable<T>>
BasicInlineQueuepw::BasicInlineQueue< ValueType, SizeType, kCapacity >::operator= (const T &other)
 
static constexpr size_type pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::max_size ()
 
static constexpr size_type pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::capacity ()
 
Dequepw::BasicInlineQueue< ValueType, SizeType, containers::internal::kGenericSized >::deque ()
 
const Dequepw::BasicInlineQueue< ValueType, SizeType, containers::internal::kGenericSized >::deque () const
 
reference pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::at (size_type index)
 
const_reference pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::at (size_type index) const
 
reference pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::operator[] (size_type index)
 
const_reference pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::operator[] (size_type index) const
 
std::pair< span< const value_type >, span< const value_type > > pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::contiguous_data () const
 
std::pair< span< value_type >, span< value_type > > pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::contiguous_data ()
 
iterator pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::begin () noexcept
 
const_iterator pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::begin () const noexcept
 
const_iterator pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::cbegin () const noexcept
 
iterator pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::end () noexcept
 
const_iterator pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::end () const noexcept
 
const_iterator pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::cend () const noexcept
 
bool pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::full () const noexcept
 
void pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::clear () noexcept
 
void pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::push_overwrite (const value_type &value)
 
void pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::push_overwrite (value_type &&value)
 
template<typename... Args>
void pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >::emplace_overwrite (Args &&... args)
 
static pw_InlineVarLenEntryQueue_ConstIterator pw_InlineVarLenEntryQueue_ConstBegin (pw_InlineVarLenEntryQueue_ConstHandle queue)
 
static const uint8_t * _pw_InlineVarLenEntryQueue_ConstEntry_GetPointer (const pw_InlineVarLenEntryQueue_ConstEntry *entry, size_t index)
 
const uint8_t * _pw_InlineVarLenEntryQueue_ConstEntry_GetPointerChecked (const pw_InlineVarLenEntryQueue_ConstEntry *entry, size_t index)
 
 PW_MODIFY_DIAGNOSTICS_POP ()
 
constexpr pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::BasicInlineVarLenEntryQueue (ConstexprTag)
 
 pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::BasicInlineVarLenEntryQueue (const BasicInlineVarLenEntryQueue &)=default
 
BasicInlineVarLenEntryQueuepw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::operator= (const BasicInlineVarLenEntryQueue &)=default
 
template<size_t kArraySize>
static BasicInlineVarLenEntryQueuepw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::Init (uint32_t(&array)[kArraySize])
 
static BasicInlineVarLenEntryQueuepw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::Init (uint32_t array[], size_t array_size_uint32)
 
value_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::front ()
 
const_value_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::front () const
 
iterator pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::begin ()
 Returns an iterator to the start of the InlineVarLenEntryQueue.
 
const_iterator pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::begin () const
 
const_iterator pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::cbegin () const
 
iterator pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::end ()
 Returns an iterator that points past the end of the queue.
 
const_iterator pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::end () const
 
const_iterator pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::cend () const
 
bool pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::empty () const
 
size_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::size () const
 
size_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::max_size () const
 
size_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::size_bytes () const
 
size_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::max_size_bytes () const
 
span< const T > pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::raw_storage () const
 
void pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::clear ()
 Empties the queue.
 
void pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::push (span< const T > value)
 
bool pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::try_push (span< const T > value)
 
void pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::push_overwrite (span< const T > value)
 
void pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::pop ()
 
constexpr pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::BasicInlineVarLenEntryQueue (uint32_t max_size_bytes)
 
 pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::BasicInlineVarLenEntryQueue (const BasicInlineVarLenEntryQueue &)=default
 
BasicInlineVarLenEntryQueuepw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::operator= (const BasicInlineVarLenEntryQueue &)=default
 
constexpr pw::containers::internal::VarLenEntryQueueEntryIterator< T >::VarLenEntryQueueEntryIterator (const VarLenEntryQueueEntryIterator &)=default
 
constexpr VarLenEntryQueueEntryIteratorpw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator= (const VarLenEntryQueueEntryIterator &)=default
 
constexpr VarLenEntryQueueEntryIteratorpw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator++ ()
 
constexpr VarLenEntryQueueEntryIterator pw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator++ (int)
 
constexpr VarLenEntryQueueEntryIteratorpw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator+= (difference_type n)
 
reference pw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator* () const
 
pointer pw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator-> () const
 
constexpr pw::containers::internal::VarLenEntryQueueEntry< T >::VarLenEntryQueueEntry (const VarLenEntryQueueEntry &)=default
 
constexpr VarLenEntryQueueEntrypw::containers::internal::VarLenEntryQueueEntry< T >::operator= (const VarLenEntryQueueEntry &)=default
 
constexpr pw::containers::internal::VarLenEntryQueueEntry< T >::operator VarLenEntryQueueEntry< const T > () const
 
reference pw::containers::internal::VarLenEntryQueueEntry< T >::at (size_t index) const
 
reference pw::containers::internal::VarLenEntryQueueEntry< T >::operator[] (size_t index) const
 
reference pw::containers::internal::VarLenEntryQueueEntry< T >::front () const
 
reference pw::containers::internal::VarLenEntryQueueEntry< T >::back () const
 
std::pair< span< element_type >, span< element_type > > pw::containers::internal::VarLenEntryQueueEntry< T >::contiguous_data () const
 
size_type pw::containers::internal::VarLenEntryQueueEntry< T >::copy (value_type *dest, size_type count) const
 
iterator pw::containers::internal::VarLenEntryQueueEntry< T >::begin () const
 
const_iterator pw::containers::internal::VarLenEntryQueueEntry< T >::cbegin () const
 
iterator pw::containers::internal::VarLenEntryQueueEntry< T >::end () const
 
const_iterator pw::containers::internal::VarLenEntryQueueEntry< T >::cend () const
 
bool pw::containers::internal::VarLenEntryQueueEntry< T >::empty () const
 
size_type pw::containers::internal::VarLenEntryQueueEntry< T >::size () const
 
constexpr pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::const_iterator (const const_iterator &)=default
 
constexpr const_iteratorpw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::operator= (const const_iterator &)=default
 
const_iteratorpw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::operator++ ()
 
const_iterator pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::operator++ (int)
 
reference pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::operator* () const
 
pointer pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::operator-> () const
 
bool pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::operator== (const const_iterator &rhs) const
 
bool pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::operator!= (const const_iterator &rhs) const
 
constexpr pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::iterator (const iterator &)=default
 
constexpr iteratorpw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::operator= (const iterator &)=default
 
iteratorpw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::operator++ ()
 
iterator pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::operator++ (int)
 
reference pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::operator* () const
 
pointer pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::operator-> () const
 
bool pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::operator== (const iterator &rhs) const
 
bool pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::operator!= (const iterator &rhs) const
 
constexpr pw::containers::internal::GenericAATree::GenericAATree (bool unique_keys)
 
 pw::containers::internal::GenericAATree::~GenericAATree ()
 Destructor.
 
 pw::containers::internal::GenericAATree::GenericAATree (const GenericAATree &)=delete
 
GenericAATreepw::containers::internal::GenericAATree::operator= (const GenericAATree &)=delete
 
constexpr bool pw::containers::internal::GenericAATree::unique_keys () const
 
void pw::containers::internal::GenericAATree::SetRoot (AATreeItem *item)
 Sets the tree's root item.
 
constexpr iterator pw::containers::internal::GenericAATree::begin () noexcept
 Returns a pointer to the first item, if any.
 
constexpr iterator pw::containers::internal::GenericAATree::end () noexcept
 Returns a pointer to the last item, if any.
 
constexpr bool pw::containers::internal::GenericAATree::empty () const
 Returns whether the tree has zero items or not.
 
size_t pw::containers::internal::GenericAATree::size () const
 Returns the number of items in the tree.
 
constexpr size_t pw::containers::internal::GenericAATree::max_size () const noexcept
 
void pw::containers::internal::GenericAATree::clear ()
 
iterator pw::containers::internal::GenericAATree::erase_one (AATreeItem &item)
 
iterator pw::containers::internal::GenericAATree::erase_range (AATreeItem &first, AATreeItem &last)
 
void pw::containers::internal::GenericAATree::swap (GenericAATree &other)
 Exchanges this tree's items with the other tree's items.
 
constexpr pw::containers::internal::KeyedAATree< K >::KeyedAATree (bool unique_keys, Compare &&compare, GetKey &&get_key)
 
void pw::containers::internal::KeyedAATree< K >::SetCompare (Compare &&compare)
 
void pw::containers::internal::KeyedAATree< K >::SetGetKey (GetKey &&get_key)
 
std::pair< iterator, bool > pw::containers::internal::KeyedAATree< K >::insert (AATreeItem &item)
 
template<class Iterator >
void pw::containers::internal::KeyedAATree< K >::insert (Iterator first, Iterator last)
 
size_t pw::containers::internal::KeyedAATree< K >::erase_all (Key key)
 
void pw::containers::internal::KeyedAATree< K >::merge (KeyedAATree< K > &other)
 
size_t pw::containers::internal::KeyedAATree< K >::count (Key key)
 
iterator pw::containers::internal::KeyedAATree< K >::find (Key key)
 
std::pair< iterator, iterator > pw::containers::internal::KeyedAATree< K >::equal_range (Key key)
 
iterator pw::containers::internal::KeyedAATree< K >::lower_bound (Key key)
 
iterator pw::containers::internal::KeyedAATree< K >::upper_bound (Key key)
 
constexpr pw::containers::internal::AATree< K, V >::Pair::Pair (Key key)
 
constexpr Key pw::containers::internal::AATree< K, V >::Pair::key () const
 
constexpr bool pw::containers::internal::AATree< K, V >::Pair::operator< (const Pair &rhs)
 
constexpr pw::containers::internal::AATree< K, V >::AATree (bool unique_keys, Compare &&compare, GetKey &&get_key)
 

Variables

pw_InlineVarLenEntryQueue_ConstHandle pw_InlineVarLenEntryQueue_ConstIterator::_pw_queue
 
uint32_t pw_InlineVarLenEntryQueue_ConstIterator::_pw_offset
 
pw_InlineVarLenEntryQueue_ConstIterator pw_InlineVarLenEntryQueue_Iterator::_iterator
 
uint8_t * pw_InlineVarLenEntryQueue_Entry::data_1
 
uint32_t pw_InlineVarLenEntryQueue_Entry::size_1
 
uint8_t * pw_InlineVarLenEntryQueue_Entry::data_2
 
uint32_t pw_InlineVarLenEntryQueue_Entry::size_2
 
const uint8_t * pw_InlineVarLenEntryQueue_ConstEntry::data_1
 
uint32_t pw_InlineVarLenEntryQueue_ConstEntry::size_1
 
const uint8_t * pw_InlineVarLenEntryQueue_ConstEntry::data_2
 
uint32_t pw_InlineVarLenEntryQueue_ConstEntry::size_2
 
GetKey pw::containers::internal::AATree< K, V >::get_key_
 

Friends

template<typename , typename >
class pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::containers::internal::BasicInlineQueueImpl
 
template<typename , typename >
class pw::BasicInlineQueue< ValueType, SizeType, containers::internal::kGenericSized >::containers::internal::GenericQueue
 
template<typename U >
class pw::containers::internal::VarLenEntryQueueEntryIterator< T >::VarLenEntryQueueEntry
 
class pw::containers::internal::VarLenEntryQueueEntry< T >::VarLenEntryQueueEntry< std::remove_const_t< T > >
 
class pw::containers::internal::VarLenEntryQueueEntry< T >::BasicInlineVarLenEntryQueue
 
class pw::containers::internal::VarLenEntryQueueEntry< T >::BasicInlineVarLenEntryQueue< std::remove_const_t< T > >::iterator
 
class pw::containers::internal::VarLenEntryQueueEntry< T >::BasicInlineVarLenEntryQueue< std::remove_const_t< T > >::const_iterator
 
class pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::const_iterator::BasicInlineVarLenEntryQueue
 
class pw::BasicInlineVarLenEntryQueue< T, kMaxSizeBytes >::iterator::BasicInlineVarLenEntryQueue
 
template<typename >
class pw::containers::internal::GenericAATree::KeyedAATree
 
template<typename , typename , bool >
struct pw::containers::internal::AATree< K, V >::Item::IntrusiveItem
 
VarLenEntryQueueEntryIterator pw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator+ (const VarLenEntryQueueEntryIterator &it, difference_type n)
 
VarLenEntryQueueEntryIterator pw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator+ (difference_type n, const VarLenEntryQueueEntryIterator &it)
 
bool pw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator== (const VarLenEntryQueueEntryIterator &lhs, const VarLenEntryQueueEntryIterator &rhs)
 
bool pw::containers::internal::VarLenEntryQueueEntryIterator< T >::operator!= (const VarLenEntryQueueEntryIterator &lhs, const VarLenEntryQueueEntryIterator &rhs)
 

Macro Definition Documentation

◆ _PW_VAR_QUEUE_DATA_SIZE_BYTES

#define _PW_VAR_QUEUE_DATA_SIZE_BYTES (   max_size_bytes)
Value:
(PW_VARINT_ENCODED_SIZE_BYTES(max_size_bytes) + max_size_bytes + \
1 /*end byte*/)
#define PW_VARINT_ENCODED_SIZE_BYTES(value)
Definition: varint.h:134

Typedef Documentation

◆ InlineAsyncDeque

template<typename T , size_t kCapacity = containers::internal::kGenericSized>
using pw::InlineAsyncDeque = typedef BasicInlineAsyncDeque<T, uint16_t, kCapacity>

Async wrapper around BasicInlineDeque.

This class mimics the structure of BasicInlineDequeImpl to allow referring to an InlineAsyncDeque without an explicit maximum size.

◆ InlineDeque

template<typename T , size_t kCapacity = containers::internal::kGenericSized>
using pw::InlineDeque = typedef BasicInlineDeque<T, uint16_t, kCapacity>

The InlineDeque class is similar to the STL's double ended queue (std::deque), except it is backed by a fixed-size buffer. InlineDeque's must be declared with an explicit maximum size (e.g. InlineDeque<int, 10>>) but deques can be used and referred to without the max size template parameter (e.g. InlineDeque<int>).

To allow referring to a pw::InlineDeque without an explicit maximum size, all InlineDeque classes inherit from a RawStorage class, which in turn inherits from InlineDeque<T>, which stores the maximum size in a variable. This allows InlineDeques to be used without having to know their maximum size at compile time. It also keeps code size small since function implementations are shared for all maximum sizes.

An InlineDeque cannot increase its capacity. Any operations that would exceed the capacity (e.g. assign, push_back, push_front) fail a PW_ASSERT. Avoid this by choosing a large enough capacity or checking full() before adding items.

◆ IntrusiveList

template<typename T >
using pw::IntrusiveList = typedef containers::future::IntrusiveList<T>

A doubly-linked intrusive list.

IntrusiveList<T> is a handle to access and manipulate the list, and IntrusiveList<T>::Item is the type from which the base class items must derive.

As a doubly-linked list, operations such as removal are O(1) in time, and the list may be iterated in either direction. However, the overhead needed is 2*sizeof(T*).

This class is modeled on std::list, with the following differences:

  • Since items are not allocated by this class, the following methods have no analogue:
    • std::list<T>::get_allocator
    • std::list<T>::emplace
    • std::list<T>::emplace_front
    • std::list<T>::emplace_back
    • std::list<T>::resize
  • Methods corresponding to the following take initializer lists of pointer to items rather than the items themselves:
    • std::list<T>::(constructor)
    • std::list<T>::assign
    • std::list<T>::insert
  • There are no overloads corresponding to the following methods that take r-value references.:
    • std::list<T>::insert
    • std::list<T>::push_back
    • std::list<T>::push_front
    • std::list<T>::splice
  • Since modifying the list modifies the items themselves, methods corresponding to those below only take iterators and not const_iterators:
    • std::list<T>::insert
    • std::list<T>::erase
    • std::list<T>::splice
  • An additional overload of erase is provided that takes a direct reference to an item.
  • C++23 methods are not (yet) supported.
Template Parameters
TType of intrusive items stored in the list.

◆ iterator

template<typename T >
using pw::containers::internal::VarLenEntryQueueEntry< T >::iterator = VarLenEntryQueueEntryIterator<T>

Iterator for the bytes in an Entry. Entries may be discontiguous, so a pointer cannot serve as an iterator.

Function Documentation

◆ AATree()

template<typename K , typename V >
constexpr pw::containers::internal::AATree< K, V >::AATree ( bool  unique_keys,
Compare &&  compare,
GetKey &&  get_key 
)
inlineconstexpr

Constructs an empty AA tree.

Parameters
unique_keysIndicates if this tree requires unique keys or allows duplicate keys.

◆ BasicInlineAsyncDeque()

template<typename ValueType , typename SizeType , size_t kCapacity = containers::internal::kGenericSized>
template<size_t kOtherCapacity>
pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::BasicInlineAsyncDeque ( const BasicInlineAsyncDeque< ValueType, SizeType, kOtherCapacity > &  other)
inline

Copy constructs for mismatched capacity.

Note that this will result in a crash if kOtherCapacity < size().

◆ BasicInlineQueue() [1/2]

template<typename ValueType , typename SizeType , size_t kCapacity = containers::internal::kGenericSized>
template<size_t kOtherCapacity>
pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue ( BasicInlineQueue< ValueType, SizeType, kOtherCapacity > &&  other)
inline

Move constructs for mismatched capacity.

Note that this will result in a crash if kOtherCapacity < size().

◆ BasicInlineQueue() [2/2]

template<typename ValueType , typename SizeType , size_t kCapacity = containers::internal::kGenericSized>
template<size_t kOtherCapacity>
pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::BasicInlineQueue ( const BasicInlineQueue< ValueType, SizeType, kOtherCapacity > &  other)
inline

Copy constructs for mismatched capacity.

Note that this will result in a crash if kOtherCapacity < size().

◆ begin()

template<typename T >
iterator pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::begin ( )
inline

Returns an iterator to the start of the InlineVarLenEntryQueue.

◆ clear() [1/2]

template<typename T >
void pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::clear ( )
inline

Empties the queue.

◆ clear() [2/2]

void pw::containers::internal::GenericAATree::clear ( )

Removes all items from the tree and leaves it empty.

The items themselves are not destructed.

◆ contiguous_data()

template<typename T >
std::pair< span< element_type >, span< element_type > > pw::containers::internal::VarLenEntryQueueEntry< T >::contiguous_data ( ) const
inline

Entries may be stored in up to two segments, so this returns spans refering to both portions of the entry. If the entry is contiguous, the second span is empty.

◆ copy()

template<typename T >
size_type pw::containers::internal::VarLenEntryQueueEntry< T >::copy ( value_type *  dest,
size_type  count 
) const
inline

Copies the contents of the entry to the provided buffer. The entry may be split into two regions; this serializes it into one buffer.

Parameters
entryThe entry whose contents to copy
destThe buffer into which to copy the serialized entry
countCopy up to this many bytes; must not be larger than the dest buffer, but may be larger than the entry

Copying with copy() is likely more efficient than an iterator-based copy with std::copy(), since copy() uses one or two memcpy calls instead of copying byte-by-byte.

◆ count()

template<typename K >
size_t pw::containers::internal::KeyedAATree< K >::count ( Key  key)

Returns the number of items in the tree with the given key.

If the tree requires unique keys, this simply 0 or 1.

◆ empty()

template<typename T >
bool pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::empty ( ) const
inline

Returns true if the InlineVarLenEntryQueue is empty, false if it has at least one entry.

◆ end()

template<typename T >
iterator pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::end ( )
inline

Returns an iterator that points past the end of the queue.

◆ equal_range()

template<typename K >
std::pair< GenericAATree::iterator, GenericAATree::iterator > pw::containers::internal::KeyedAATree< K >::equal_range ( Key  key)

Returns a pair of items where the first points to the item with the smallest key that is not less than the given key, and the second points to the item with the smallest key that is greater than the given key.

◆ erase_all()

template<typename K >
size_t pw::containers::internal::KeyedAATree< K >::erase_all ( Key  key)

Removes items that match the given key, and returns an iterator to the item after the removed items and the number of items removed.

◆ erase_one()

iterator pw::containers::internal::GenericAATree::erase_one ( AATreeItem &  item)

Removes an item from the tree and returns an iterator to the item after the removed item.

The items themselves are not destructed.

◆ erase_range()

iterator pw::containers::internal::GenericAATree::erase_range ( AATreeItem &  first,
AATreeItem &  last 
)

Removes the items from first, inclusive, to last, exclusive from the tree and returns an iterator to the item after the last removed item.

The items themselves are not destructed.

◆ find()

template<typename K >
GenericAATree::iterator pw::containers::internal::KeyedAATree< K >::find ( Key  key)

Returns a pointer to an item with the given key, or null if the tree does not contain such an item.

◆ front()

template<typename T >
value_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::front ( )
inline

Returns the first entry in the queue.

Precondition
The queue must NOT empty (empty() is false).

◆ GenericAATree()

constexpr pw::containers::internal::GenericAATree::GenericAATree ( bool  unique_keys)
inlineexplicitconstexpr

Constructs an empty AA tree.

Parameters
unique_keysIndicates if this tree requires unique keys or allows duplicate keys.

◆ Init() [1/2]

template<typename T >
static BasicInlineVarLenEntryQueue & pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::Init ( uint32_t  array[],
size_t  array_size_uint32 
)
inlinestatic

Initializes a InlineVarLenEntryQueue in place in a uint32_t array. The array MUST be larger than

embed:rst:inline :c:macro:`PW_VARIABLE_LENGTH_ENTRY_QUEUE_HEADER_SIZE_UINT32` 

(3) elements.

◆ Init() [2/2]

template<typename T >
template<size_t kArraySize>
static BasicInlineVarLenEntryQueue & pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::Init ( uint32_t(&)  array[kArraySize])
inlinestatic

Initializes a InlineVarLenEntryQueue in place in a uint32_t array. The array MUST be larger than

embed:rst:inline :c:macro:`PW_VARIABLE_LENGTH_ENTRY_QUEUE_HEADER_SIZE_UINT32` 

(3) elements.

◆ insert() [1/2]

template<typename K >
std::pair< GenericAATree::iterator, bool > pw::containers::internal::KeyedAATree< K >::insert ( AATreeItem &  item)

Attempts to add the given item to the tree.

The item will be added if the tree does not already contain an item with the given item's key or if the tree does not require unique keys.

Precondition
The item must not be a part of any tree.
Returns
A pointer to the inserted item and true, or a pointer to the existing item with same key and false.

◆ insert() [2/2]

template<typename K >
template<class Iterator >
void pw::containers::internal::KeyedAATree< K >::insert ( Iterator  first,
Iterator  last 
)

Inserts each item from first, inclusive, to last, exclusive. If the tree does not all duplicates and an equivalent item is already in the tree, the item is ignored.

◆ KeyedAATree()

template<typename K >
constexpr pw::containers::internal::KeyedAATree< K >::KeyedAATree ( bool  unique_keys,
Compare &&  compare,
GetKey &&  get_key 
)
inlineexplicitconstexpr

Constructs an empty AA tree.

Parameters
unique_keysIndicates if this tree requires unique keys or allows duplicate keys.

◆ lower_bound()

template<typename K >
GenericAATree::iterator pw::containers::internal::KeyedAATree< K >::lower_bound ( Key  key)

Returns the item in the tree with the smallest key that is greater than or equal to the given key, or null if the tree is empty.

◆ max_size() [1/2]

template<typename T >
size_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::max_size ( ) const
inline

Returns the maximum number of entries in the queue. This is only attainable if all entries are empty.

◆ max_size() [2/2]

constexpr size_t pw::containers::internal::GenericAATree::max_size ( ) const
inlineconstexprnoexcept

Returns how many items can be added.

As an intrusive container, this is effectively unbounded.

◆ max_size_bytes()

template<typename T >
size_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::max_size_bytes ( ) const
inline

Returns the 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.

◆ merge()

template<typename K >
void pw::containers::internal::KeyedAATree< K >::merge ( KeyedAATree< K > &  other)

Splices items from the other tree into this one.

The receiving tree's Compare and GetKey functions are used when inserting items.

◆ operator=() [1/3]

template<typename ValueType , typename SizeType , size_t kCapacity = containers::internal::kGenericSized>
template<size_t kOtherCapacity>
BasicInlineQueue & pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::operator= ( BasicInlineQueue< ValueType, SizeType, kOtherCapacity > &&  other)
inline

Move assigns from mismatched capacity.

Note that this will result in a crash if kOtherCapacity < size().

◆ operator=() [2/3]

template<typename ValueType , typename SizeType , size_t kCapacity = containers::internal::kGenericSized>
template<size_t kOtherCapacity>
BasicInlineAsyncDeque & pw::BasicInlineAsyncDeque< ValueType, SizeType, kCapacity >::operator= ( const BasicInlineAsyncDeque< ValueType, SizeType, kOtherCapacity > &  other)
inline

Copy assigns for mismatched capacity.

Note that this will result in a crash if kOtherCapacity < size().

◆ operator=() [3/3]

template<typename ValueType , typename SizeType , size_t kCapacity = containers::internal::kGenericSized>
template<size_t kOtherCapacity>
BasicInlineQueue & pw::BasicInlineQueue< ValueType, SizeType, kCapacity >::operator= ( const BasicInlineQueue< ValueType, SizeType, kOtherCapacity > &  other)
inline

Copy assigns from mismatched capacity.

Note that this will result in a crash if kOtherCapacity < size().

◆ pop()

template<typename T >
void pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::pop ( )
inline

Removes the first entry from queue.

Precondition
The queue MUST have at least one entry.

◆ push()

template<typename T >
void pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::push ( span< const T >  value)
inline

Appends an entry to the end of the queue.

Precondition
The entry MUST NOT be larger than max_size_bytes().
There must be sufficient space in the queue for this entry.

◆ push_overwrite()

template<typename T >
void pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::push_overwrite ( span< const T >  value)
inline

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.

Precondition
The entry MUST NOT be larger than max_size_bytes().

◆ raw_storage()

template<typename T >
span< const T > pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::raw_storage ( ) const
inline

Underlying storage of the variable-length entry queue. May be used to memcpy the queue.

◆ size()

template<typename T >
size_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::size ( ) const
inline

Returns the number of variable-length entries in the queue. This is O(n) in the number of entries in the queue.

◆ size_bytes()

template<typename T >
size_type pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::size_bytes ( ) const
inline

Returns the combined size in bytes of all entries in the queue, excluding metadata. This is O(n) in the number of entries in the queue.

◆ try_push()

template<typename T >
bool pw::BasicInlineVarLenEntryQueue< T, containers::internal::kGenericSized >::try_push ( span< const T >  value)
inline

Appends an entry to the end of the queue, but only if there is sufficient space for it.

Returns
true if the data was added to the queue; false if it did not fit
Precondition
The entry MUST NOT be larger than max_size_bytes().

◆ upper_bound()

template<typename K >
GenericAATree::iterator pw::containers::internal::KeyedAATree< K >::upper_bound ( Key  key)

Returns the item in the tree with the smallest key that is strictly greater than the given key, or null if the tree is empty.