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

Overview

Generic collections of objects for embedded devices.

Main docs: Home | Lists | Maps | Queues | Sets | Vectors | Utilities | Using items with multiple containers

Submodules

 C API
 
 Lists
 
 Maps
 
 Queues
 
 Sets
 
 Utilities
 
 Vectors
 

Namespaces

namespace  pw
 The Pigweed namespace.
 

Classes

class  pw::containers::internal::BasicInlineQueueImpl< Derived, Deque >
 
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_VARIABLE_LENGTH_ENTRY_QUEUE_HEADER_SIZE_UINT32   (3)
 
#define _PW_VAR_QUEUE_SIZE_UINT32(max_size_bytes)
 
#define _PW_VAR_QUEUE_CHECK_SIZE(max_size_bytes)
 

Typedefs

using pw::DynamicPtrVector< T, SizeType >::value_type = T
 
using pw::DynamicPtrVector< T, SizeType >::size_type = SizeType
 
using pw::DynamicPtrVector< T, SizeType >::difference_type = std::ptrdiff_t
 
using pw::DynamicPtrVector< T, SizeType >::reference = value_type &
 
using pw::DynamicPtrVector< T, SizeType >::const_reference = const value_type &
 
using pw::DynamicPtrVector< T, SizeType >::pointer = value_type *
 
using pw::DynamicPtrVector< T, SizeType >::const_pointer = const value_type *
 
using pw::DynamicPtrVector< T, SizeType >::allocator_type = Allocator
 
using pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::iterator_category = std::random_access_iterator_tag
 
using pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::value_type = T
 
using pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::difference_type = std::ptrdiff_t
 
using pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::pointer = std::conditional_t< kIsConst, const T *, T * >
 
using pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::reference = std::conditional_t< kIsConst, const T &, T & >
 
using pw::DynamicPtrVector< T, SizeType >::iterator = Iterator< false >
 
using pw::DynamicPtrVector< T, SizeType >::const_iterator = Iterator< true >
 
using pw::DynamicPtrVector< T, SizeType >::reverse_iterator = std::reverse_iterator< iterator >
 
using pw::DynamicPtrVector< T, SizeType >::const_reverse_iterator = std::reverse_iterator< const_iterator >
 
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::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

template<bool kOtherConst, typename = std::enable_if_t<kIsConst && !kOtherConst>>
constexpr pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::Iterator (const Iterator< kOtherConst > &other)
 
reference pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator* () const
 
pointer pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator-> () const
 
Iterator & pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator++ ()
 
Iterator pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator++ (int)
 
Iterator & pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator-- ()
 
Iterator pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator-- (int)
 
Iterator & pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator+= (difference_type n)
 
Iterator & pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator-= (difference_type n)
 
reference pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator[] (difference_type n) const
 
constexpr pw::DynamicPtrVector< T, SizeType >::DynamicPtrVector (Allocator &allocator)
 Constructs an empty DynamicPtrVector using the provided allocator.
 
 pw::DynamicPtrVector< T, SizeType >::DynamicPtrVector (const DynamicPtrVector &)=delete
 
DynamicPtrVectorpw::DynamicPtrVector< T, SizeType >::operator= (const DynamicPtrVector &)=delete
 
 pw::DynamicPtrVector< T, SizeType >::DynamicPtrVector (DynamicPtrVector &&other) noexcept=default
 
DynamicPtrVectorpw::DynamicPtrVector< T, SizeType >::operator= (DynamicPtrVector &&other) noexcept
 
iterator pw::DynamicPtrVector< T, SizeType >::begin ()
 
const_iterator pw::DynamicPtrVector< T, SizeType >::begin () const
 
const_iterator pw::DynamicPtrVector< T, SizeType >::cbegin () const
 
iterator pw::DynamicPtrVector< T, SizeType >::end ()
 
const_iterator pw::DynamicPtrVector< T, SizeType >::end () const
 
const_iterator pw::DynamicPtrVector< T, SizeType >::cend () const
 
reverse_iterator pw::DynamicPtrVector< T, SizeType >::rbegin ()
 
const_reverse_iterator pw::DynamicPtrVector< T, SizeType >::rbegin () const
 
