Pixie
Loading...
Searching...
No Matches
pixie::experimental::PowerOfTwoPermutableSequence< T, Values, Fanout, ReservedNodes, CacheRegularPrefix, PermutedLeaves > Class Template Reference

Experimental owning packed sequence with power-of-two leaf capacity. More...

#include <power_of_two_sequence.h>

Inheritance diagram for pixie::experimental::PowerOfTwoPermutableSequence< T, Values, Fanout, ReservedNodes, CacheRegularPrefix, PermutedLeaves >:
pixie::PermutableSequenceBase< PowerOfTwoPermutableSequence< std::uint64_t, 256, 32, 0, false, false >, std::uint64_t, std::uint64_t >

Public Member Functions

 PowerOfTwoPermutableSequence () noexcept=default
 Construct canonical empty without allocating.
 
 PowerOfTwoPermutableSequence (const PowerOfTwoPermutableSequence &)=delete
 Exclusive owners cannot be copied.
 
PowerOfTwoPermutableSequence & operator= (const PowerOfTwoPermutableSequence &)=delete
 Exclusive owners cannot be copy-assigned.
 
 PowerOfTwoPermutableSequence (PowerOfTwoPermutableSequence &&) noexcept=default
 Transfer ownership, leaving the source canonical empty.
 
PowerOfTwoPermutableSequence & operator= (PowerOfTwoPermutableSequence &&) noexcept=default
 Replace ownership; self-move is a no-op, source becomes empty.
 
auto memory_usage () const noexcept
 Account for this object and all live requested tree storage.
 
- Public Member Functions inherited from pixie::PermutableSequenceBase< PowerOfTwoPermutableSequence< std::uint64_t, 256, 32, 0, false, false >, std::uint64_t, std::uint64_t >
size_type size () const noexcept
 Return the logical element count.
 
bool empty () const noexcept
 Test emptiness.
 
const_reference operator[] (size_type position) const
 Read a checked zero-based element without exposing mutation.
 
void insert_at (size_type position, std::uint64_t value)
 Insert one value at a zero-based position.
 
void rotate_left (size_type left, size_type right, size_type distance)
 Rotate [left,right) left while preserving outside values.
 
void merge (PowerOfTwoPermutableSequence< std::uint64_t, 256, 32, 0, false, false > &donor)
 Append unchanged donor values and consume donor ownership.
 
size_type memory_usage_bytes () const noexcept
 Explicitly account for requested live storage.
 

Static Public Attributes

static constexpr std::size_t regular_cache_bytes
 Extra owner bytes used by the optional regular-prefix cache.
 
static constexpr ElementStorage storage = ElementStorage::packed
 Resolved storage strategy; elements are packed and read by value.
 

Friends

class PermutableSequenceBase< PowerOfTwoPermutableSequence, T, T >
 

Additional Inherited Members

- Public Types inherited from pixie::PermutableSequenceBase< PowerOfTwoPermutableSequence< std::uint64_t, 256, 32, 0, false, false >, std::uint64_t, std::uint64_t >
using value_type
 Stored element type.
 
using const_reference
 Immutable result type.
 
using size_type
 Count and position type.
 
- Static Public Member Functions inherited from pixie::PermutableSequenceBase< PowerOfTwoPermutableSequence< std::uint64_t, 256, 32, 0, false, false >, std::uint64_t, std::uint64_t >
static PowerOfTwoPermutableSequence< std::uint64_t, 256, 32, 0, false, false > from_range (Range &&range)
 Consume a possibly single-pass input range into an owning sequence.
 

Detailed Description

template<class T = std::uint64_t, std::size_t Values = 256, std::size_t Fanout = 32, std::size_t ReservedNodes = 0, bool CacheRegularPrefix = false, bool PermutedLeaves = false>
class pixie::experimental::PowerOfTwoPermutableSequence< T, Values, Fanout, ReservedNodes, CacheRegularPrefix, PermutedLeaves >

Experimental owning packed sequence with power-of-two leaf capacity.

Implements PermutableSequenceBase with immutable by-value reads, exclusive ownership, unchanged-value consuming merge, and checked half-open rotations. Uses the same split/join engine as PermutableSequence, with experimental leaf capacity, reserve, and navigation policies. Metadata and alignment padding are additional to the Values*sizeof(T) leaf payload. No contiguous storage or stable reference is promised. Construction consumes input through iter_move; source references are not retained. Mutation allocation failure leaves owners unchanged.

Template Parameters
TUnsigned integral type with at most 64 value bits.
ValuesPower-of-two leaf capacity; payload must be word-sized.
FanoutEven branching factor, at least four.
ReservedNodesMaximum idle internal nodes retained after rotations. Zero disables retention. At >=1 MiB of logical value storage, successful rotations retain up to this many unused nodes for subsequent rotations. Retained bytes are owned, bounded, and included in memory_usage().
CacheRegularPrefixCache the leading regular-region size in one owner word, refreshed after each successful mutation. Requires power-of-two fanout. Pure radix reads in that region avoid loading root size metadata.
PermutedLeavesMap children through a slot permutation immediately above leaves; requires Fanout == 16, 32, 64, or 256. Fanout 16 uses packed nibbles, 32/64 use byte indices with primitive-local SIMD dispatch, and 256 uses one node containing sixteen groups of sixteen child slots. Higher levels retain direct addressing. Fresh/repacked nodes also address children directly until their first mapped rotation constructs the policy state without allocation. All internal allocations reserve space for ordering state so the existing allocation pool can recycle nodes between levels.

Member Function Documentation

◆ memory_usage()

template<class T = std::uint64_t, std::size_t Values = 256, std::size_t Fanout = 32, std::size_t ReservedNodes = 0, bool CacheRegularPrefix = false, bool PermutedLeaves = false>
auto pixie::experimental::PowerOfTwoPermutableSequence< T, Values, Fanout, ReservedNodes, CacheRegularPrefix, PermutedLeaves >::memory_usage ( ) const
inlinenoexcept

Account for this object and all live requested tree storage.

Includes unused leaf/node capacity and alignment padding; excludes allocator bookkeeping. Traverses the tree without allocating or throwing.

Returns
Tree memory breakdown, with total_bytes including this owner.

Member Data Documentation

◆ regular_cache_bytes

template<class T = std::uint64_t, std::size_t Values = 256, std::size_t Fanout = 32, std::size_t ReservedNodes = 0, bool CacheRegularPrefix = false, bool PermutedLeaves = false>
std::size_t pixie::experimental::PowerOfTwoPermutableSequence< T, Values, Fanout, ReservedNodes, CacheRegularPrefix, PermutedLeaves >::regular_cache_bytes
staticconstexpr
Initial value:
=
CacheRegularPrefix ? sizeof(std::size_t) : 0

Extra owner bytes used by the optional regular-prefix cache.


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