Home
Base module

Timespan

A class that represents time spans up to microsecond resolution.

Timespan

#include <icy/datetime.h>
class Timespan

Defined in src/base/include/icy/datetime.h:119

A class that represents time spans up to microsecond resolution.

List of all members

NameKindOwner
TimespanfunctionDeclared here
TimespanfunctionDeclared here
TimespanfunctionDeclared here
TimespanfunctionDeclared here
TimespanfunctionDeclared here
~TimespanfunctionDeclared here
operator=functionDeclared here
operator=functionDeclared here
assignfunctionDeclared here
assignfunctionDeclared here
swapfunctionDeclared here
operator==functionDeclared here
operator!=functionDeclared here
operator>functionDeclared here
operator>=functionDeclared here
operator<functionDeclared here
operator<=functionDeclared here
operator==functionDeclared here
operator!=functionDeclared here
operator>functionDeclared here
operator>=functionDeclared here
operator<functionDeclared here
operator<=functionDeclared here
operator+functionDeclared here
operator-functionDeclared here
operator+=functionDeclared here
operator-=functionDeclared here
operator+functionDeclared here
operator-functionDeclared here
operator+=functionDeclared here
operator-=functionDeclared here
daysfunctionDeclared here
hoursfunctionDeclared here
totalHoursfunctionDeclared here
minutesfunctionDeclared here
totalMinutesfunctionDeclared here
secondsfunctionDeclared here
totalSecondsfunctionDeclared here
millisecondsfunctionDeclared here
totalMillisecondsfunctionDeclared here
microsecondsfunctionDeclared here
usecondsfunctionDeclared here
totalMicrosecondsfunctionDeclared here
MILLISECONDSvariableDeclared here
SECONDSvariableDeclared here
MINUTESvariableDeclared here
HOURSvariableDeclared here
DAYSvariableDeclared here
TimeDifftypedefDeclared here
_spanvariableDeclared here

Public Methods

ReturnNameDescription
TimespanCreates a zero Timespan.
TimespanCreates a Timespan.
TimespanCreates a Timespan. Useful for creating a Timespan from a struct timeval.
TimespanCreates a Timespan.
TimespanCreates a Timespan from another one.
~TimespanDestroys the Timespan.
Timespan &operator=Assignment operator.
Timespan &operator=Assignment operator.
Timespan &assignAssigns a new span.
Timespan &assignAssigns a new span. Useful for assigning from a struct timeval.
voidswapSwaps the Timespan with another one.
booloperator== const inline
booloperator!= const inline
booloperator> const inline
booloperator>= const inline
booloperator< const inline
booloperator<= const inline
booloperator== const inline
booloperator!= const inline
booloperator> const inline
booloperator>= const inline
booloperator< const inline
booloperator<= const inline
Timespanoperator+ const
Timespanoperator- const
Timespan &operator+=
Timespan &operator-=
Timespanoperator+ const
Timespanoperator- const
Timespan &operator+=
Timespan &operator-=
intdays const inlineReturns the number of days.
inthours const inlineReturns the number of hours (0 to 23).
inttotalHours const inlineReturns the total number of hours.
intminutes const inlineReturns the number of minutes (0 to 59).
inttotalMinutes const inlineReturns the total number of minutes.
intseconds const inlineReturns the number of seconds (0 to 59).
inttotalSeconds const inlineReturns the total number of seconds.
intmilliseconds const inlineReturns the number of milliseconds (0 to 999).
TimeDifftotalMilliseconds const inlineReturns the total number of milliseconds.
intmicroseconds const inlineReturns the fractions of a millisecond in microseconds (0 to 999).
intuseconds const inlineReturns the fractions of a second in microseconds (0 to 999999).
TimeDifftotalMicroseconds const inlineReturns 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) const

Defined in src/base/include/icy/datetime.h:159


operator!=

const inline

inline bool operator!=(const Timespan & ts) const

Defined in src/base/include/icy/datetime.h:160


operator>

const inline

inline bool operator>(const Timespan & ts) const

Defined in src/base/include/icy/datetime.h:161


operator>=

const inline

inline bool operator>=(const Timespan & ts) const

Defined in src/base/include/icy/datetime.h:162


