C/C++ API Reference
Loading...
Searching...
No Matches
pw::FixedDeque< T, kInlineCapacity, S > Class Template Referencefinal

Overview

template<typename T, size_t kInlineCapacity = containers::kExternalStorage, typename S = typename Deque<T>::size_type>
class pw::FixedDeque< T, kInlineCapacity, S >

FixedDeque is a Deque that owns its statically allocated buffer.

This FixedDeque statically allocates its storage buffer internally. Similar to InlineDeque, the capacity is specified as a template parameter. Unlike InlineDeque, FixedDeque is usable as a generic Deque.

If the capacity is omitted (or set to containers::kExternalStorage), the external storage specialization is used. Whether statically or dynamically allocated, the capacity never changes.

Template Parameters
TWhat is stored in the deque.
SSize type. A smaller size type limits the maximum number of items, but requires slightly less memory.
Inheritance diagram for pw::FixedDeque< T, kInlineCapacity, S >:
pw::containers::StorageBase< kAlignment, kSizeBytes > pw::Deque< T, SizeType >

Public Member Functions

constexpr FixedDeque ()
 
 FixedDeque (const FixedDeque &)=delete
 
FixedDequeoperator= (const FixedDeque &)=delete
 
constexpr FixedDeque (FixedDeque &&other) noexcept
 
constexpr FixedDequeoperator= (FixedDeque &&other) noexcept
 
template<size_t kOtherCapacity>
 MoveItemsFrom (other)
 
template<size_t kOtherCapacity>
 clear ()
 
this MoveItemsFrom (other)
 
template<size_t kOtherCapacity>
void swap (FixedDeque< T, kOtherCapacity, S > &other)
 
constexpr Deallocatordeallocator () const
 Returns nullptr; a FixedDeque with static storage never allocates.
 
- Public Member Functions inherited from pw::Deque< T, SizeType >
constexpr Deque (span< std::byte > unaligned_buffer) noexcept
 
template<size_t kAlignment, size_t kSizeBytes>
constexpr Deque (containers::Storage< kAlignment, kSizeBytes > &buffer) noexcept
 
 Deque (const Deque &)=delete
 Copying is not supported since it can fail.
 
Dequeoperator= (const Deque &)=delete
 
 Deque (Deque &&)=delete
 Move is not supported to avoid confusion about deque/buffer pairings.
 
Dequeoperator= (Deque &&)=delete
 
constexpr size_type max_size () const noexcept
 

Public Attributes

return * this
 

Additional Inherited Members

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

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