Skip to main content

LazyRaggedStorage

LazyRaggedStorage

More…

#include <RaggedStorage.hpp>

Inherits from RaggedStorageBase< LazyRaggedStorage< TData, ViewType >, TData >

Public Functions

Name
LazyRaggedStorage(ViewType view, size_t num_elements)
Construct lazy storage from a random-access view.
virtual ~LazyRaggedStorage() =default
size_t sizeImpl() const
TimeFrameIndex getTimeImpl(size_t idx) const
TData const & getDataImpl(size_t idx) const
EntityId getEntityIdImpl(size_t idx) const
std::optional< size_t > findByEntityIdImpl(EntityId id) const
std::pair< size_t, size_t > getTimeRangeImpl(TimeFrameIndex time) const
size_t getTimeCountImpl() const
RaggedStorageType getStorageTypeImpl() const
RaggedStorageCache< TData > tryGetCacheImpl() const
Lazy storage is never contiguous in memory.
ViewType const & getView() const
Get reference to underlying view (for advanced use).

Additional inherited members

Public Functions inherited from RaggedStorageBase< LazyRaggedStorage< TData, ViewType >, TData >

Name
size_t size() const
Get total number of 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.
TData const & getData(size_t idx) const
Get const reference to data at a flat index.
EntityId getEntityId(size_t idx) const
Get the EntityId at a flat index.
std::optional< size_t > findByEntityId(EntityId id) const
Find flat index by EntityId.
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.
RaggedStorageType getStorageType() const
Get the storage type identifier.
bool isView() const
Check if this is a view (doesn’t own data).
RaggedStorageCache< TData > tryGetCache() const
Try to get cached pointers for fast-path access.

Protected Functions inherited from RaggedStorageBase< LazyRaggedStorage< TData, ViewType >, TData >

Name
~RaggedStorageBase() =default

Detailed Description

template <typename TData ,
typename ViewType >
class LazyRaggedStorage;

Public Functions Documentation

function LazyRaggedStorage

inline explicit LazyRaggedStorage(
    ViewType view,
    size_t num_elements
)

Construct lazy storage from a random-access view.

Parameters:

  • view Random-access range view (must support operator[] and size())
  • num_elements Number of elements in the view

Exceptions:

  • static_assert if view is not random-access

The view must yield elements that can be accessed as tuples of (TimeFrameIndex, EntityId, TData) or (TimeFrameIndex, EntityId, TData const&).

function ~LazyRaggedStorage

virtual ~LazyRaggedStorage() =default

function sizeImpl

inline size_t sizeImpl() const

function getTimeImpl

inline TimeFrameIndex getTimeImpl(
    size_t idx
) const

function getDataImpl

inline TData const & getDataImpl(
    size_t idx
) const

function getEntityIdImpl

inline EntityId getEntityIdImpl(
    size_t idx
) const

function findByEntityIdImpl

inline std::optional< size_t > findByEntityIdImpl(
    EntityId id
) const

function getTimeRangeImpl

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

function getTimeCountImpl

inline size_t getTimeCountImpl() const

function getStorageTypeImpl

inline RaggedStorageType getStorageTypeImpl() const

function tryGetCacheImpl

inline RaggedStorageCache< TData > tryGetCacheImpl() const

Lazy storage is never contiguous in memory.

Returns an invalid cache, forcing callers to use virtual dispatch. This is correct since lazy storage computes values on-demand.

function getView

inline ViewType const & getView() const

Get reference to underlying view (for advanced use).


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