operator<

const inline

inline bool operator<(const Timespan & ts) const

Defined in src/base/include/icy/datetime.h:163


operator<=

const inline

inline bool operator<=(const Timespan & ts) const

Defined in src/base/include/icy/datetime.h:164


operator==

const inline

inline bool operator==(TimeDiff microseconds) const

Defined in src/base/include/icy/datetime.h:166


operator!=

const inline

inline bool operator!=(TimeDiff microseconds) const

Defined in src/base/include/icy/datetime.h:167


operator>

const inline

inline bool operator>(TimeDiff microseconds) const

Defined in src/base/include/icy/datetime.h:168


operator>=

const inline

inline bool operator>=(TimeDiff microseconds) const

Defined in src/base/include/icy/datetime.h:169


operator<

const inline

inline bool operator<(TimeDiff microseconds) const

Defined in src/base/include/icy/datetime.h:170


operator<=

const inline

inline bool operator<=(TimeDiff microseconds) const

Defined in src/base/include/icy/datetime.h:171


operator+

const

Timespan operator+(const Timespan & d) const

Defined in src/base/include/icy/datetime.h:173


operator-

const

Timespan operator-(const Timespan & d) const

Defined 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) const

Defined in src/base/include/icy/datetime.h:178


operator-

const

Timespan operator-(TimeDiff microseconds) const

Defined 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() const

Defined in src/base/include/icy/datetime.h:184

Returns the number of days.


hours

const inline

inline int hours() const

Defined in src/base/include/icy/datetime.h:187

Returns the number of hours (0 to 23).


totalHours

const inline

inline int totalHours() const

Defined in src/base/include/icy/datetime.h:190

Returns the total number of hours.


minutes

const inline

inline int minutes() const

Defined in src/base/include/icy/datetime.h:193

Returns the number of minutes (0 to 59).


totalMinutes

const inline

inline int totalMinutes() const

Defined in src/base/include/icy/datetime.h:196

Returns the total number of minutes.


seconds

const inline

inline int seconds() const

Defined in src/base/include/icy/datetime.h:199

Returns the number of seconds (0 to 59).


totalSeconds

const inline

inline int totalSeconds() const

Defined in src/base/include/icy/datetime.h:202

Returns the total number of seconds.


milliseconds

const inline

inline int milliseconds() const

Defined in src/base/include/icy/datetime.h:205

Returns the number of milliseconds (0 to 999).


totalMilliseconds

const inline

inline TimeDiff totalMilliseconds() const

Defined in src/base/include/icy/datetime.h:208

Returns the total number of milliseconds.


microseconds

const inline

inline int microseconds() const

Defined 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() const

Defined 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() const

Defined in src/base/include/icy/datetime.h:219

Returns the total number of microseconds.

Public Static Attributes

ReturnNameDescription
const TimeDiffMILLISECONDS staticThe number of microseconds in a millisecond.
const TimeDiffSECONDS staticThe number of microseconds in a second.
const TimeDiffMINUTES staticThe number of microseconds in a minute.
const TimeDiffHOURS staticThe number of microseconds in a hour.
const TimeDiffDAYS staticThe number of microseconds in a day.

MILLISECONDS

static

const TimeDiff MILLISECONDS

Defined in src/base/include/icy/datetime.h:221

The number of microseconds in a millisecond.


SECONDS

static

const TimeDiff SECONDS

Defined in src/base/include/icy/datetime.h:222

The number of microseconds in a second.


MINUTES

static

const TimeDiff MINUTES

Defined in src/base/include/icy/datetime.h:223

The number of microseconds in a minute.


HOURS

static

const TimeDiff HOURS

Defined in src/base/include/icy/datetime.h:224

The number of microseconds in a hour.


DAYS

static

const TimeDiff DAYS

Defined in src/base/include/icy/datetime.h:225

The number of microseconds in a day.

Public Types

NameDescription
TimeDiff

TimeDiff

using TimeDiff = Timestamp::TimeDiff

Defined in src/base/include/icy/datetime.h:122

Private Attributes

ReturnNameDescription
TimeDiff_span

_span

TimeDiff _span

Defined in src/base/include/icy/datetime.h:228