#include <tp_timeinterval.h>

Public Member Functions

 TimeInterval (void)
 
 ~TimeInterval (void)
 
void LB (Time::Type time)
 
void UB (Time::Type time)
 
void UBincl (bool incl)
 
void LBincl (bool incl)
 
void setUBinf (void)
 
void setLBinf (void)
 
Time::Type UB (void) const
 
Time::Type LB (void) const
 
bool LBincl (void) const
 
bool UBincl (void) const
 
bool LBinf (void) const
 
bool UBinf (void) const
 
void Canonical (void)
 
void SetFull (void)
 
void SetEmpty (void)
 
void SetPositive (void)
 
void SetNegative (void)
 
bool Full (void) const
 
bool Empty (void) const
 
bool IncludesPositive (void) const
 
bool IncludesNegative (void) const
 
bool In (Time::Type time) const
 
bool operator== (const TimeInterval &rOtherInterval) const
 
bool operator!= (const TimeInterval &rOtherInterval) const
 
void PositiveLeftShift (Time::Type time)
 
void Intersect (const TimeInterval &rOtherInterval)
 
void Merge (const TimeInterval &rOtherInterval)
 
std::string Str (void) const
 

Static Public Member Functions

static TimeInterval Intersect (const TimeInterval &rInterval1, const TimeInterval &rInterval2)
 
static TimeInterval Merge (const TimeInterval &rInterval1, const TimeInterval &rInterval2)
 

Private Attributes

Time::Type mstUB
 
Time::Type mstLB
 
bool mbUBincl
 
bool mbLBincl
 

Detailed Description

Model of a time interval. 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 83 of file tp_timeinterval.h.

Constructor & Destructor Documentation

◆ TimeInterval()

faudes::TimeInterval::TimeInterval ( void  )
inline

Default constructor - sets time interval to (-inf; +inf)

Definition at line 90 of file tp_timeinterval.h.

◆ ~TimeInterval()

faudes::TimeInterval::~TimeInterval ( void  )
inline

Default destructor

Definition at line 95 of file tp_timeinterval.h.

Member Function Documentation

◆ Canonical()

void TimeInterval::Canonical ( void  )

Convert to canonical representation.

Uses Time::Step to convert to aleft closed / right opened representation

Definition at line 18 of file tp_timeinterval.cpp.

◆ Empty()

bool TimeInterval::Empty ( void  ) const

Test interval for empty set

Returns
True if interval is empty

Definition at line 32 of file tp_timeinterval.cpp.

◆ Full()

bool faudes::TimeInterval::Full ( void  ) const
inline

Test whether interval is full

Returns
True if interval is (-inf,+inf)

Definition at line 247 of file tp_timeinterval.h.

◆ In()

bool TimeInterval::In ( Time::Type  time) const

Test whether a point satisfies interval

Returns
True if interval includes the point

Definition at line 42 of file tp_timeinterval.cpp.

◆ IncludesNegative()

bool faudes::TimeInterval::IncludesNegative ( void  ) const
inline

Test whether interval includes (-inf,0]

Returns
True if interval includes (-inf,0]

Definition at line 272 of file tp_timeinterval.h.

◆ IncludesPositive()

bool faudes::TimeInterval::IncludesPositive ( void  ) const
inline

Test whether interval includes [0,inf)

Returns
True if interval includes [0,inf)

Definition at line 263 of file tp_timeinterval.h.

◆ Intersect() [1/2]

TimeInterval TimeInterval::Intersect ( const TimeInterval rInterval1,
const TimeInterval rInterval2 
)
static

Intersection of two time intervals.

Parameters
rInterval1Reference of first time interval
rInterval2Reference of second time interval
Returns
Intersection of both intervals.

Definition at line 116 of file tp_timeinterval.cpp.

◆ Intersect() [2/2]

void TimeInterval::Intersect ( const TimeInterval rOtherInterval)

Intersect this interval with other interval

Parameters
rOtherInterval

Definition at line 87 of file tp_timeinterval.cpp.

◆ LB() [1/2]

void faudes::TimeInterval::LB ( Time::Type  time)
inline

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.

Parameters
timeThe new value of lower bound

Definition at line 105 of file tp_timeinterval.h.

◆ LB() [2/2]

Time::Type faudes::TimeInterval::LB ( void  ) const
inline

Return lower bound.

Returns
lower bound

Definition at line 177 of file tp_timeinterval.h.

◆ LBincl() [1/2]

void faudes::TimeInterval::LBincl ( bool  incl)
inline

Configures the lower bound to be inclusive. If the lower bound is minus infinity, it stays exclusive.

Parameters
incl

Definition at line 147 of file tp_timeinterval.h.

◆ LBincl() [2/2]

bool faudes::TimeInterval::LBincl ( void  ) const
inline

Test for lower bound inclusive

Returns
true for inclusive

Definition at line 184 of file tp_timeinterval.h.

