Skip to main content

DigitalEventStorageWrapper

DigitalEventStorageWrapper

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

#include <DigitalEventStorage.hpp>

Public Functions

Name
template <typename StorageImpl >
DigitalEventStorageWrapper(StorageImpl storage)
Construct wrapper from any storage implementation.
DigitalEventStorageWrapper()
DigitalEventStorageWrapper(DigitalEventStorageWrapper && ) =default
DigitalEventStorageWrapper & operator=(DigitalEventStorageWrapper && ) =default
DigitalEventStorageWrapper(DigitalEventStorageWrapper const & ) =default
DigitalEventStorageWrapper & operator=(DigitalEventStorageWrapper const & ) =default
size_t size() const
bool empty() const
TimeFrameIndex getEvent(size_t idx) const
EntityId getEntityId(size_t idx) const
std::optional< size_t > findByTime(TimeFrameIndex time) const
std::optional< size_t > findByEntityId(EntityId id) const
std::pair< size_t, size_t > getTimeRange(TimeFrameIndex start, TimeFrameIndex end) const
bool hasEventAtTime(TimeFrameIndex time) const
DigitalEventStorageType getStorageType() const
bool isView() const
bool isLazy() const
bool isRelative() const
DigitalEventTimeDomain getTimeDomain() const
ClockTicks getRelativeEvent(size_t idx) const
std::optional< size_t > findByRelativeTime(ClockTicks time) const
std::pair< size_t, size_t > getRelativeTimeRange(ClockTicks start, ClockTicks end) const
DigitalEventStorageCache tryGetCache() const
bool addEvent(TimeFrameIndex time, EntityId entity_id)
bool removeEvent(TimeFrameIndex time)
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
OwningDigitalEventStorage * tryGetMutableOwning()
OwningDigitalEventStorage const * tryGetOwning() const
std::shared_ptr< OwningDigitalEventStorage const > getSharedOwningStorage() const
Get shared pointer to owning storage for creating views.

Detailed Description

class DigitalEventStorageWrapper;

Type-erased storage wrapper for digital event 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 DigitalEventStorageWrapper

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

Construct wrapper from any storage implementation.

function DigitalEventStorageWrapper

DigitalEventStorageWrapper()

function DigitalEventStorageWrapper

DigitalEventStorageWrapper(
    DigitalEventStorageWrapper && 
) =default

function operator=

DigitalEventStorageWrapper & operator=(
    DigitalEventStorageWrapper && 
) =default

function DigitalEventStorageWrapper

DigitalEventStorageWrapper(
    DigitalEventStorageWrapper const & 
) =default

function operator=

DigitalEventStorageWrapper & operator=(
    DigitalEventStorageWrapper const & 
) =default

function size

inline size_t size() const

function empty

inline bool empty() const

function getEvent

inline TimeFrameIndex getEvent(
    size_t idx
) const

function getEntityId

inline EntityId getEntityId(
    size_t idx
) const

function findByTime

inline std::optional< size_t > findByTime(
    TimeFrameIndex time
) const

function findByEntityId

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

function getTimeRange

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

function hasEventAtTime

inline bool hasEventAtTime(
    TimeFrameIndex time
) const

function getStorageType

inline DigitalEventStorageType getStorageType() const

function isView

inline bool isView() const

function isLazy

inline bool isLazy() const

function isRelative

inline bool isRelative() const

function getTimeDomain

inline DigitalEventTimeDomain getTimeDomain() const

function getRelativeEvent

inline ClockTicks getRelativeEvent(
    size_t idx
) const

function findByRelativeTime

inline std::optional< size_t > findByRelativeTime(
    ClockTicks time
) const

function getRelativeTimeRange

inline std::pair< size_t, size_t > getRelativeTimeRange(
    ClockTicks start,
    ClockTicks end
) const

function tryGetCache

inline DigitalEventStorageCache tryGetCache() const

function addEvent

inline bool addEvent(
    TimeFrameIndex time,
    EntityId entity_id
)

function removeEvent

inline bool removeEvent(
    TimeFrameIndex time
)

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

OwningDigitalEventStorage * tryGetMutableOwning()

function tryGetOwning

OwningDigitalEventStorage const * tryGetOwning() const

function getSharedOwningStorage

std::shared_ptr< OwningDigitalEventStorage 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