createOverlapping(std::vector< TimeFrameInterval > intervals, std::shared_ptr< TimeFrame > time_frame =[nullptr]) Create a series that preserves overlapping intervals on insert.
createView(std::shared_ptr< DigitalIntervalSeries const > const & source, std::unordered_set< EntityId > const & entity_ids) Create a view of this series filtered by EntityIds.
A sorted collection of time intervals with entity tracking.
DigitalIntervalSeries stores intervals as (start, end, EntityId) tuples, maintaining intervals in sorted order by start time. Each interval represents a time range (compare to DigitalEventSeries for discrete time points).
createView()/createFromView(): Create view/lazy backed series
materialize(): Convert any storage type to owning storage
Storage Backends
The class supports three storage backends (Owning, View, Lazy) that provide different performance tradeoffs. See Digital_Interval_Series.hpp for details.
Example Usage
// Create and populate a seriesDigitalIntervalSeries series;series.setTimeFrame(my_time_frame);series.addEvent(Interval{100,200});series.addEvent(Interval{300,400});// Iterate all intervalsfor(auto interval : series.view()){std::cout <<"Interval ["<< interval.interval.start <<", "<< interval.interval.end <<"] with id "<< interval.entity_id.getValue()<<"\n";}// Query range with timeframefor(auto interval : series.viewInRange(start, end, source_timeframe)){ process(interval);}// Create filtered viewauto filtered = DigitalIntervalSeries::createView(std::make_shared<DigitalIntervalSeries>(series),50,250);// Intervals overlapping [50, 250]
Intervals are always sorted by start time.
View and Lazy storage will auto-materialize on mutation.
Precondition: series time frame must be set (getTimeFrame() non-null)
This is the primary range query interface. It requires a source TimeFrame parameter to enable proper time conversion when the query time base differs from the series’ internal time base.
Returns intervals that overlap with the given range [start_index, stop_index].
notify If Yes, the target notifies observers after the operation
Return: The number of intervals actually copied (before any merging)
Note: When the target layout is Disjoint, addEvent merges overlapping intervals and the number of intervals added may be fewer than the number of EntityIds matched.
Copies all intervals matching the given EntityIds to the target series. Copied intervals get new EntityIds in the target based on the target’s identity context (via addEvent which auto-assigns EntityIds).