const_reverse_iterator pw::DynamicPtrVector< T, SizeType >::crbegin () const
 
reverse_iterator pw::DynamicPtrVector< T, SizeType >::rend ()
 
const_reverse_iterator pw::DynamicPtrVector< T, SizeType >::rend () const
 
const_reverse_iterator pw::DynamicPtrVector< T, SizeType >::crend () const
 
allocator_typepw::DynamicPtrVector< T, SizeType >::get_allocator () const
 
bool pw::DynamicPtrVector< T, SizeType >::empty () const
 
size_type pw::DynamicPtrVector< T, SizeType >::size () const
 
size_type pw::DynamicPtrVector< T, SizeType >::ptr_capacity () const
 
size_type pw::DynamicPtrVector< T, SizeType >::max_size () const
 
void pw::DynamicPtrVector< T, SizeType >::reserve_ptr (size_type new_capacity)
 
void pw::DynamicPtrVector< T, SizeType >::reserve_ptr_exact (size_type new_capacity)
 
bool pw::DynamicPtrVector< T, SizeType >::try_reserve_ptr (size_type new_capacity)
 
bool pw::DynamicPtrVector< T, SizeType >::try_reserve_ptr_exact (size_type new_capacity)
 
void pw::DynamicPtrVector< T, SizeType >::shrink_to_fit ()
 
reference pw::DynamicPtrVector< T, SizeType >::operator[] (size_type pos)
 
const_reference pw::DynamicPtrVector< T, SizeType >::operator[] (size_type pos) const
 
reference pw::DynamicPtrVector< T, SizeType >::at (size_type pos)
 
const_reference pw::DynamicPtrVector< T, SizeType >::at (size_type pos) const
 
reference pw::DynamicPtrVector< T, SizeType >::front ()
 
const_reference pw::DynamicPtrVector< T, SizeType >::front () const
 
reference pw::DynamicPtrVector< T, SizeType >::back ()
 
const_reference pw::DynamicPtrVector< T, SizeType >::back () const
 
T *const * pw::DynamicPtrVector< T, SizeType >::data ()
 
const T *const * pw::DynamicPtrVector< T, SizeType >::data () const
 
void pw::DynamicPtrVector< T, SizeType >::push_back (const T &value)
 Appends a new element by copying value.
 
void pw::DynamicPtrVector< T, SizeType >::push_back (T &&value)
 Appends a new element by moving value.
 
bool pw::DynamicPtrVector< T, SizeType >::try_push_back (const T &value)
 Attempts to append a new element by copying value.
 
void pw::DynamicPtrVector< T, SizeType >::push_back (UniquePtr< T > &&value)
 
void pw::DynamicPtrVector< T, SizeType >::pop_back ()
 
pw::UniquePtr< T > pw::DynamicPtrVector< T, SizeType >::take (const_iterator pos)
 Removes the element at pos and returns it as a UniquePtr.
 
template<typename U = T, typename... Args>
void pw::DynamicPtrVector< T, SizeType >::emplace_back (Args &&... args)
 
template<typename U = T, typename... Args>
bool pw::DynamicPtrVector< T, SizeType >::try_emplace_back (Args &&... args)
 
template<typename U = T, typename... Args>
iterator pw::DynamicPtrVector< T, SizeType >::emplace (const_iterator pos, Args &&... args)
 
template<typename U = T, typename... Args>
std::optional< iterator > pw::DynamicPtrVector< T, SizeType >::try_emplace (const_iterator pos, Args &&... args)
 
iterator pw::DynamicPtrVector< T, SizeType >::insert (const_iterator pos, const T &value)
 
iterator pw::DynamicPtrVector< T, SizeType >::insert (const_iterator pos, T &&value)
 
iterator pw::DynamicPtrVector< T, SizeType >::insert (const_iterator pos, UniquePtr< T > &&value)
 
std::optional< iterator > pw::DynamicPtrVector< T, SizeType >::try_insert (const_iterator pos, const T &value)
 
iterator pw::DynamicPtrVector< T, SizeType >::erase (const_iterator pos)
 
iterator pw::DynamicPtrVector< T, SizeType >::erase (const_iterator first, const_iterator last)
 
void pw::DynamicPtrVector< T, SizeType >::clear ()
 
