#include <tp_timeinterval.h>
An interval consisits of a lower and upper bound, plus flags to indicate whether the bounds are inclusive or not. The maximum and minimum values of the time data tyle are interpreted as infinity.
Definition at line 80 of file tp_timeinterval.h.
Public Member Functions | |
TimeInterval (void) | |
Default constructor - sets time interval to (-inf; +inf). | |
~TimeInterval (void) | |
Default destructor. | |
void | LB (tpTime::Type time) |
Set the lower bound to a given value. | |
void | UB (tpTime::Type time) |
Set the upper bound to a given value. | |
void | UBincl (bool incl) |
Configures the upper bound to be inclusive. | |
void | LBincl (bool incl) |
Configures the lower bound to be inclusive. | |
void | setUBinf (void) |
Set upper bound to infinity. | |
void | setLBinf (void) |
Set lower bound to infinity. | |
tpTime::Type | UB (void) const |
Return upper bound. | |
tpTime::Type | LB (void) const |
Return lower bound. | |
bool | LBincl (void) const |
Test for lower bound inclusive. | |
bool | UBincl (void) const |
Test for upper bound inclusive. | |
bool | LBinf (void) const |
Test for lower bound infinity. | |
bool | UBinf (void) const |
Test for upper bound infinity. | |
void | Canonical (void) |
Convert to canonical representation. | |
void | SetFull (void) |
Set to full (-inf, +inf). | |
void | SetEmpty (void) |
Set to empty (1, -1). | |
void | SetPositive (void) |
Set to positive [0, inf). | |
void | SetNegative (void) |
Set to negative (-inf, 0]. | |
bool | Full (void) const |
Test whether interval is full. | |
bool | Empty (void) const |
Test interval for empty set. | |
bool | IncludesPositive (void) const |
Test whether interval includes [0,inf). | |
bool | IncludesNegative (void) const |
Test whether interval includes (-inf,0]. | |
bool | In (tpTime::Type time) const |
Test whether a point satisfies interval. | |
bool | operator== (const TimeInterval &rOtherInterval) const |
Test whether two intervals are equal. | |
bool | operator!= (const TimeInterval &rOtherInterval) const |
Test whether two intervals not equal. | |
void | PositiveLeftShift (tpTime::Type time) |
Transform by left shift and intersection with [0, inf). | |
void | Intersect (const TimeInterval &rOtherInterval) |
Intersect this interval with other interval. | |
void | Merge (const TimeInterval &rOtherInterval) |
Merge this interval with other interval. | |
std::string | Str (void) const |
Pretty printable string. | |
Static Public Member Functions | |
static TimeInterval | Intersect (const TimeInterval &rInterval1, const TimeInterval &rInterval2) |
Intersection of two time intervals. | |
static TimeInterval | Merge (const TimeInterval &rInterval1, const TimeInterval &rInterval2) |
Merge this interval with other interval. | |
Private Attributes | |
tpTime::Type | mstUB |
Upper bound. | |
tpTime::Type | mstLB |
Lower bound. | |
bool | mbUBincl |
Flag to indicate that the upper bound is part of the interval. | |
bool | mbLBincl |
Flag to indicate that lower boundary is part of the interval. |
|
Default constructor - sets time interval to (-inf; +inf).
Definition at line 87 of file tp_timeinterval.h. |
|
Default destructor.
Definition at line 92 of file tp_timeinterval.h. |
|
Convert to canonical representation. Uses tpTime::Step to convert to aleft closed / right opened representation Definition at line 16 of file tp_timeinterval.cpp. |
|
Test interval for empty set.
Definition at line 30 of file tp_timeinterval.cpp. |
|
Test whether interval is full.
Definition at line 244 of file tp_timeinterval.h. |
|
Test whether a point satisfies interval.
Definition at line 40 of file tp_timeinterval.cpp. |
|
Test whether interval includes (-inf,0].
Definition at line 269 of file tp_timeinterval.h. |
|
Test whether interval includes [0,inf).
Definition at line 260 of file tp_timeinterval.h. |
|
Intersection of two time intervals.
Definition at line 114 of file tp_timeinterval.cpp. |
|
Intersect this interval with other interval.
Definition at line 85 of file tp_timeinterval.cpp. |
|
Return lower bound.
Definition at line 174 of file tp_timeinterval.h. |
|
Set the lower bound to a given value. If the value is minus infinity, it is set exclusive. Otherwise, the exclusive/inclusive flag is kept.
Definition at line 102 of file tp_timeinterval.h. |
|
Test for lower bound inclusive.
Definition at line 181 of file tp_timeinterval.h. |
|
Configures the lower bound to be inclusive. If the lower bound is minus infinity, it stays exclusive.
Definition at line 144 of file tp_timeinterval.h. |
|
Test for lower bound infinity.
Definition at line 195 of file tp_timeinterval.h. |
|
Merge this interval with other interval. I.e. find smallest superset of the union of the two intervals.
Definition at line 147 of file tp_timeinterval.cpp. |
|
Merge this interval with other interval. I.e. find smallest superset of the union of the two intervals.
Definition at line 125 of file tp_timeinterval.cpp. |
|
Test whether two intervals not equal. Note that the test is strictly based on the internal representation, ie [0,10] is not equal to [0,11). This may change in future implementations to consider the tpTime::TypeStep
Definition at line 308 of file tp_timeinterval.h. |
|
Test whether two intervals are equal. Note that the test is strictly based on the internal representation, ie [0,10] is not equal to [0,11). This may change in future implementations to consider the tpTime::TypeStep
Definition at line 290 of file tp_timeinterval.h. |
|
Transform by left shift and intersection with [0, inf).
Definition at line 49 of file tp_timeinterval.cpp. |
|
Set to empty (1, -1).
Definition at line 222 of file tp_timeinterval.h. |
|
Set to full (-inf, +inf).
Definition at line 216 of file tp_timeinterval.h. |
|
Set lower bound to infinity.
Definition at line 159 of file tp_timeinterval.h. |
|
Set to negative (-inf, 0].
Definition at line 235 of file tp_timeinterval.h. |
|
Set to positive [0, inf).
Definition at line 228 of file tp_timeinterval.h. |
|
Set upper bound to infinity.
Definition at line 153 of file tp_timeinterval.h. |
|
Pretty printable string.
Definition at line 59 of file tp_timeinterval.cpp. |
|
Return upper bound.
Definition at line 167 of file tp_timeinterval.h. |
|
Set the upper bound to a given value. If the value is infinity, it is set exclusive. Otherwise, the exclusive/inclusive flag is kept.
Definition at line 118 of file tp_timeinterval.h. |
|
Test for upper bound inclusive.
Definition at line 188 of file tp_timeinterval.h. |
|
Configures the upper bound to be inclusive. If the upper bound is infinity, it stays exclusive.
Definition at line 132 of file tp_timeinterval.h. |
|
Test for upper bound infinity.
Definition at line 202 of file tp_timeinterval.h. |
|
Flag to indicate that lower boundary is part of the interval.
Definition at line 384 of file tp_timeinterval.h. |
|
Flag to indicate that the upper bound is part of the interval.
Definition at line 381 of file tp_timeinterval.h. |
|
Lower bound.
Definition at line 378 of file tp_timeinterval.h. |
|
Upper bound.
Definition at line 375 of file tp_timeinterval.h. |