MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Memory::FixedStorage< T, Capacity > Struct Template Reference

Compile-time fixed-capacity storage using std::array. More...

#include <RingBuffer.hpp>

+ Collaboration diagram for MayaFlux::Memory::FixedStorage< T, Capacity >:

Public Types

using storage_type = std::array< T, Capacity >
 

Public Member Functions

constexpr size_t capacity () const noexcept
 

Public Attributes

storage_type buffer {}
 

Static Public Attributes

static constexpr size_t capacity_value = Capacity
 
static constexpr bool is_resizable = false
 

Detailed Description

template<typename T, size_t Capacity>
struct MayaFlux::Memory::FixedStorage< T, Capacity >

Compile-time fixed-capacity storage using std::array.

Provides zero-overhead compile-time buffer allocation with capacity known at compile time. Required for lock-free contexts and real-time audio processing where dynamic allocation is forbidden.

Capacity must be a power of 2 for efficient modulo operations using bitwise AND instead of division.

Template Parameters
TElement type
CapacityBuffer size (must be power of 2)

Memory Layout:

  • Stack-allocated std::array<T, Capacity>
  • Zero initialization overhead
  • Cache-friendly contiguous memory

Use Cases:

  • Lock-free queues for input events
  • Real-time logging buffers
  • Fixed-size delay lines
  • MIDI message queues
// 4096-element lock-free queue for input events
using InputQueue = RingBuffer<InputValue,
Policy-driven unified circular buffer implementation.
Compile-time fixed-capacity storage using std::array.
Lock-free SPSC (Single Producer Single Consumer) concurrency.
FIFO queue semantics (oldest data first)

Definition at line 49 of file RingBuffer.hpp.


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