void pw::DynamicPtrVector< T, SizeType >::swap (DynamicPtrVector &other)
 Swaps the contents of this DynamicPtrVector with another one.
 
void pw::DynamicPtrVector< T, SizeType >::swap (size_type first, size_type second)
 
void pw::DynamicPtrVector< T, SizeType >::swap (const_iterator first, const_iterator second)
 
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
 
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)
 
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)
 
iterator pw::containers::internal::GenericAATree::erase_range (iterator first, iterator 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

GetKey pw::containers::internal::AATree< K, V >::get_key_
 

Friends

class pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::DynamicPtrVector
 
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 >
class pw::containers::internal::GenericAATree::KeyedAATree
 
template<typename , typename , bool >
struct pw::containers::internal::AATree< K, V >::Item::IntrusiveItem
 
Iterator pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator+ (Iterator it, difference_type n)
 
Iterator pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator+ (difference_type n, Iterator it)
 
Iterator pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator- (Iterator it, difference_type n)
 
difference_type pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator- (Iterator lhs, Iterator rhs)
 
bool pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator== (Iterator lhs, Iterator rhs)
 
bool pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator!= (Iterator lhs, Iterator rhs)
 
bool pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator< (Iterator lhs, Iterator rhs)
 
bool pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator<= (Iterator lhs, Iterator rhs)
 
bool pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator> (Iterator lhs, Iterator rhs)
 
bool pw::DynamicPtrVector< T, SizeType >::Iterator< kIsConst >::operator>= (Iterator lhs, Iterator rhs)
 

Macro Definition Documentation

◆ _PW_VAR_QUEUE_CHECK_SIZE

#define _PW_VAR_QUEUE_CHECK_SIZE (   max_size_bytes)
Value:
static_assert(sizeof(pw::InlineVarLenEntryQueue<max_size_bytes>) == \
_PW_VAR_QUEUE_SIZE_UINT32(max_size_bytes) * sizeof(uint32_t));
Definition: inline_var_len_entry_queue.h:94

◆ _PW_VAR_QUEUE_SIZE_UINT32

#define _PW_VAR_QUEUE_SIZE_UINT32 (   max_size_bytes)
Value:
((PW_VAR_QUEUE_DATA_SIZE_BYTES(max_size_bytes) + 3 /* round up */) / 4))
#define PW_VARIABLE_LENGTH_ENTRY_QUEUE_HEADER_SIZE_UINT32
Definition: inline_var_len_entry_queue.h:77

◆ PW_VARIABLE_LENGTH_ENTRY_QUEUE_HEADER_SIZE_UINT32

#define PW_VARIABLE_LENGTH_ENTRY_QUEUE_HEADER_SIZE_UINT32   (3)

The size of the InlineVarLenEntryQueue header, in uint32_t elements. This header stores the buffer length and head and tail offsets.

The underlying uint32_t array of a InlineVarLenEntryQueue must be larger than this size.

Typedef Documentation

◆ 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.

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.

◆ 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().

◆ clear()

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

Removes all items from the tree and leaves it empty.

The items themselves are not destructed.

◆ 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.

◆ data()

template<typename T , typename SizeType = uint16_t>
T *const * pw::DynamicPtrVector< T, SizeType >::data ( )
inline

Returns a pointer to the underlying array of pointers. Note: This returns T**, not T*.

◆ emplace()

template<typename T , typename SizeType = uint16_t>
template<typename U = T, typename... Args>
iterator pw::DynamicPtrVector< T, SizeType >::emplace ( const_iterator  pos,
Args &&...  args 
)
inline

Constructs an element in-place at the specified position.

This function constructs an object of type U (which defaults to T) using the provided arguments and the vector's allocator. The object is stored as a pointer in the vector.

To construct a derived class object, specify the type as a template argument: vec.emplace<Derived>(pos, args...). The derived class must be trivially destructible or the base must have a virtual destructor.

◆ emplace_back()

template<typename T , typename SizeType = uint16_t>
template<typename U = T, typename... Args>
void pw::DynamicPtrVector< T, SizeType >::emplace_back ( Args &&...  args)
inline

Constructs an element in-place at the end of the vector.

