Alphabetic Class Index   |   Class Inheritance Tree Index   |   Tool Index

Class: TimeLine

This is a base class.

Description:
This class represents a set of TimeInterval objects. It is used by the TimePacketBinner class to sort packets.

Embedded Classes:
TimeLine::lessThan

Data Fields
privateprivate: multiset<TimeInterval*, TimeLine::lessThan>s
privatemultiset<TimeInterval*, TimeLine::lessThan>::iteratoradd_position
privatemultiset<TimeInterval*, TimeLine::lessThan>::iteratorsearch_position

Constructors / Destructor
public TimeLine()
public ~TimeLine()

Methods
public virtual void addInterval(TimeInterval* interval)
Add the interval to the timeline. This may merge the interval with another if they overlap. Throws an exception if two intervals with different IDs overlap.
Throws: TimeInterval::Exception
public virtual void removeInterval(TimeInterval* interval)
Delete the interval from the timeline. Throws an exception if some part of this interval is not in the timeline.
Throws: TimeInterval::Exception
public virtual void removeIntervalWhereConsistent(TimeInterval* interval)
Delete all parts of this timeline that fall within the given interval and have the same ID.
Throws: TimeInterval::Exception
public virtual void forceInterval(TimeInterval* interval)
Add an interval to the timeline, silently obliterating any intervals or portions of intervals which overlap the new one.
Throws: TimeInterval::Exception
public virtual void mergeWith(TimeLine* timeline)
Add all the intervals in the given timeline to this one.
Throws: TimeInterval::Exception
public virtual void overlay(TimeLine* timeline)
Force all the intervals in the given timeline into this one. In other words where the two timelines differ the given one dominates over this one.
Throws: TimeInterval::Exception
public virtual void subtract(TimeLine* timeline)
Remove all the intervals in the given timeline to this one.
Throws: TimeInterval::Exception
public virtual void leaveInconsistencies(TimeLine* timeline)
Calls removeIntervalWhereConsistent for all intervals in the given timeline.
Throws: TimeInterval::Exception
public virtual int getIntervalCount()
public virtual TimeInterval* getInterval(int index)
Return the interval at a particular index.
public virtual TimeInterval* findInterval(double time)
Find the interval in the timeline which includes a given time. If the time is not included in any interval, then return NULL.
public virtual TimeLine* findIntervals(double start, double stop)
Return a new timeline which contains all time intervals which have any part within the given range of times. The caller has the responsibility of disposing of the new timeline.
public virtual void fillGaps(double allowed_gap)
Fill in any gaps in the timeline. A gap is a span of time no greater that allowed_gap between adjacent intervals with the same ID.
public virtual void splitGaps(double allowed_gap, double latest_allowed_time)
Fill in gaps between intervals, by splitting the difference between them. Unlike the fillGaps method, this will work for adjacent intervals with different IDs.
public virtual void read(istream* in)
Read the timeline in ASCII format from a file.
Throws: TimeInterval::Exception
public virtual void write(ostream* out)
Write the timeline in ASCII format to a file.
public void print()

Operators


Alphabetic Class Index   |   Class Inheritance Tree Index   |   Tool Index