Change request #2173
Guarantee consistency of Good Time Intervals in the GGti class
Status: | New | Start date: | 07/28/2017 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assigned To: | - | % Done: | 0% | |
Category: | - | |||
Target version: | - | |||
Duration: |
Description
So far, the GGti
class does not handle overlapping time intervals, and the class also assumes that time intervals are always in order. The user can append an overlapping time interval to the class, and as a consequence, the ontime would be wrongly calculated.
- the
append()
method always verifies that tstart is not smaller than the last tstop (this assures the time ordering and allows to append a new interval where tstart is the last tstop) - the
insert()
method inserts a time interval in an appropriate slot, and eventually merges with existing time intervals if there is an overlap - the
merge()
method would then only merge connecting time intervals since by definition there should no longer be overlapping intervals - the
merge(GTime,GTime)
method is probably obsolete since theinsert()
method does already what the method is expected to do - the
reduce()
method stays as it is - the
extend()
method always verifies that tstart of the first time interval to add is not smaller than the tstop of the last interval (similar toappend
) - the
read()
method should also complain about overlapping time intervals
The class should also use a std::vector
to hold the times and not perform its own memory management (this is a relict from the early days).
Recurrence
No recurrence.
History
#1 Updated by Knödlseder Jürgen over 7 years ago
- Related to Feature #2142: GGti::exclude(tstart,tstop) added
#2 Updated by Knödlseder Jürgen over 7 years ago
- Related to deleted (Feature #2142: GGti::exclude(tstart,tstop))
#3 Updated by Knödlseder Jürgen about 7 years ago
- Subject changed from Guarantee consistency of Good Time Intervals in the @GGti@ class to Guarantee consistency of Good Time Intervals in the GGti class