The lower boundary is included in the period, the upper boundary is not included.
With only one date, the period is treated as a timestamp.
The function less() is designed to satisfy the definition of strict weak ordering as used by std::map.
See also Period::Less.
Definition at line 68 of file period.h.
Construct as timestamp and default constructor.
If used as default constructor, the boundaries are not set.
Definition at line 229 of file period.h.
Referenced by infinite().
Constructor taking the period boundaries.
from | Lower boundary of the period. If not set DateTime::min() is used. | |
to | Upper boundary of the period. If not set DateTime::max() is used. |
bool OSB_LIB::Period::contains | ( | const DateTime & | ts | ) | const [inline] |
Check if a given timestamp is within this period.
from_ <= ts && ts < to_.
Definition at line 251 of file period.h.
References from_, isTs_, OSB_LIB::DateTime::max(), OSB_LIB::DateTime::min(), OSB_LIB::DateTime::notSet(), and to_.
Referenced by overlap().
DateTime OSB_LIB::Period::from | ( | ) | const [inline] |
Return the lower boundary of the period.
Definition at line 236 of file period.h.
References from_.
Referenced by OSB_LIB::PersProductCache::Key::mkAssignPeriod().
Period OSB_LIB::Period::infinite | ( | ) | [inline, static] |
Named constructor: create an infinite period.
An infinite period contains all timestamps (except the ones that are not set).
Definition at line 223 of file period.h.
References OSB_LIB::DateTime::max(), OSB_LIB::DateTime::min(), and Period().
bool OSB_LIB::Period::isTimestamp | ( | ) | const [inline] |
True if this period represents a timestamp.
Definition at line 246 of file period.h.
References isTs_.
Referenced by OSB_LIB::PersProductCache::Key::mkAssignPeriod().
bool OSB_LIB::Period::less | ( | const Period & | rhs | ) | const [inline] |
Less comparison.
Rules:
The above rules are designed such that if a timestamp is within a period the function returns false, i.e., the timestamp is not less than the period.
Definition at line 272 of file period.h.
References from_, isTs_, overlap(), and to_.
Referenced by OSB_LIB::Period::Less::operator()(), and OSB_LIB::PersProductCache::Key::operator<().
bool OSB_LIB::Period::overlap | ( | const Period & | rhs | ) | const [inline] |
DateTime OSB_LIB::Period::to | ( | ) | const [inline] |
Return the upper boundary of the period.
Definition at line 241 of file period.h.
References to_.
Referenced by OSB_LIB::PersProductCache::Key::mkAssignPeriod().
DateTime OSB_LIB::Period::from_ [private] |
bool OSB_LIB::Period::isTs_ [private] |
Flag to show if the period represents a timestamp.
Definition at line 182 of file period.h.
Referenced by contains(), isTimestamp(), less(), and overlap().
DateTime OSB_LIB::Period::to_ [private] |
Upper boundary of the time period.
Definition at line 180 of file period.h.
Referenced by contains(), less(), and to().