|
Sparkle 0.0.1
|
Point in time with conversion helpers and arithmetic with Duration. More...
#include <spk_timestamp.hpp>

Public Member Functions | |
| Timestamp () | |
| Captures current time in nanoseconds. | |
| Timestamp (long double p_value, TimeUnit p_unit) | |
| Builds a timestamp from a raw value and unit. | |
| Timestamp (const Duration &p_duration) | |
| Builds a timestamp located after the origin by the given duration. | |
| Timestamp (const Timestamp &p_other) | |
| Copies timestamp value and caches from another instance. | |
| Timestamp (Timestamp &&p_other) noexcept | |
| Moves timestamp value and caches from another instance. | |
| Timestamp & | operator= (const Timestamp &p_other) |
| Copies timestamp value and caches from another instance. | |
| Timestamp & | operator= (Timestamp &&p_other) noexcept |
| Moves timestamp value and caches from another instance. | |
| double | seconds () const |
| Returns the timestamp expressed in seconds. | |
| long long | milliseconds () const |
| Returns the timestamp expressed in milliseconds. | |
| long long | nanoseconds () const |
| Returns the timestamp expressed in nanoseconds. | |
| Duration | operator- (const Timestamp &p_other) const |
| Computes the duration separating two timestamps. | |
| Timestamp | operator+ (const Duration &p_other) const |
| Shifts the timestamp forward by a duration. | |
| Timestamp | operator- (const Duration &p_other) const |
| Shifts the timestamp backward by a duration. | |
| Timestamp & | operator+= (const Duration &p_other) |
| Adds a duration to this timestamp in place. | |
| Timestamp & | operator-= (const Duration &p_other) |
| Subtracts a duration from this timestamp in place. | |
| bool | operator== (const Timestamp &p_other) const |
| Equality comparison using canonical nanoseconds. | |
| bool | operator!= (const Timestamp &p_other) const |
| Inequality comparison using canonical nanoseconds. | |
| bool | operator< (const Timestamp &p_other) const |
| Strictly-less comparison using canonical nanoseconds. | |
| bool | operator> (const Timestamp &p_other) const |
| Strictly-greater comparison using canonical nanoseconds. | |
| bool | operator<= (const Timestamp &p_other) const |
| Less-or-equal comparison using canonical nanoseconds. | |
| bool | operator>= (const Timestamp &p_other) const |
| Greater-or-equal comparison using canonical nanoseconds. | |
Point in time with conversion helpers and arithmetic with Duration.
| spk::Timestamp::Timestamp | ( | long double | p_value, |
| TimeUnit | p_unit ) |
Builds a timestamp from a raw value and unit.
| p_value | Numeric representation of the moment. |
| p_unit | Unit associated with the value. |
| spk::Timestamp::Timestamp | ( | const Duration & | p_duration | ) |
Builds a timestamp located after the origin by the given duration.
| p_duration | Offset from the origin time. |

| spk::Timestamp::Timestamp | ( | const Timestamp & | p_other | ) |
Copies timestamp value and caches from another instance.
| p_other | Timestamp to copy. |

|
noexcept |
Moves timestamp value and caches from another instance.
| p_other | Timestamp to move. |

| long long spk::Timestamp::milliseconds | ( | ) | const |
Returns the timestamp expressed in milliseconds.
| long long spk::Timestamp::nanoseconds | ( | ) | const |
Returns the timestamp expressed in nanoseconds.

| bool spk::Timestamp::operator!= | ( | const Timestamp & | p_other | ) | const |
Inequality comparison using canonical nanoseconds.
| p_other | Timestamp to compare. |

Shifts the timestamp forward by a duration.
| p_other | Duration to add. |

Adds a duration to this timestamp in place.
| p_other | Duration to add. |

Shifts the timestamp backward by a duration.
| p_other | Duration to subtract. |

Subtracts a duration from this timestamp in place.
| p_other | Duration to subtract. |

| bool spk::Timestamp::operator< | ( | const Timestamp & | p_other | ) | const |
Strictly-less comparison using canonical nanoseconds.
| p_other | Timestamp to compare. |

| bool spk::Timestamp::operator<= | ( | const Timestamp & | p_other | ) | const |
Less-or-equal comparison using canonical nanoseconds.
| p_other | Timestamp to compare. |

Copies timestamp value and caches from another instance.
| p_other | Timestamp to copy. |

Moves timestamp value and caches from another instance.
| p_other | Timestamp to move. |

| bool spk::Timestamp::operator== | ( | const Timestamp & | p_other | ) | const |
Equality comparison using canonical nanoseconds.
| p_other | Timestamp to compare. |

| bool spk::Timestamp::operator> | ( | const Timestamp & | p_other | ) | const |
Strictly-greater comparison using canonical nanoseconds.
| p_other | Timestamp to compare. |

| bool spk::Timestamp::operator>= | ( | const Timestamp & | p_other | ) | const |
Greater-or-equal comparison using canonical nanoseconds.
| p_other | Timestamp to compare. |

| double spk::Timestamp::seconds | ( | ) | const |
Returns the timestamp expressed in seconds.