Skip to main content

OwningRaggedAnalogStorage

OwningRaggedAnalogStorage

Owning ragged analog storage using Structure of Arrays layout. More…

#include <RaggedAnalogStorage.hpp>

Inherits from RaggedAnalogStorageBase< OwningRaggedAnalogStorage >

Public Functions

Name
OwningRaggedAnalogStorage() =default
void append(TimeFrameIndex time, float value)
Append a single float value at a specific time.
void appendBatch(TimeFrameIndex time, std::vector< float > const & values)
Append multiple float values at a specific time.
void appendBatch(TimeFrameIndex time, std::vector< float > && values)
Append multiple float values at a specific time (move version).
void setAtTime(TimeFrameIndex time, std::vector< float > const & values)
Set/replace all data at a specific time.
size_t removeAtTime(TimeFrameIndex time)
Remove all entries at a specific time.
void reserve(size_t capacity)
Reserve capacity for expected number of entries.
void clear()
Clear all data.
size_t sizeImpl() const
TimeFrameIndex getTimeImpl(size_t idx) const
float getValueImpl(size_t idx) const
std::pair< size_t, size_t > getTimeRangeImpl(TimeFrameIndex time) const
size_t getTimeCountImpl() const
RaggedAnalogStorageType getStorageTypeImpl() const
std::span< float const > getValuesAtTimeImpl(TimeFrameIndex time) const
RaggedAnalogStorageCache tryGetCacheImpl() const
Get cache with pointers to contiguous data.
std::vector< TimeFrameIndex > const & times() const
std::vector< float > const & values() const
std::span< TimeFrameIndex const > timesSpan() const
std::span< float const > valuesSpan() const
std::map< TimeFrameIndex, std::pair< size_t, size_t > > const & timeRanges() const
Get the time ranges map for iteration.

Additional inherited members

Public Functions inherited from RaggedAnalogStorageBase< OwningRaggedAnalogStorage >

Name
size_t size() const
Get total number of float entries across all times.
bool empty() const
Check if storage is empty.
TimeFrameIndex getTime(size_t idx) const
Get the TimeFrameIndex at a flat index.
float getValue(size_t idx) const
Get the float value at a flat index.
std::pair< size_t, size_t > getTimeRange(TimeFrameIndex time) const
Get range of flat indices for a specific time.
size_t getTimeCount() const
Get number of distinct times with data.
bool hasDataAtTime(TimeFrameIndex time) const
Check if data exists at a specific time.
std::span< float const > getValuesAtTime(TimeFrameIndex time) const
Get values at a specific time as a span.
RaggedAnalogStorageType getStorageType() const
Get the storage type identifier.
bool isView() const
Check if this is a view (doesn’t own data).
bool isLazy() const
Check if this is lazy storage.
RaggedAnalogStorageCache tryGetCache() const
Try to get cached pointers for fast-path access.

Protected Functions inherited from RaggedAnalogStorageBase< OwningRaggedAnalogStorage >

Name
~RaggedAnalogStorageBase() =default

Detailed Description

class OwningRaggedAnalogStorage;

Owning ragged analog storage using Structure of Arrays layout.

Stores float data in parallel vectors for cache-friendly access:

  • _times[i] - TimeFrameIndex for entry i
  • _values[i] - float value for entry i

Maintains acceleration structures:

  • _time_ranges: O(log n) time range lookup

Unlike RaggedTimeSeries storage, this doesn’t track EntityIds since RaggedAnalogTimeSeries doesn’t use them.

Public Functions Documentation

function OwningRaggedAnalogStorage

OwningRaggedAnalogStorage() =default

function append

inline void append(
    TimeFrameIndex time,
    float value
)

Append a single float value at a specific time.

Parameters:

  • time The TimeFrameIndex for this entry
  • value The float value to store

Tail append at a new time is O(1). Revisiting an existing time inserts at the end of that time’s contiguous block (O(n) shift when interleaved).

function appendBatch

inline void appendBatch(
    TimeFrameIndex time,
    std::vector< float > const & values
)

Append multiple float values at a specific time.

Parameters:

  • time The TimeFrameIndex for these entries
  • values Vector of float values to store

More efficient than calling append() multiple times.

function appendBatch

inline void appendBatch(
    TimeFrameIndex time,
    std::vector< float > && values
)

Append multiple float values at a specific time (move version).

function setAtTime

inline void setAtTime(
    TimeFrameIndex time,
    std::vector< float > const & values
)

Set/replace all data at a specific time.

Parameters:

  • time The TimeFrameIndex to set data for
  • values Vector of float values

If data already exists at this time, it will be replaced. This is less efficient than append when building from scratch.

function removeAtTime

inline size_t removeAtTime(
    TimeFrameIndex time
)

Remove all entries at a specific time.

Parameters:

Return: Number of entries removed

function reserve

inline void reserve(
    size_t capacity
)

Reserve capacity for expected number of entries.

function clear

inline void clear()

Clear all data.

function sizeImpl

inline size_t sizeImpl() const

function getTimeImpl

inline TimeFrameIndex getTimeImpl(
    size_t idx
) const

function getValueImpl

inline float getValueImpl(
    size_t idx
) const

function getTimeRangeImpl

inline std::pair< size_t, size_t > getTimeRangeImpl(
    TimeFrameIndex time
) const

function getTimeCountImpl

inline size_t getTimeCountImpl() const

function getStorageTypeImpl

inline RaggedAnalogStorageType getStorageTypeImpl() const

function getValuesAtTimeImpl

inline std::span< float const > getValuesAtTimeImpl(
    TimeFrameIndex time
) const

function tryGetCacheImpl

inline RaggedAnalogStorageCache tryGetCacheImpl() const

Get cache with pointers to contiguous data.

OwningRaggedAnalogStorage stores data contiguously in SoA layout, so it always returns a valid cache for fast-path iteration.

function times

inline std::vector< TimeFrameIndex > const & times() const

function values

inline std::vector< float > const & values() const

function timesSpan

inline std::span< TimeFrameIndex const > timesSpan() const

function valuesSpan

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

function timeRanges

inline std::map< TimeFrameIndex, std::pair< size_t, size_t > > const & timeRanges() const

Get the time ranges map for iteration.


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