template<typename T>
QgsTemporalRange class

A template based class for storing temporal ranges (beginning to end values).

QgsTemporalRange classes represent a range of values of some temporal type. For instance, ranges of QDateTime might be used to represent datetime ranges.

Ranges can indicate whether the upper and lower values are inclusive or exclusive. The inclusivity or exclusivity of bounds is considered when determining things like whether ranges overlap or during calculation of range intersections.

Constructors, destructors, conversion operators

QgsTemporalRange(const T& begin = T(), const T& end = T(), bool includeBeginning = true, bool includeEnd = true)
Constructor for QgsTemporalRange.

Public functions

auto begin() const -> T
Returns the beginning of the range.
auto contains(const QgsTemporalRange<T>& other) const -> bool
Returns true if this range contains another range.
auto contains(const T& element) const -> bool
Returns true if this range contains a specified element.
auto end() const -> T
Returns the upper bound of the range.
auto includeBeginning() const -> bool
Returns true if the beginning is inclusive, or false if the beginning is exclusive.
auto includeEnd() const -> bool
Returns true if the end is inclusive, or false if the end is exclusive.
auto isEmpty() const -> bool
Returns true if the range is empty, ie the beginning equals (or exceeds) the end and either of the bounds are exclusive.
auto isInfinite() const -> bool
Returns true if the range consists of all possible values.
auto isInstant() const -> bool
Returns true if the range consists only of a single instant.
auto overlaps(const QgsTemporalRange<T>& other) const -> bool
Returns true if this range overlaps another range.

Function documentation

template<typename T>
QgsTemporalRange<T>::QgsTemporalRange(const T& begin = T(), const T& end = T(), bool includeBeginning = true, bool includeEnd = true)

Constructor for QgsTemporalRange.

The begin and end are specified, and optionally whether or not these bounds are included in the range.

template<typename T>
T QgsTemporalRange<T>::begin() const

Returns the beginning of the range.

template<typename T>
T QgsTemporalRange<T>::end() const

Returns the upper bound of the range.

template<typename T>
bool QgsTemporalRange<T>::includeBeginning() const

Returns true if the beginning is inclusive, or false if the beginning is exclusive.

template<typename T>
bool QgsTemporalRange<T>::includeEnd() const

Returns true if the end is inclusive, or false if the end is exclusive.

template<typename T>
bool QgsTemporalRange<T>::isEmpty() const

Returns true if the range is empty, ie the beginning equals (or exceeds) the end and either of the bounds are exclusive.

A range with both invalid beginning and end is considered infinite and not empty.

template<typename T>
bool QgsTemporalRange<T>::isInfinite() const

Returns true if the range consists of all possible values.

template<typename T>
bool QgsTemporalRange<T>::isInstant() const

Returns true if the range consists only of a single instant.