Skip to main content

MemoryMappedAnalogDataStorage

MemoryMappedAnalogDataStorage

Memory-mapped file analog data storage using CRTP. More…

#include <MemoryMappedAnalogDataStorage.hpp>

Inherits from AnalogDataStorageBase< MemoryMappedAnalogDataStorage >

Public Functions

Name
MemoryMappedAnalogDataStorage(MmapStorageConfig config)
Construct memory-mapped storage from configuration.
~MemoryMappedAnalogDataStorage()
Destructor - unmaps file and releases resources.
MemoryMappedAnalogDataStorage(MemoryMappedAnalogDataStorage const & ) =delete
MemoryMappedAnalogDataStorage & operator=(MemoryMappedAnalogDataStorage const & ) =delete
MemoryMappedAnalogDataStorage(MemoryMappedAnalogDataStorage && other)
MemoryMappedAnalogDataStorage & operator=(MemoryMappedAnalogDataStorage && other)
float getValueAtImpl(std::size_t index) const
std::size_t sizeImpl() const
std::span< float const > getSpanImpl() const
std::span< float const > getSpanRangeImpl(std::size_t , std::size_t ) const
bool isContiguousImpl() const
AnalogStorageType getStorageTypeImpl() const
AnalogDataStorageCache tryGetCacheImpl() const
MmapStorageConfig const & getConfig() const
Get configuration used for this storage.

Additional inherited members

Public Functions inherited from AnalogDataStorageBase< MemoryMappedAnalogDataStorage >

Name
std::size_t size() const
Get the number of samples in storage.
bool empty() const
Check if storage is empty.
float getValueAt(std::size_t index) const
Get the value at a specific index.
std::span< float const > getSpan() const
Get a span over all data (if contiguous).
std::span< float const > getSpanRange(std::size_t start, std::size_t end) const
Get a span over a sub-range of data (if contiguous).
bool isContiguous() const
Check if data is stored contiguously in memory.
AnalogStorageType getStorageType() const
Get the storage type identifier.
bool isView() const
Check if this storage is a view (non-owning).
bool isLazy() const
Check if this storage is lazy-evaluated.
AnalogDataStorageCache tryGetCache() const
Try to get a cache for fast-path contiguous access.

Protected Functions inherited from AnalogDataStorageBase< MemoryMappedAnalogDataStorage >

Name
~AnalogDataStorageBase() =default

Detailed Description

class MemoryMappedAnalogDataStorage;

Memory-mapped file analog data storage using CRTP.

Provides efficient access to large binary files without loading entire dataset into memory. Supports:

  • Strided access (e.g., reading one channel from interleaved multi-channel data)
  • Type conversion from various integer/float formats to float32
  • Scale and offset transformations
  • Cross-platform memory mapping (POSIX mmap and Windows MapViewOfFile)

Public Functions Documentation

function MemoryMappedAnalogDataStorage

explicit MemoryMappedAnalogDataStorage(
    MmapStorageConfig config
)

Construct memory-mapped storage from configuration.

Parameters:

  • config Configuration specifying file path, layout, and conversion.

Exceptions:

  • std::runtime_error if file cannot be opened or mapped.

function ~MemoryMappedAnalogDataStorage

~MemoryMappedAnalogDataStorage()

Destructor - unmaps file and releases resources.

function MemoryMappedAnalogDataStorage

MemoryMappedAnalogDataStorage(
    MemoryMappedAnalogDataStorage const & 
) =delete

function operator=

MemoryMappedAnalogDataStorage & operator=(
    MemoryMappedAnalogDataStorage const & 
) =delete

function MemoryMappedAnalogDataStorage

MemoryMappedAnalogDataStorage(
    MemoryMappedAnalogDataStorage && other
)

function operator=

MemoryMappedAnalogDataStorage & operator=(
    MemoryMappedAnalogDataStorage && other
)

function getValueAtImpl

float getValueAtImpl(
    std::size_t index
) const

function sizeImpl

inline std::size_t sizeImpl() const

function getSpanImpl

inline std::span< float const > getSpanImpl() const

function getSpanRangeImpl

inline std::span< float const > getSpanRangeImpl(
    std::size_t ,
    std::size_t 
) const

function isContiguousImpl

inline bool isContiguousImpl() const

function getStorageTypeImpl

inline AnalogStorageType getStorageTypeImpl() const

function tryGetCacheImpl

inline AnalogDataStorageCache tryGetCacheImpl() const

function getConfig

inline MmapStorageConfig const & getConfig() const

Get configuration used for this storage.


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