LineData
LineData
#include <Line_Data.hpp>
Inherits from RaggedTimeSeries< Line2D >, ObserverData
Public Classes
| Name | |
|---|---|
| struct | DataTraits Type traits for LineData. |
Public Functions
| Name | |
|---|---|
| LineData() =default Default constructor. |
|
| LineData(std::map< TimeFrameIndex, std::vector< Line2D > > const & data) Constructor with data. |
|
| void | changeImageSize(ImageSize const & image_size) Change the size of the canvas the line belongs to. |
| void | setImageSize(ImageSize const & image_size) |
Additional inherited members
Public Classes inherited from RaggedTimeSeries< Line2D >
| Name | |
|---|---|
| struct | RaggedElement Element type for flattened iteration over ragged time series. |
Public Types inherited from RaggedTimeSeries< Line2D >
| Name | |
|---|---|
| using ModificationHandle< TData > | DataModifier Type alias for modification handle. |
Public Functions inherited from RaggedTimeSeries< Line2D >
| Name | |
|---|---|
| RaggedTimeSeries() =default | |
| virtual | ~RaggedTimeSeries() =default |
| RaggedTimeSeries(RaggedTimeSeries && ) =default | |
| RaggedTimeSeries & | operator=(RaggedTimeSeries && ) =default |
| RaggedTimeSeries(RaggedTimeSeries const & ) =delete | |
| RaggedTimeSeries & | operator=(RaggedTimeSeries const & ) =delete |
| template <std::ranges::input_range R> |
RaggedTimeSeries(R && time_data_pairs) |
| RaggedTimeSeries< TData > | createFilteredCopy(std::unordered_set< EntityId > const & entity_ids) const Create a filtered copy containing only entries with specified EntityIds. |
| RaggedTimeSeries< TData > | createTimeRangeCopy(TimeFrameIndex start_time, TimeFrameIndex end_time) const Create a filtered copy containing only entries in a time range. |
| void | setTimeFrame(std::shared_ptr< TimeFrame > time_frame) Set the time frame for this data structure. |
| std::shared_ptr< TimeFrame > | getTimeFrame() const Get the current time frame. |
| ImageSize | getImageSize() const Get the image size associated with this data. |
| void | setIdentityContext(std::string const & data_key, EntityRegistry * registry) Set identity context for automatic EntityId maintenance. |
| void | rebuildAllEntityIds() Rebuild EntityIds for all entries using the current identity context. |
| void | addEntryAtTime(TimeFrameIndex time, TData const & data, EntityId entity_id, NotifyObservers notify) Add a data entry at a specific time with a specific entity ID. |
| template <typename DerivedTarget > std::size_t |
copyByEntityIds(DerivedTarget & target, std::unordered_set< EntityId > const & entity_ids, NotifyObservers notify) Copy entries with specific EntityIds to another RaggedTimeSeries. |
| template <typename DerivedTarget > std::size_t |
moveByEntityIds(DerivedTarget & target, std::unordered_set< EntityId > const & entity_ids, NotifyObservers notify) Move entries with specific EntityIds to another RaggedTimeSeries. |
| template <typename DerivedTarget > std::optional< std::size_t > |
mergeOverwriteTo(DerivedTarget & target, NotifyObservers notify) const Merge all entries from this series into the target with per-time overwrite. |
| std::optional< std::reference_wrapper< TData const > > | getDataByEntityId(EntityId entity_id) const Find the data associated with a specific EntityId. |
| std::optional< TimeFrameIndex > | getTimeByEntityId(EntityId entity_id) const Find the time frame index for a specific EntityId. |
| auto | getDataByEntityIds(std::span< EntityId const > entity_ids) const Get all data that match the given EntityIds as a lazy view. |
| auto | getDataByEntityIds(std::vector< EntityId > const & entity_ids) const Get all data that match the given EntityIds (vector overload). |
| std::optional< DataModifier > | getMutableData(EntityId entity_id, NotifyObservers notify) Get a mutable handle to data by EntityId. |
| bool | clearByEntityId(EntityId entity_id, NotifyObservers notify) Clear data by its EntityId. |
| size_t | clearByEntityIds(std::unordered_set< EntityId > const & entity_ids, NotifyObservers notify) Clear multiple data entries by their EntityIds in a single pass. |
| bool | clearAtTime(TimeIndexAndFrame const & time_index_and_frame, NotifyObservers notify) Clear all data at a specific time with timeframe conversion. |
| EntityId | addAtTime(TimeFrameIndex time, TData const & data, NotifyObservers notify) Add data at a specific time (by copying). |
| EntityId | addAtTime(TimeIndexAndFrame const & time_index_and_frame, TData const & data, NotifyObservers notify) Add data at a specific time with timeframe conversion (by copying). |
| EntityId | addAtTime(TimeFrameIndex time, TData && data, NotifyObservers notify) Add data at a specific time (by moving). |
| EntityId | addAtTime(TimeIndexAndFrame const & time_index_and_frame, TData && data, NotifyObservers notify) Add data at a specific time with timeframe conversion (by moving). |
| template <typename… TDataArgs> void |
emplaceAtTime(TimeFrameIndex time, TDataArgs &&… args) Construct a data entry in-place at a specific time. |
| void | addAtTime(TimeFrameIndex time, std::vector< TData > const & data_to_add, NotifyObservers notify) Add a batch of data at a specific time by copying them. |
| void | addAtTime(TimeFrameIndex time, std::vector< TData > && data_to_add, NotifyObservers notify) Add a batch of data at a specific time by moving them. |
| std::size_t | getTimeCount() const Get the number of distinct time frames with data. |
| std::size_t | getMaxEntriesAtAnyTime() const Get the maximum number of entries at any single time frame. |
| std::size_t | getTotalEntryCount() const Get the total number of entries across all time frames. |
| auto | getTimesWithData() const Get all times with data. |
| auto | getAtTime(TimeFrameIndex time) const |
| auto | getAtTime(TimeFrameIndex time, TimeFrame const & source_timeframe) const |
| auto | getAtTime(TimeIndexAndFrame const & time_index_and_frame) const |
| auto | getEntityIdsAtTime(TimeFrameIndex time) const |
| auto | getEntityIdsAtTime(TimeFrameIndex time, TimeFrame const & source_timeframe) const |
| auto | getElementsInRange(TimeFrameInterval const & interval) const Get data entries with their associated times as a zero-copy range within a TimeFrameInterval. |
| auto | getElementsInRange(TimeFrameInterval const & interval, TimeFrame const & source_timeframe) const Get a filtered view of elements within a TimeFrameInterval with timeframe conversion. |
| auto | elements() const A flattened view of (Time, DataEntry) pairs. |
| auto | elementsView() const A flattened view of RaggedElement objects (concept-compliant). |
| auto | flattened_data() const A flattened view of (Time, EntityId, TData) tuples. |
| auto | view() const Create a view of this time series. This works for RaggedTimeSeries and any derived class (like PointData). |
| RaggedStorageCache< TData > const & | getStorageCache() const Get the storage cache for fast-path iteration. |
| bool | isStorageContiguous() const Check if storage is currently using the owning backend. |
| RaggedStorageType | getStorageType() const Get the underlying storage type. |
| bool | isLazy() const Check if storage uses lazy evaluation. |
| std::shared_ptr< RaggedTimeSeries< TData > > | materialize() const |
| template std::shared_ptr< Derived > |
createFromView(ViewType view, std::shared_ptr< TimeFrame > time_frame, ImageSize image_size =ImageSize) Create RaggedTimeSeries from a lazy view. |
| template <std::ranges::input_range ViewType> std::shared_ptr< RaggedTimeSeries< TData > > |
createFromViewWithNewIds(ViewType view, std::shared_ptr< TimeFrame > time_frame, std::string const & data_key, EntityRegistry * registry, ImageSize image_size =ImageSize) Create RaggedTimeSeries from a lazy view with new EntityIds. |
Protected Functions inherited from RaggedTimeSeries< Line2D >
| Name | |
|---|---|
| EntityKind | getEntityKind() Get the EntityKind for this data type. |
| void | _ensureOwningStorage() Materialize View/Lazy storage to owning storage in-place. |
| void | _appendPreservedEntries(std::vector< std::tuple< TimeFrameIndex, TData, EntityId > > const & entries, NotifyObservers notify) Append multiple entries preserving EntityIds with a single cache update. |
| bool | _clearAtTime(TimeFrameIndex time, NotifyObservers notify) Clear all data at a specific time (internal helper). |
| void | _updateStorageCache() const Update the cached storage pointers. |
| void | _invalidateStorageCache() const Invalidate the storage cache. |
Protected Attributes inherited from RaggedTimeSeries< Line2D >
| Name | |
|---|---|
| RaggedStorageWrapper< TData > | _storage |
| RaggedStorageCache< TData > | _cached_storage |
| ImageSize | _image_size Image size metadata. |
| std::shared_ptr< TimeFrame > | _time_frame Associated time frame for temporal indexing. |
| std::string | _identity_data_key Data key for EntityRegistry lookups. |
| EntityRegistry * | _identity_registry Pointer to EntityRegistry for automatic EntityId management. |
Public Classes inherited from ObserverData
| Name | |
|---|---|
| struct | ObserverEntry Entry in the observer map. |
Public Types inherited from ObserverData
| Name | |
|---|---|
| using std::function< void()> | ObserverCallback Type alias for observer callback functions. |
| using int | CallbackID Type alias for callback identifiers. |
Public Functions inherited from ObserverData
| Name | |
|---|---|
| ObserverData(std::string name =“UnnamedObservable”) | |
| CallbackID | addObserver(ObserverCallback callback, std::string name =“Anonymous”) Register a new observer callback. |
| void | notifyObservers() Notify all registered observers. |
| void | removeObserver(CallbackID id) Remove a previously registered observer. |
Public Functions Documentation
function LineData
LineData() =defaultDefault constructor.
This constructor creates an empty LineData with no data
function LineData
explicit LineData(
std::map< TimeFrameIndex, std::vector< Line2D > > const & data
)Constructor with data.
Parameters:
- data The data to initialize the LineData with
This constructor creates a LineData with the given data
function changeImageSize
void changeImageSize(
ImageSize const & image_size
)Change the size of the canvas the line belongs to.
Parameters:
- image_size
This will scale all lines in the data structure by the ratio of the new size to the old size.
function setImageSize
inline void setImageSize(
ImageSize const & image_size
)Updated on 2026-11-13 at 20:25:40 +0000