Skip to main content

AnalogDataStorageCache

AnalogDataStorageCache

Cache structure for fast-path access to contiguous analog storage. More…

#include <AnalogDataStorageCache.hpp>

Public Functions

Name
bool isValid() const
Check if the cache is valid for fast-path access.
float const & getValue(std::size_t idx) const
Convenience accessor for cached data.

Public Attributes

Name
float const * data_ptr
std::size_t cache_size
bool is_contiguous

Detailed Description

struct AnalogDataStorageCache;

Cache structure for fast-path access to contiguous analog storage.

Analog samples are stored as contiguous float values when possible. This cache exposes a raw pointer and size for zero-overhead iteration when the underlying storage is contiguous. For non-contiguous backends (lazy views, strided mmap), the cache is marked invalid and callers must fall back to virtual dispatch.

Public Functions Documentation

function isValid

inline bool isValid() const

Check if the cache is valid for fast-path access.

Return:

  • true if underlying storage is contiguous and data_ptr is non-null.
  • false otherwise.

function getValue

inline float const & getValue(
    std::size_t idx
) const

Convenience accessor for cached data.

Parameters:

  • idx Index into the cached data in [0, cache_size).

Return: const reference to the value at the given index.

Public Attributes Documentation

variable data_ptr

float const  * data_ptr = nullptr;

variable cache_size

std::size_t cache_size = 0;

variable is_contiguous

bool is_contiguous = false;

Updated on 2026-11-13 at 20:25:39 +0000