SharedMmapBlockCache
SharedMmapBlockCache
Shared block-cached memory-mapped storage for interleaved multi-channel data. More…
#include <SharedMmapBlockCache.hpp>
Public Classes
| Name | |
|---|---|
| struct | PlatformMmapState |
Public Functions
| Name | |
|---|---|
| SharedMmapBlockCache(SharedMmapBlockCacheConfig config) | |
| ~SharedMmapBlockCache() | |
| SharedMmapBlockCache(SharedMmapBlockCache const & ) =delete | |
| SharedMmapBlockCache & | operator=(SharedMmapBlockCache const & ) =delete |
| SharedMmapBlockCache(SharedMmapBlockCache && ) =delete | |
| SharedMmapBlockCache & | operator=(SharedMmapBlockCache && ) =delete |
| float | getValue(std::size_t time_sample, std::size_t channel) const Get a single decoded float value. |
| std::span< float const > | getChannelBlockSpan(std::size_t channel, std::size_t start_sample, std::size_t max_count) const Get a contiguous span of decoded floats for one channel within a block. |
| std::size_t | numSamplesPerChannel() const |
| std::size_t | numChannels() const |
| std::size_t | blockSizeSamples() const |
| SharedMmapBlockCacheConfig const & | config() const |
Detailed Description
Shared block-cached memory-mapped storage for interleaved multi-channel data.
Note: Spans returned by [getChannelBlockSpan()](/api_generated/Classes/classSharedMmapBlockCache.md#function-getchannelblockspan) are invalidated when the underlying block is evicted. Callers must not hold spans across operations that may trigger cache eviction.
Precondition:
- config.num_channels >= 1
- config.block_size_samples >= 1
- config.max_cached_blocks >= 1
Opens a single mmap for the entire file. Maintains a FIFO circular buffer of decoded float blocks. Each block covers block_size_samples time steps for all channels. Data is decoded (type-converted, scaled, offset) at block load time.
Intended to be shared (via std::shared_ptr) between a [MmapTensorStorage](/api_generated/Classes/classMmapTensorStorage.md) and multiple [BlockCachedMmapAnalogStorage](/api_generated/Classes/classBlockCachedMmapAnalogStorage.md) instances.
Public Functions Documentation
function SharedMmapBlockCache
function ~SharedMmapBlockCache
function SharedMmapBlockCache
function operator=
function SharedMmapBlockCache
function operator=
function getValue
Get a single decoded float value.
Parameters:
- time_sample Time sample index (0-based, per channel).
- channel Channel index.
Return: Decoded float value with scale and offset applied.
Precondition:
- time_sample < numSamplesPerChannel()
- channel < numChannels()
function getChannelBlockSpan
Get a contiguous span of decoded floats for one channel within a block.
Parameters:
- channel Channel index.
- start_sample Starting time sample index.
- max_count Maximum number of samples to return.
Return: Span of decoded floats. May be shorter than max_count at block/file boundary.
Precondition:
- channel < numChannels()
- start_sample < numSamplesPerChannel()
Returns up to max_count samples starting at start_sample. The span is limited to the current block boundary. The returned span is valid until the block is evicted by subsequent cache operations.
function numSamplesPerChannel
function numChannels
function blockSizeSamples
function config
Updated on 2026-11-13 at 20:25:39 +0000