◆ LBinf()

bool faudes::TimeInterval::LBinf ( void  ) const
inline

Test for lower bound infinity

Returns
true for infinity

Definition at line 198 of file tp_timeinterval.h.

◆ Merge() [1/2]

TimeInterval TimeInterval::Merge ( const TimeInterval rInterval1,
const TimeInterval rInterval2 
)
static

Merge this interval with other interval. I.e. find smallest superset of the union of the two intervals.

Parameters
rInterval1Reference of first time interval
rInterval2Reference of second time interval
Returns
Superset of both intervals.

Definition at line 149 of file tp_timeinterval.cpp.

◆ Merge() [2/2]

void TimeInterval::Merge ( const TimeInterval rOtherInterval)

Merge this interval with other interval. I.e. find smallest superset of the union of the two intervals.

Parameters
rOtherIntervalReference to other time interval

Definition at line 127 of file tp_timeinterval.cpp.

◆ operator!=()

bool faudes::TimeInterval::operator!= ( const TimeInterval rOtherInterval) const
inline

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 Time::TypeStep

Returns
False on equality

Definition at line 311 of file tp_timeinterval.h.

◆ operator==()

bool faudes::TimeInterval::operator== ( const TimeInterval rOtherInterval) const
inline

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 Time::TypeStep

Returns
True on equality

Definition at line 293 of file tp_timeinterval.h.

◆ PositiveLeftShift()

void TimeInterval::PositiveLeftShift ( Time::Type  time)

Transform by left shift and intersection with [0, inf)

Parameters
timeAmount to shift left

Definition at line 51 of file tp_timeinterval.cpp.

◆ SetEmpty()

void faudes::TimeInterval::SetEmpty ( void  )
inline

Set to empty (1, -1)

Definition at line 225 of file tp_timeinterval.h.

◆ SetFull()

void faudes::TimeInterval::SetFull ( void  )
inline

Set to full (-inf, +inf)

Definition at line 219 of file tp_timeinterval.h.

◆ setLBinf()

void faudes::TimeInterval::setLBinf ( void  )
inline

Set lower bound to infinity

Definition at line 162 of file tp_timeinterval.h.

◆ SetNegative()

void faudes::TimeInterval::SetNegative ( void  )
inline

Set to negative (-inf, 0]

Definition at line 238 of file tp_timeinterval.h.

◆ SetPositive()

void faudes::TimeInterval::SetPositive ( void  )
inline

Set to positive [0, inf)

Definition at line 231 of file tp_timeinterval.h.

◆ setUBinf()

void faudes::TimeInterval::setUBinf ( void  )
inline

Set upper bound to infinity

Definition at line 156 of file tp_timeinterval.h.

◆ Str()

std::string TimeInterval::Str ( void  ) const

Pretty printable string.

Returns
printable string.

Definition at line 61 of file tp_timeinterval.cpp.

◆ UB() [1/2]

void faudes::TimeInterval::UB ( Time::Type  time)
inline

Set the upper bound to a given value. If the value is infinity, it is set exclusive. Otherwise, the exclusive/inclusive flag is kept.

Parameters
timeThe new value of upper bound

Definition at line 121 of file tp_timeinterval.h.

◆ UB() [2/2]

Time::Type faudes::TimeInterval::UB ( void  ) const
inline

Return upper bound.

Returns
upper bound

Definition at line 170 of file tp_timeinterval.h.

◆ UBincl() [1/2]

void faudes::TimeInterval::UBincl ( bool  incl)
inline

Configures the upper bound to be inclusive. If the upper bound is infinity, it stays exclusive.

Parameters
incl

Definition at line 135 of file tp_timeinterval.h.

◆ UBincl() [2/2]

bool faudes::TimeInterval::UBincl ( void  ) const
inline

Test for upper bound inclusive

Returns
true for inclusive

Definition at line 191 of file tp_timeinterval.h.

◆ UBinf()

bool faudes::TimeInterval::UBinf ( void  ) const
inline

Test for upper bound infinity

Returns
true for infinity

Definition at line 205 of file tp_timeinterval.h.

Member Data Documentation

◆ mbLBincl

bool faudes::TimeInterval::mbLBincl
private

Flag to indicate that lower boundary is part of the interval.

Definition at line 387 of file tp_timeinterval.h.

◆ mbUBincl

bool faudes::TimeInterval::mbUBincl
private

Flag to indicate that the upper bound is part of the interval

Definition at line 384 of file tp_timeinterval.h.

◆ mstLB

Time::Type faudes::TimeInterval::mstLB
private

Lower bound

Definition at line 381 of file tp_timeinterval.h.

◆ mstUB

Time::Type faudes::TimeInterval::mstUB
private

Upper bound

Definition at line 378 of file tp_timeinterval.h.


The documentation for this class was generated from the following files:

libFAUDES 2.33c --- 2025.05.15 --- c++ api documentaion by doxygen