C/C++ API Reference
Loading...
Searching...
No Matches
pw::containers::internal::GenericDeque< Derived, ValueType, CountAndCapacityType > Class Template Reference

Overview

template<typename Derived, typename ValueType, typename CountAndCapacityType>
class pw::containers::internal::GenericDeque< Derived, ValueType, CountAndCapacityType >

Generic array-based deque class.

Uses CRTP to access the underlying array and handle potentially resizing it. Extended by pw::InlineDeque and pw::DynamicDeque.

Inheritance diagram for pw::containers::internal::GenericDeque< Derived, ValueType, CountAndCapacityType >:
pw::containers::internal::GenericDequeBase< CountAndCapacityType > pw::DynamicDeque< T, uint16_t > pw::DynamicDeque< T, size_type > pw::DynamicDeque< Packet > pw::DynamicDeque< Packet, size_type > pw::DynamicDeque< ValueType, SizeType >

Public Types

using value_type = ValueType
 
using size_type = typename CountAndCapacityType::size_type
 
using difference_type = ptrdiff_t
 
using reference = value_type &
 
using const_reference = const value_type &
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using iterator = containers::internal::DequeIterator< Derived >
 
using const_iterator = containers::internal::DequeIterator< const Derived >
 
- Public Types inherited from pw::containers::internal::GenericDequeBase< CountAndCapacityType >
using size_type = typename CountAndCapacityType::size_type
 

Public Member Functions

 GenericDeque (const GenericDeque &)=delete
 
 GenericDeque (GenericDeque &&)=delete
 
GenericDequeoperator= (const GenericDeque &)=delete
 
GenericDeque && operator= (GenericDeque &&)=delete
 
void assign (size_type count, const value_type &value)
 Sets the contents to count copies of value. Crashes if cannot fit.
 
template<typename It , int & ..., typename = containers::internal::EnableIfInputIterator<It>>
void assign (It start, It finish)
 
void assign (const std::initializer_list< value_type > &list)
 Sets contents to copies of the items from the list. Crashes if cannot fit.
 
constexpr reference at (size_type index)
 
constexpr const_reference at (size_type index) const
 
constexpr reference operator[] (size_type index)
 
constexpr const_reference operator[] (size_type index) const
 
constexpr reference front ()
 
constexpr const_reference front () const
 
constexpr reference back ()
 
constexpr const_reference back () const
 
constexpr std::pair< span< const value_type >, span< const value_type > > contiguous_data () const
 Provides access to the valid data in a contiguous form.
 
constexpr std::pair< span< value_type >, span< value_type > > contiguous_data ()
 
constexpr iterator begin () noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr iterator end () noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_iterator cend () const noexcept
 
void clear ()
 
iterator erase (const_iterator pos)
 Erases the item at pos, which must be a dereferenceable iterator.
 
iterator erase (const_iterator first, const_iterator last)
 
void push_back (const value_type &value)
 
void push_back (value_type &&value)
 
template<typename... Args>
void emplace_back (Args &&... args)
 
void pop_back ()
 
void push_front (const value_type &value)
 
void push_front (value_type &&value)
 
template<typename... Args>
void emplace_front (Args &&... args)
 
void pop_front ()
 
template<typename... Args>
iterator emplace (const_iterator pos, Args &&... args)
 
iterator insert (const_iterator pos, const value_type &value)
 
iterator insert (const_iterator pos, value_type &&value)
 
iterator insert (const_iterator pos, size_type count, const value_type &value)
 
template<typename InputIt , typename = containers::internal::EnableIfInputIterator<InputIt>>
iterator insert (const_iterator pos, InputIt first, InputIt last)
 
iterator insert (const_iterator pos, std::initializer_list< value_type > ilist)
 
void resize (size_type new_size)
 
void resize (size_type new_size, const value_type &value)
 
template<typename... Args>
std::optional< typename GenericDeque< Derived, ValueType, CountAndCapacityType >::iterator > try_emplace (const_iterator pos, Args &&... args)
 
