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 &&
) =defaultfunction operator=
DigitalIntervalStorageWrapper & operator=(
DigitalIntervalStorageWrapper &&
) =defaultfunction DigitalIntervalStorageWrapper
DigitalIntervalStorageWrapper(
DigitalIntervalStorageWrapper const &
) =defaultfunction operator=
DigitalIntervalStorageWrapper & operator=(
DigitalIntervalStorageWrapper const &
) =defaultfunction size
inline size_t size() constfunction empty
inline bool empty() constfunction getInterval
inline TimeFrameInterval const & getInterval(
size_t idx
) constfunction getEntityId
inline EntityId getEntityId(
size_t idx
) constfunction findByInterval
inline std::optional< size_t > findByInterval(
TimeFrameInterval const & interval
) constfunction findByEntityId
inline std::optional< size_t > findByEntityId(
EntityId id
) constfunction hasIntervalAtTime
inline bool hasIntervalAtTime(
TimeFrameIndex time
) constfunction getOverlappingRange
inline std::pair< size_t, size_t > getOverlappingRange(
TimeFrameIndex start,
TimeFrameIndex end
) constfunction getContainedRange
inline std::pair< size_t, size_t > getContainedRange(
TimeFrameIndex start,
TimeFrameIndex end
) constfunction getStorageType
inline DigitalIntervalStorageType getStorageType() constfunction isView
inline bool isView() constfunction isLazy
inline bool isLazy() constfunction tryGetCache
inline DigitalIntervalStorageCache tryGetCache() constfunction 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() constfunction tryGetMutableOwning
OwningDigitalIntervalStorage * tryGetMutableOwning()Try to get mutable owning storage.
function tryGetOwning
OwningDigitalIntervalStorage const * tryGetOwning() const