TimePoint Class Reference
|
CPP API
|
mio::abm::TimePoint Class Reference
Represents a point in time. More...
#include <time.h>
Public Member Functions | |
| int | day_of_week () const |
| Index of current day of the week (0,...,6 = Mo,...,Sun). More... | |
| ScalarType | days () const |
| Time since the epoch in days. More... | |
| auto | default_serialize () |
| This method is used by the default serialization feature. More... | |
| int | hour_of_day () const |
| Hour in the current day (0 - 23). More... | |
| ScalarType | hours () const |
| Time since the epoch in hours. More... | |
| bool | is_weekend () const |
| If the current time is on a weekend, e.g. More... | |
| TimeSpan | operator- (const TimePoint &p2) const |
| TimeSpan difference between this and another TimePoint. More... | |
| int | seconds () const |
| Time since the epoch in seconds. More... | |
| TimeSpan | time_since_midnight () const |
| Time since midnight. More... | |
| TimePoint ()=default | |
| Default ctor, unitinialized. More... | |
| TimePoint (int seconds) | |
| Creates a TimePoint from a specified number of seconds. More... | |
Comparison operators. | |
| bool | operator== (const TimePoint &other) const |
| bool | operator!= (const TimePoint &other) const |
| bool | operator< (const TimePoint &other) const |
| bool | operator<= (const TimePoint &other) const |
| bool | operator> (const TimePoint &other) const |
| bool | operator>= (const TimePoint &other) const |
| TimePoint | operator+ (const TimeSpan &s) const |
| Add or subtract a TimeSpan. More... | |
| TimePoint & | operator+= (const TimeSpan &s) |
| Add or subtract a TimeSpan. More... | |
| TimePoint | operator- (const TimeSpan &s) const |
| Add or subtract a TimeSpan. More... | |
| TimePoint & | operator-= (const TimeSpan &s) |
| Add or subtract a TimeSpan. More... | |
Private Attributes | |
| int | m_seconds |
| The number of seconds after the epoch. More... | |
Detailed Description
Represents a point in time.
Seconds from an unspecified monday at 00:00 (epoch).
Constructor & Destructor Documentation
◆ TimePoint() [1/2]
|
default |
Default ctor, unitinialized.
◆ TimePoint() [2/2]
|
inlineexplicit |
Creates a TimePoint from a specified number of seconds.
- Parameters
-
[in] seconds The number of seconds after the epoch.
Member Function Documentation
◆ day_of_week()
|
inline |
Index of current day of the week (0,...,6 = Mo,...,Sun).
◆ days()
|
inline |
Time since the epoch in days.
◆ default_serialize()
|
inline |
This method is used by the default serialization feature.
◆ hour_of_day()
|
inline |
Hour in the current day (0 - 23).
◆ hours()
|
inline |
Time since the epoch in hours.
◆ is_weekend()
|
inline |
If the current time is on a weekend, e.g.
day_of_the_week is 5 = Sat or 6 = Sun.
◆ operator!=()
|
inline |
◆ operator+()
Add or subtract a TimeSpan.
◆ operator+=()
◆ operator-() [1/2]
◆ operator-() [2/2]
Add or subtract a TimeSpan.
◆ operator-=()
◆ operator<()
|
inline |
◆ operator<=()
|
inline |
◆ operator==()
|
inline |
◆ operator>()
|
inline |
◆ operator>=()
|
inline |
◆ seconds()
|
inline |
Time since the epoch in seconds.
◆ time_since_midnight()
|
inline |
Time since midnight.
Member Data Documentation
◆ m_seconds
|
private |
The number of seconds after the epoch.
Generated by