template<typename ForwardIt , typename >
std::optional< typename GenericDeque< Derived, ValueType, CountAndCapacityType >::iterator > try_insert (const_iterator pos, ForwardIt first, ForwardIt last)
 
template<typename... Args>
std::optional< typename GenericDeque< Derived, ValueType, CountAndCapacityType >::iterator > try_emplace_shift_right (const_iterator pos, Args &&... args)
 
template<typename ForwardIt , typename >
std::optional< typename GenericDeque< Derived, ValueType, CountAndCapacityType >::iterator > try_insert_shift_right (const_iterator pos, ForwardIt first, ForwardIt last)
 
constexpr size_type capacity () const noexcept
 Returns the maximum number of elements in the deque.
 
constexpr bool empty () const noexcept
 
constexpr size_type size () const noexcept
 Returns the number of elements in the deque.
 
- Public Member Functions inherited from pw::containers::internal::GenericDequeBase< CountAndCapacityType >
constexpr bool empty () const noexcept
 
constexpr size_type size () const noexcept
 Returns the number of elements in the deque.
 
constexpr size_type capacity () const noexcept
 Returns the maximum number of elements in the deque.
 

Protected Member Functions

constexpr GenericDeque (size_type initial_capacity) noexcept
 
Derived & operator= (const std::initializer_list< value_type > &list)
 
template<typename T , typename = containers::internal::EnableIfIterable<T>>
Derived & operator= (const T &other)
 
bool try_assign (size_type count, const value_type &value)
 
template<typename It , int & ..., typename = containers::internal::EnableIfForwardIterator<It>>
bool try_assign (It start, It finish)
 
bool try_assign (const std::initializer_list< value_type > &list)
 
template<typename... Args>
std::optional< iterator > try_emplace (const_iterator pos, Args &&... args)
 
std::optional< iterator > try_insert (const_iterator pos, const value_type &value)
 
std::optional< iterator > try_insert (const_iterator pos, value_type &&value)
 
std::optional< iterator > try_insert (const_iterator pos, size_type count, const value_type &value)
 
template<typename ForwardIt , typename = containers::internal::EnableIfForwardIterator<ForwardIt>>
std::optional< iterator > try_insert (const_iterator pos, ForwardIt first, ForwardIt last)
 
std::optional< iterator > try_insert (const_iterator pos, std::initializer_list< value_type > ilist)
 
bool try_push_back (const value_type &value)
 
bool try_push_back (value_type &&value)
 
template<typename... Args>
bool try_emplace_back (Args &&... args)
 
bool try_push_front (const value_type &value)
 
bool try_push_front (value_type &&value)
 
template<typename... Args>
bool try_emplace_front (Args &&... args)
 
bool try_resize (size_type new_size)
 
bool try_resize (size_type new_size, const value_type &value)
 
template<typename... Args>
std::optional< iterator > try_emplace_shift_right (const_iterator pos, Args &&... args)
 
std::optional< iterator > try_insert_shift_right (const_iterator pos, size_type count, const value_type &value)
 
template<typename ForwardIt , typename = containers::internal::EnableIfForwardIterator<ForwardIt>>
std::optional< iterator > try_insert_shift_right (const_iterator pos, ForwardIt first, ForwardIt last)
 
- Protected Member Functions inherited from pw::containers::internal::GenericDequeBase< CountAndCapacityType >
CountAndCapacityType & count_and_capacity () noexcept
 
constexpr void MoveAssignIndices (GenericDequeBase &other) noexcept
 
void SwapIndices (GenericDequeBase &other) noexcept
 
bool CanExtendBuffer () const
 
bool CanShrinkBuffer () const
 
void HandleNewBuffer (size_type new_capacity)
 
void HandleExtendedBuffer (size_type new_capacity)
 
void HandleShrunkBuffer (size_type new_capacity)
 

The documentation for this class was generated from the following file: