43 if(time<
mstLB)
return false;
44 if(time>
mstUB)
return false;
64 std::stringstream resstream;
67 resstream <<
"[empty]";
73 else resstream <<
"(";
74 if(
LBinf()) resstream <<
"-inf";
75 else resstream <<
mstLB;
77 if(
UBinf()) resstream <<
"inf";
78 else resstream <<
mstUB;
80 else resstream <<
")";
89 FD_DC(
"TimeInterval::Intersect(otherinterval): " <<
Str()<<
" & " <<
90 rOtherInterval.
Str() );
93 if(
UB()==rOtherInterval.
UB()) {
97 if(
UB() > rOtherInterval.
UB()) {
98 UB(rOtherInterval.
UB());
102 if(
LB()==rOtherInterval.
LB()) {
106 if(
LB() < rOtherInterval.
LB()) {
107 LB(rOtherInterval.
LB());
111 FD_DC(
"TimeInterval::Intersect( ... ), ret: " <<
Str());
117 FD_DC(
"TimeInterval::Intersect(" << rInterval1.
Str()<<
", " <<
118 rInterval2.
Str() <<
")");
121 FD_DC(
"TimeInterval::Intersect( ... ), ret: " << res.
Str());
129 if(
UB()==rOtherInterval.
UB()) {
133 if(
UB() < rOtherInterval.
UB()) {
134 UB(rOtherInterval.
UB());
138 if(
LB()==rOtherInterval.
LB()) {
142 if(
LB()<rOtherInterval.
LB()) {
143 LB(rOtherInterval.
LB());
151 res.
Merge(rInterval2);
#define FD_DC(message)
Debug: optional report on container operations.
Model of a time interval.
void LB(Time::Type time)
Set the lower bound to a given value.
void Merge(const TimeInterval &rOtherInterval)
Merge this interval with other interval.
Time::Type LB(void) const
Return lower bound.
Time::Type mstLB
Lower bound.
bool LBincl(void) const
Test for lower bound inclusive.
void PositiveLeftShift(Time::Type time)
Transform by left shift and intersection with [0, inf)
void Canonical(void)
Convert to canonical representation.
Time::Type UB(void) const
Return upper bound.
bool UBinf(void) const
Test for upper bound infinity.
Time::Type mstUB
Upper bound.
bool UBincl(void) const
Test for upper bound inclusive.
bool In(Time::Type time) const
Test whether a point satisfies interval.
std::string Str(void) const
Pretty printable string.
void UBincl(bool incl)
Configures the upper bound to be inclusive.
void LBincl(bool incl)
Configures the lower bound to be inclusive.
void UB(Time::Type time)
Set the upper bound to a given value.
bool mbUBincl
Flag to indicate that the upper bound is part of the interval.
bool LBinf(void) const
Test for lower bound infinity.
bool mbLBincl
Flag to indicate that lower boundary is part of the interval.
bool Empty(void) const
Test interval for empty set.
void Intersect(const TimeInterval &rOtherInterval)
Intersect this interval with other interval.
Int Type
Datatype for point on time axis.
static Type Step(void)
Smallest representable time step.
libFAUDES resides within the namespace faudes.