libtime++: Date and time calculation

◆ shrink()

void libtime::TRange::shrink ( const TRange range)

set to smallest range common to both

Definition at line 125 of file ranges.cc.

References begin(), end(), libtime_assert, Mbegin, Mend, and overlaps().

126  {
127  libtime_assert((this->overlaps(range)),
128  "ERROR (Trange::shrink): ranges must overlap");
129  Mbegin = Mbegin > range.begin() ? Mbegin : range.begin();
130  Mend = Mend < range.end() ? Mend : range.end();
131  }
#define libtime_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: libtime++.h:714
TAbsoluteTime Mend
Definition: libtime++.h:633
bool overlaps(const TRange &) const
true if other range overlaps this one
Definition: ranges.cc:62
TAbsoluteTime Mbegin
Definition: libtime++.h:632
Here is the call graph for this function: