ALib C++ Library
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::strings::util::CalendarDuration Class Reference

Description:

This class represents a time span, measured in human units like days, hours, minutes and so on. Besides conversion from and to nanoseconds, conversions from and to objects of types DateTime::Duration and Ticks::Duration is supported.

Definition at line 181 of file calendar.inl.

Public Field Index:

int Days
 The number of days within the duration.
 
int Hours
 The number of hours (not the total, hence 0-23) within the duration.
 
int Microseconds
 The number of microseconds (not the total, hence 0-999) within the duration.
 
int Milliseconds
 The number of milliseconds (not the total, hence 0-999) within the duration.
 
int Minutes
 The number of minutes (not the total, hence 0-59) within the duration.
 
int Nanoseconds
 The number of nanoseconds (not the total, hence 0-999) within the duration.
 
int Seconds
 The number of seconds (not the total, hence 0-59) within the duration.
 

Public Method Index:

 CalendarDuration (DateTime::Duration duration)
 
 CalendarDuration (int64_t nanos)
 
 CalendarDuration (lang::Initialization init=lang::Initialization::Default)
 
 CalendarDuration (Ticks::Duration duration)
 
ALIB_DLL void Clear ()
 Sets all public values to 0.
 
void FromDuration (DateTime::Duration duration)
 
void FromDuration (Ticks::Duration duration)
 
ALIB_DLL void FromNanoSeconds (int64_t nanos)
 
DateTime::Duration ToDateTimeDuration ()
 
ALIB_DLL int64_t ToNanoSeconds ()
 
Ticks::Duration ToTicksDuration ()
 

Field Details:

◆ Days

int alib::strings::util::CalendarDuration::Days

The number of days within the duration.

Definition at line 185 of file calendar.inl.

◆ Hours

int alib::strings::util::CalendarDuration::Hours

The number of hours (not the total, hence 0-23) within the duration.

Definition at line 188 of file calendar.inl.

◆ Microseconds

int alib::strings::util::CalendarDuration::Microseconds

The number of microseconds (not the total, hence 0-999) within the duration.

Definition at line 200 of file calendar.inl.

◆ Milliseconds

int alib::strings::util::CalendarDuration::Milliseconds

The number of milliseconds (not the total, hence 0-999) within the duration.

Definition at line 197 of file calendar.inl.

◆ Minutes

int alib::strings::util::CalendarDuration::Minutes

The number of minutes (not the total, hence 0-59) within the duration.

Definition at line 191 of file calendar.inl.

◆ Nanoseconds

int alib::strings::util::CalendarDuration::Nanoseconds

The number of nanoseconds (not the total, hence 0-999) within the duration.

Definition at line 203 of file calendar.inl.

◆ Seconds

int alib::strings::util::CalendarDuration::Seconds

The number of seconds (not the total, hence 0-59) within the duration.

Definition at line 194 of file calendar.inl.

Constructor(s) / Destructor Details:

◆ CalendarDuration() [1/4]

alib::strings::util::CalendarDuration::CalendarDuration ( lang::Initialization init = lang::Initialization::Default)
inline

Constructs the object to represent a duration of 0. (Sets all public fields to 0.)

Parameters
initIf Initialization::Default or Nulled, Clear is invoked. Otherwise fields are not initialized. Defaults to Initialization::Default.

Definition at line 209 of file calendar.inl.

Here is the call graph for this function:

◆ CalendarDuration() [2/4]

alib::strings::util::CalendarDuration::CalendarDuration ( int64_t nanos)
inline

Constructs the object using the given duration measured in nanoseconds. Invokes FromNanoSeconds.

Parameters
nanosThe duration to use for setting the public fields.

Definition at line 218 of file calendar.inl.

Here is the call graph for this function:

◆ CalendarDuration() [3/4]

alib::strings::util::CalendarDuration::CalendarDuration ( DateTime::Duration duration)
inline

Constructs the object using the given duration object. Invokes FromDuration.

Parameters
durationThe duration to use for setting the public fields.

Definition at line 223 of file calendar.inl.

Here is the call graph for this function:

◆ CalendarDuration() [4/4]

alib::strings::util::CalendarDuration::CalendarDuration ( Ticks::Duration duration)
inline

Constructs the object using the given duration object. Invokes FromDuration.

Parameters
durationThe duration to use for setting the public fields.

Definition at line 228 of file calendar.inl.

Here is the call graph for this function:

Method Details:

◆ Clear()

void alib::strings::util::CalendarDuration::Clear ( )

Sets all public values to 0.

Definition at line 162 of file calendar.cpp.

◆ FromDuration() [1/2]

void alib::strings::util::CalendarDuration::FromDuration ( DateTime::Duration duration)
inline

Sets the public fields to represent the given duration value. The state of the object will hereafter be the same as it was when constructed with the same parameter.

Parameters
durationThe duration to use for setting the public fields.

Definition at line 234 of file calendar.inl.

Here is the call graph for this function:

◆ FromDuration() [2/2]

void alib::strings::util::CalendarDuration::FromDuration ( Ticks::Duration duration)
inline

Sets the public fields to represent the given duration value. The state of the object will hereafter be the same as it was when constructed with the same parameter.

Parameters
durationThe duration to use for setting the public fields.

Definition at line 241 of file calendar.inl.

Here is the call graph for this function:

◆ FromNanoSeconds()

void alib::strings::util::CalendarDuration::FromNanoSeconds ( int64_t nanos)

Sets the public fields to represent the given duration value. The state of the object will hereafter be the same as it was when constructed with the same parameter.

Parameters
nanosThe duration to use for setting the public fields.

Definition at line 179 of file calendar.cpp.

Here is the call graph for this function:

◆ ToDateTimeDuration()

DateTime::Duration alib::strings::util::CalendarDuration::ToDateTimeDuration ( )
inline

Takes the current values of the public fields and returns a duration value compatible with class DateTime.

Returns
The duration represented by the public fields of this class.

Definition at line 247 of file calendar.inl.

Here is the call graph for this function:

◆ ToNanoSeconds()

int64_t alib::strings::util::CalendarDuration::ToNanoSeconds ( )

Takes the current values of the public fields and returns the duration.

Returns
The duration represented by the public fields of this class in nanoseconds.

Definition at line 190 of file calendar.cpp.

◆ ToTicksDuration()

Ticks::Duration alib::strings::util::CalendarDuration::ToTicksDuration ( )
inline

Takes the current values of the public fields and returns a duration value compatible with class Ticks.

Returns
The duration represented by the public fields of this class.

Definition at line 253 of file calendar.inl.

Here is the call graph for this function:

The documentation for this class was generated from the following files: