5 #include "tools/epicsTimeHelper.h"
6 #include "tools/MsgLogger.h"
20 Interval(
const epicsTime &start,
const epicsTime &end)
21 : start(start), end(end) {
22 LOG_ASSERT(start <= end);
35 {
return end - start; }
55 if (start > other.start)
59 LOG_ASSERT(start <= end);
65 return start != nullTime && end != nullTime;
75 return start <= other.start && end >= other.end;
81 return start == other.start && end == other.end;
87 return start != other.start || end != other.end;
99 if (end <= other.start || other.end <= start)
108 epicsTime start, end;
void setStart(const epicsTime &time)
Update start time of Interval.
Definition: Interval.h:45
void add(const Interval &other)
Union; Cause Interval to include the range of the other Interval.
Definition: Interval.h:53
const epicsTime & getStart() const
Definition: Interval.h:26
void clear()
Reset Interval to null start and end times.
Definition: Interval.h:38
Interval(const epicsTime &start, const epicsTime &end)
Construct Interval with given start..end.
Definition: Interval.h:20
stdString toString() const
Prints this interval to string.
bool operator==(const Interval &other) const
Definition: Interval.h:79
Interval()
Construct empty Interval.
Definition: Interval.h:15
A time interval.
Definition: Interval.h:10
void setEnd(const epicsTime &time)
Update end time of Interval.
Definition: Interval.h:49
bool isValid() const
Definition: Interval.h:63
double width() const
Definition: Interval.h:34
bool operator!=(const Interval &other) const
Definition: Interval.h:85
const epicsTime & getEnd() const
Definition: Interval.h:30
bool overlaps(const Interval &other) const
Check if this and other interval overlap.
Definition: Interval.h:95
bool covers(const Interval &other) const
Check if this interval 'covers' another one, meaning this interval matches the other one...
Definition: Interval.h:73