This function constructs an object of type U (which defaults to T) using the provided arguments and the vector's allocator. The object is stored as a pointer in the vector.

To construct a derived class object, specify the type as a template argument: vec.emplace_back<Derived>(args...). The derived class must be trivially destructible or the base must have a virtual destructor.

◆ 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() [1/2]

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.

◆ erase_range() [2/2]

iterator pw::containers::internal::GenericAATree::erase_range ( iterator  first,
iterator  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.

◆ 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.

◆ insert() [1/3]

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/3]

template<typename T , typename SizeType = uint16_t>
iterator pw::DynamicPtrVector< T, SizeType >::insert ( const_iterator  pos,
UniquePtr< T > &&  value 
)
inline

Inserts a new element by taking ownership of the object in value.

If value was allocated using this vector's allocator, the pointer is transferred directly without reallocation. Otherwise, a new object is move-constructed from *value.

◆ insert() [3/3]

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()

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.

◆ 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/2]

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/2]

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().

◆ push_back()

template<typename T , typename SizeType = uint16_t>
void pw::DynamicPtrVector< T, SizeType >::push_back ( UniquePtr< T > &&  value)
inline

Appends a new element by taking ownership of the object in value.

If value was allocated using this vector's allocator, the pointer is transferred directly without reallocation. Otherwise, a new object is move-constructed from *value.

◆ reserve_ptr()

template<typename T , typename SizeType = uint16_t>
void pw::DynamicPtrVector< T, SizeType >::reserve_ptr ( size_type  new_capacity)
inline

Reserves slots in the pointer vector. Does NOT guarantee that future operations that add items will succeed, since they require separate allocations for the objects themselves.

◆ reserve_ptr_exact()

template<typename T , typename SizeType = uint16_t>
void pw::DynamicPtrVector< T, SizeType >::reserve_ptr_exact ( size_type  new_capacity)
inline

Reserves slots in the pointer vector. Does NOT guarantee that future operations that add items will succeed, since they require separate allocations for the objects themselves.

◆ swap() [1/2]

template<typename T , typename SizeType = uint16_t>
void pw::DynamicPtrVector< T, SizeType >::swap ( const_iterator  first,
const_iterator  second 
)
inline

Swaps two items within this vector. This is a trivial swap of two pointers; no move assignments or allocations occur.

◆ swap() [2/2]

template<typename T , typename SizeType = uint16_t>
void pw::DynamicPtrVector< T, SizeType >::swap ( size_type  first,
size_type  second 
)
inline

Swaps two indices within this vector. This is a trivial swap of two pointers; no move assignments or allocations occur.

◆ try_emplace()

template<typename T , typename SizeType = uint16_t>
template<typename U = T, typename... Args>
std::optional< iterator > pw::DynamicPtrVector< T, SizeType >::try_emplace ( const_iterator  pos,
Args &&...  args 
)
inline

Attempts to construct an element in-place at the specified position, as in DynamicPtrVector<T>::emplace.

Return values
iteratorto the new element if successful,
std::nulloptAllocation for either the item or the vector capacity failed.

◆ try_emplace_back()

template<typename T , typename SizeType = uint16_t>
template<typename U = T, typename... Args>
bool pw::DynamicPtrVector< T, SizeType >::try_emplace_back ( Args &&...  args)
inline

Attempts to construct an element in-place at the end of the vector, as in DynamicPtrVector<T>::emplace_back.

Return values
trueThe item was successfully allocated and added to the vector.
falseAllocation for either the item or the vector capacity failed.

◆ try_reserve_ptr()

template<typename T , typename SizeType = uint16_t>
bool pw::DynamicPtrVector< T, SizeType >::try_reserve_ptr ( size_type  new_capacity)
inline

Attempts to reserve slots in the pointer vector. Does NOT guarantee that future operations that add items will succeed, since they require separate allocations for the objects themselves.

◆ try_reserve_ptr_exact()

template<typename T , typename SizeType = uint16_t>
bool pw::DynamicPtrVector< T, SizeType >::try_reserve_ptr_exact ( size_type  new_capacity)
inline

Attempts to reserve slots in the pointer vector. Does NOT guarantee that future operations that add items will succeed, since they require separate allocations for the objects themselves.

◆ 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.