Skip to main content

DigitalIntervalStorageWrapper

DigitalIntervalStorageWrapper

Type-erased storage wrapper for digital interval storage. More…

#include <DigitalIntervalStorage.hpp>

Public Functions

Name
template <typename StorageImpl >
DigitalIntervalStorageWrapper(StorageImpl storage)
Construct wrapper from any storage implementation.
DigitalIntervalStorageWrapper()
DigitalIntervalStorageWrapper(DigitalIntervalStorageWrapper && ) =default
DigitalIntervalStorageWrapper & operator=(DigitalIntervalStorageWrapper && ) =default
DigitalIntervalStorageWrapper(DigitalIntervalStorageWrapper const & ) =default
DigitalIntervalStorageWrapper & operator=(DigitalIntervalStorageWrapper const & ) =default
size_t size() const
bool empty() const
TimeFrameInterval const & getInterval(size_t idx) const
EntityId getEntityId(size_t idx) const
std::optional< size_t > findByInterval(TimeFrameInterval const & interval) const
std::optional< size_t > findByEntityId(EntityId id) const
bool hasIntervalAtTime(TimeFrameIndex time) const
std::pair< size_t, size_t > getOverlappingRange(TimeFrameIndex start, TimeFrameIndex end) const
std::pair< size_t, size_t > getContainedRange(TimeFrameIndex start, TimeFrameIndex end) const
DigitalIntervalStorageType getStorageType() const
bool isView() const
bool isLazy() const
DigitalIntervalStorageCache tryGetCache() const
bool addInterval(TimeFrameInterval const & interval, EntityId entity_id)
bool removeInterval(TimeFrameInterval const & interval)
bool removeByEntityId(EntityId id)
void reserve(size_t capacity)
void clear()
void setEntityIds(std::vector< EntityId > ids)
template <typename StorageType >
StorageType *
tryGet()
template <typename StorageType >
StorageType const *
tryGet() const
OwningDigitalIntervalStorage * tryGetMutableOwning()
Try to get mutable owning storage.
OwningDigitalIntervalStorage const * tryGetOwning() const
std::shared_ptr< OwningDigitalIntervalStorage const > getSharedOwningStorage() const
Get shared pointer to owning storage for creating views.

Detailed Description

class DigitalIntervalStorageWrapper;

Type-erased storage wrapper for digital interval storage.

Provides a uniform interface for any storage backend while hiding the concrete storage type. Supports lazy transforms with unbounded ViewType.

Public Functions Documentation

function DigitalIntervalStorageWrapper

template <typename StorageImpl >
inline explicit DigitalIntervalStorageWrapper(
    StorageImpl storage
)

Construct wrapper from any storage implementation.

function DigitalIntervalStorageWrapper

DigitalIntervalStorageWrapper()

function DigitalIntervalStorageWrapper

DigitalIntervalStorageWrapper(
    DigitalIntervalStorageWrapper && 
) =default

function operator=

DigitalIntervalStorageWrapper & operator=(
    DigitalIntervalStorageWrapper && 
) =default

function DigitalIntervalStorageWrapper

DigitalIntervalStorageWrapper(
    DigitalIntervalStorageWrapper const & 
) =default

function operator=

DigitalIntervalStorageWrapper & operator=(
    DigitalIntervalStorageWrapper const & 
) =default

function size

inline size_t size() const

function empty

inline bool empty() const

function getInterval

inline TimeFrameInterval const & getInterval(
    size_t idx
) const

function getEntityId

inline EntityId getEntityId(
    size_t idx
) const

function findByInterval

inline std::optional< size_t > findByInterval(
    TimeFrameInterval const & interval
) const

function findByEntityId

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

function hasIntervalAtTime

inline bool hasIntervalAtTime(
    TimeFrameIndex time
) const

function getOverlappingRange

inline std::pair< size_t, size_t > getOverlappingRange(
    TimeFrameIndex start,
    TimeFrameIndex end
) const

function getContainedRange

inline std::pair< size_t, size_t > getContainedRange(
    TimeFrameIndex start,
    TimeFrameIndex end
) const

function getStorageType

inline DigitalIntervalStorageType getStorageType() const

function isView

inline bool isView() const

function isLazy

inline bool isLazy() const

function tryGetCache

inline DigitalIntervalStorageCache tryGetCache() const

function addInterval

inline bool addInterval(
    TimeFrameInterval const & interval,
    EntityId entity_id
)

function removeInterval

inline bool removeInterval(
    TimeFrameInterval const & interval
)

function removeByEntityId

inline bool removeByEntityId(
    EntityId id
)

function reserve

inline void reserve(
    size_t capacity
)

function clear

inline void clear()

function setEntityIds

inline void setEntityIds(
    std::vector< EntityId > ids
)

function tryGet

template <typename StorageType >
inline StorageType * tryGet()

function tryGet

template <typename StorageType >
inline StorageType const * tryGet() const

function tryGetMutableOwning

OwningDigitalIntervalStorage * tryGetMutableOwning()

Try to get mutable owning storage.

function tryGetOwning

OwningDigitalIntervalStorage const * tryGetOwning() const

function getSharedOwningStorage

std::shared_ptr< OwningDigitalIntervalStorage const > getSharedOwningStorage() const

Get shared pointer to owning storage for creating views.

Return: shared_ptr to owning storage, or nullptr if not available

If this wrapper contains owning storage, uses the aliasing constructor to create a shared_ptr that shares ownership with the wrapper but points to the inner storage. This enables zero-copy view creation while keeping the source data alive.

If this wrapper contains a view, returns the view’s existing source (which is already a shared_ptr).

Returns nullptr for lazy storage.


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