Immutable value class for a range of time periods: the minimum and the maximum period in milliseconds.
More...
#include <TimePeriodInfo.hpp>
|
| constexpr std::int64_t | getMin () const noexcept |
| | Returns the minimum period in milliseconds.
|
| constexpr std::int64_t | getMax () const noexcept |
| | Returns the maximum period in milliseconds.
|
| constexpr bool | isUnknown () const noexcept |
| std::string | toString () const |
| | Returns the info as JSON with the periods in seconds, as Java does: {"min":1.5,"max":2}.
|
|
|
static const TimePeriodInfo | UNKNOWN {-1000, -1000} |
| | The value meaning "not set / unknown". It has negative minimum and maximum.
|
|
static const TimePeriodInfo | EMPTY {0, 0} |
| | The value meaning "known to be zero". It has zero minimum and maximum.
|
Immutable value class for a range of time periods: the minimum and the maximum period in milliseconds.
It describes the aggregation periods that a server applies (DXEndpoint::getAggregationPeriodInfo()) or that were applied to the delivered events (DXFeedSubscription::getAggregationPeriodInfo()). TimePeriodInfo::UNKNOWN means that no info is available.
Javadoc.
◆ getMax()
| std::int64_t TimePeriodInfo::getMax |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the maximum period in milliseconds.
It is negative for TimePeriodInfo::UNKNOWN: check isUnknown() before using the value arithmetically.
- Returns
- The maximum period in milliseconds.
◆ getMin()
| std::int64_t TimePeriodInfo::getMin |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the minimum period in milliseconds.
It is negative for TimePeriodInfo::UNKNOWN: check isUnknown() before using the value arithmetically.
- Returns
- The minimum period in milliseconds.
◆ isUnknown()
| bool TimePeriodInfo::isUnknown |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ toString()
| std::string TimePeriodInfo::toString |
( |
| ) |
const |
Returns the info as JSON with the periods in seconds, as Java does: {"min":1.5,"max":2}.
TimePeriodInfo::UNKNOWN is {"min":-1,"max":-1}.
- Returns
- The string representation.
◆ valueOf()
| TimePeriodInfo TimePeriodInfo::valueOf |
( |
std::int64_t | min, |
|
|
std::int64_t | max ) |
|
static |
Returns TimePeriodInfo with the given bounds.
- Parameters
-
| min | The minimum period in milliseconds (non-negative). |
| max | The maximum period in milliseconds (non-negative, not less than min). |
- Returns
- TimePeriodInfo with the given bounds; TimePeriodInfo::EMPTY for (0, 0).
- Exceptions
-