Timespan
Timespan
#include <icy/datetime.h>class TimespanDefined in src/base/include/icy/datetime.h:119
A class that represents time spans up to microsecond resolution.
List of all members
| Name | Kind | Owner |
|---|---|---|
Timespan | function | Declared here |
Timespan | function | Declared here |
Timespan | function | Declared here |
Timespan | function | Declared here |
Timespan | function | Declared here |
~Timespan | function | Declared here |
operator= | function | Declared here |
operator= | function | Declared here |
assign | function | Declared here |
assign | function | Declared here |
swap | function | Declared here |
operator== | function | Declared here |
operator!= | function | Declared here |
operator> | function | Declared here |
operator>= | function | Declared here |
operator< | function | Declared here |
operator<= | function | Declared here |
operator== | function | Declared here |
operator!= | function | Declared here |
operator> | function | Declared here |
operator>= | function | Declared here |
operator< | function | Declared here |
operator<= | function | Declared here |
operator+ | function | Declared here |
operator- | function | Declared here |
operator+= | function | Declared here |
operator-= | function | Declared here |
operator+ | function | Declared here |
operator- | function | Declared here |
operator+= | function | Declared here |
operator-= | function | Declared here |
days | function | Declared here |
hours | function | Declared here |
totalHours | function | Declared here |
minutes | function | Declared here |
totalMinutes | function | Declared here |
seconds | function | Declared here |
totalSeconds | function | Declared here |
milliseconds | function | Declared here |
totalMilliseconds | function | Declared here |
microseconds | function | Declared here |
useconds | function | Declared here |
totalMicroseconds | function | Declared here |
MILLISECONDS | variable | Declared here |
SECONDS | variable | Declared here |
MINUTES | variable | Declared here |
HOURS | variable | Declared here |
DAYS | variable | Declared here |
TimeDiff | typedef | Declared here |
_span | variable | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
Timespan | Creates a zero Timespan. | |
Timespan | Creates a Timespan. | |
Timespan | Creates a Timespan. Useful for creating a Timespan from a struct timeval. | |
Timespan | Creates a Timespan. | |
Timespan | Creates a Timespan from another one. | |
~Timespan | Destroys the Timespan. | |
Timespan & | operator= | Assignment operator. |
Timespan & | operator= | Assignment operator. |
Timespan & | assign | Assigns a new span. |
Timespan & | assign | Assigns a new span. Useful for assigning from a struct timeval. |
void | swap | Swaps the Timespan with another one. |
bool | operator== const inline | |
bool | operator!= const inline | |
bool | operator> const inline | |
bool | operator>= const inline | |
bool | operator< const inline | |
bool | operator<= const inline | |
bool | operator== const inline | |
bool | operator!= const inline | |
bool | operator> const inline | |
bool | operator>= const inline | |
bool | operator< const inline | |
bool | operator<= const inline | |
Timespan | operator+ const | |
Timespan | operator- const | |
Timespan & | operator+= | |
Timespan & | operator-= | |
Timespan | operator+ const | |
Timespan | operator- const | |
Timespan & | operator+= | |
Timespan & | operator-= | |
int | days const inline | Returns the number of days. |
int | hours const inline | Returns the number of hours (0 to 23). |
int | totalHours const inline | Returns the total number of hours. |
int | minutes const inline | Returns the number of minutes (0 to 59). |
int | totalMinutes const inline | Returns the total number of minutes. |
int | seconds const inline | Returns the number of seconds (0 to 59). |
int | totalSeconds const inline | Returns the total number of seconds. |
int | milliseconds const inline | Returns the number of milliseconds (0 to 999). |
TimeDiff | totalMilliseconds const inline | Returns the total number of milliseconds. |
int | microseconds const inline | Returns the fractions of a millisecond in microseconds (0 to 999). |
int | useconds const inline | Returns the fractions of a second in microseconds (0 to 999999). |
TimeDiff | totalMicroseconds const inline | Returns the total number of microseconds. |
Timespan
Timespan()Defined in src/base/include/icy/datetime.h:125
Creates a zero Timespan.
Timespan
Timespan(TimeDiff microseconds)Defined in src/base/include/icy/datetime.h:128
Creates a Timespan.
Timespan
Timespan(long seconds, long microseconds)Defined in src/base/include/icy/datetime.h:132
Creates a Timespan. Useful for creating a Timespan from a struct timeval.
Timespan
Timespan(int days, int hours, int minutes, int seconds, int microseconds)Defined in src/base/include/icy/datetime.h:135
Creates a Timespan.
Timespan
Timespan(const Timespan & timespan)Defined in src/base/include/icy/datetime.h:138
Creates a Timespan from another one.
~Timespan
~Timespan()Defined in src/base/include/icy/datetime.h:141
Destroys the Timespan.
operator=
Timespan & operator=(const Timespan & timespan)Defined in src/base/include/icy/datetime.h:144
Assignment operator.
operator=
Timespan & operator=(TimeDiff microseconds)Defined in src/base/include/icy/datetime.h:147
Assignment operator.
assign
Timespan & assign(int days, int hours, int minutes, int seconds, int microseconds)Defined in src/base/include/icy/datetime.h:150
Assigns a new span.
assign
Timespan & assign(long seconds, long microseconds)Defined in src/base/include/icy/datetime.h:154
Assigns a new span. Useful for assigning from a struct timeval.
swap
void swap(Timespan & timespan)Defined in src/base/include/icy/datetime.h:157
Swaps the Timespan with another one.
operator==
const inline
inline bool operator==(const Timespan & ts) constDefined in src/base/include/icy/datetime.h:159
operator!=
const inline
inline bool operator!=(const Timespan & ts) constDefined in src/base/include/icy/datetime.h:160
operator>
const inline
inline bool operator>(const Timespan & ts) constDefined in src/base/include/icy/datetime.h:161
operator>=
const inline
inline bool operator>=(const Timespan & ts) constDefined in src/base/include/icy/datetime.h:162
operator<
const inline
inline bool operator<(const Timespan & ts) constDefined in src/base/include/icy/datetime.h:163
operator<=
const inline
inline bool operator<=(const Timespan & ts) constDefined in src/base/include/icy/datetime.h:164
operator==
const inline
inline bool operator==(TimeDiff microseconds) constDefined in src/base/include/icy/datetime.h:166
operator!=
const inline
inline bool operator!=(TimeDiff microseconds) constDefined in src/base/include/icy/datetime.h:167
operator>
const inline
inline bool operator>(TimeDiff microseconds) constDefined in src/base/include/icy/datetime.h:168
operator>=
const inline
inline bool operator>=(TimeDiff microseconds) constDefined in src/base/include/icy/datetime.h:169
operator<
const inline
inline bool operator<(TimeDiff microseconds) constDefined in src/base/include/icy/datetime.h:170
operator<=
const inline
inline bool operator<=(TimeDiff microseconds) constDefined in src/base/include/icy/datetime.h:171
operator+
const
Timespan operator+(const Timespan & d) constDefined in src/base/include/icy/datetime.h:173
operator-
const
Timespan operator-(const Timespan & d) constDefined in src/base/include/icy/datetime.h:174
operator+=
Timespan & operator+=(const Timespan & d)Defined in src/base/include/icy/datetime.h:175
operator-=
Timespan & operator-=(const Timespan & d)Defined in src/base/include/icy/datetime.h:176
operator+
const
Timespan operator+(TimeDiff microseconds) constDefined in src/base/include/icy/datetime.h:178
operator-
const
Timespan operator-(TimeDiff microseconds) constDefined in src/base/include/icy/datetime.h:179
operator+=
Timespan & operator+=(TimeDiff microseconds)Defined in src/base/include/icy/datetime.h:180
operator-=
Timespan & operator-=(TimeDiff microseconds)Defined in src/base/include/icy/datetime.h:181
days
const inline
inline int days() constDefined in src/base/include/icy/datetime.h:184
Returns the number of days.
hours
const inline
inline int hours() constDefined in src/base/include/icy/datetime.h:187
Returns the number of hours (0 to 23).
totalHours
const inline
inline int totalHours() constDefined in src/base/include/icy/datetime.h:190
Returns the total number of hours.
minutes
const inline
inline int minutes() constDefined in src/base/include/icy/datetime.h:193
Returns the number of minutes (0 to 59).
totalMinutes
const inline
inline int totalMinutes() constDefined in src/base/include/icy/datetime.h:196
Returns the total number of minutes.
seconds
const inline
inline int seconds() constDefined in src/base/include/icy/datetime.h:199
Returns the number of seconds (0 to 59).
totalSeconds
const inline
inline int totalSeconds() constDefined in src/base/include/icy/datetime.h:202
Returns the total number of seconds.
milliseconds
const inline
inline int milliseconds() constDefined in src/base/include/icy/datetime.h:205
Returns the number of milliseconds (0 to 999).
totalMilliseconds
const inline
inline TimeDiff totalMilliseconds() constDefined in src/base/include/icy/datetime.h:208
Returns the total number of milliseconds.
microseconds
const inline
inline int microseconds() constDefined in src/base/include/icy/datetime.h:212
Returns the fractions of a millisecond in microseconds (0 to 999).
useconds
const inline
inline int useconds() constDefined in src/base/include/icy/datetime.h:216
Returns the fractions of a second in microseconds (0 to 999999).
totalMicroseconds
const inline
inline TimeDiff totalMicroseconds() constDefined in src/base/include/icy/datetime.h:219
Returns the total number of microseconds.
Public Static Attributes
| Return | Name | Description |
|---|---|---|
const TimeDiff | MILLISECONDS static | The number of microseconds in a millisecond. |
const TimeDiff | SECONDS static | The number of microseconds in a second. |
const TimeDiff | MINUTES static | The number of microseconds in a minute. |
const TimeDiff | HOURS static | The number of microseconds in a hour. |
const TimeDiff | DAYS static | The number of microseconds in a day. |
MILLISECONDS
static
const TimeDiff MILLISECONDSDefined in src/base/include/icy/datetime.h:221
The number of microseconds in a millisecond.
SECONDS
static
const TimeDiff SECONDSDefined in src/base/include/icy/datetime.h:222
The number of microseconds in a second.
MINUTES
static
const TimeDiff MINUTESDefined in src/base/include/icy/datetime.h:223
The number of microseconds in a minute.
HOURS
static
const TimeDiff HOURSDefined in src/base/include/icy/datetime.h:224
The number of microseconds in a hour.
DAYS
static
const TimeDiff DAYSDefined in src/base/include/icy/datetime.h:225
The number of microseconds in a day.
Public Types
| Name | Description |
|---|---|
TimeDiff |
TimeDiff
using TimeDiff = Timestamp::TimeDiffDefined in src/base/include/icy/datetime.h:122
Private Attributes
| Return | Name | Description |
|---|---|---|
TimeDiff | _span |
_span
TimeDiff _span