MIRA
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Duration< AsString > Class Template Reference

Derivation of mira::Duration with human-readable serialization. More...

#include <utils/TimeHumanReadable.h>

Inheritance diagram for Duration< AsString >:
Inheritance graph
[legend]

Public Types

typedef mira::Duration Base
 

Public Member Functions

 Duration ()
 
 Duration (const Base &date)
 
template<typename Reflector >
MIRA_SPLIT_REFLECT_MEMBER void reflectRead (Reflector &r)
 
template<typename Reflector >
void reflectWrite (Reflector &r)
 
tick_type nanoseconds () const
 Returns normalized number of nanoseconds (0..999) More...
 
tick_type microseconds () const
 Returns normalized number of microseconds (0..999) More...
 
tick_type milliseconds () const
 Returns normalized number of milliseconds (0..999) More...
 
sec_type seconds () const
 Returns normalized number of seconds (0..59) More...
 
min_type minutes () const
 Returns normalized number of minutes (0..59) More...
 
hour_type hours () const
 Returns number of hours in the duration. More...
 
bool isValid () const
 Checks if this duration is invalid. More...
 
bool isInfinity () const
 Checks if this duration is infinity. More...
 
sec_type totalSeconds () const
 Returns total number of seconds truncating any fractional seconds. More...
 
tick_type totalMilliseconds () const
 Returns total number of milliseconds truncating any fractional milliseconds. More...
 
tick_type totalMicroseconds () const
 Returns total number of microseconds truncating any fractional microseconds. More...
 
tick_type totalNanoseconds () const
 Returns total number of nanoseconds truncating any fractional nanoseconds. More...
 
Operators
Duration operator- () const
 
Duration operator- (const Duration &d) const
 
Duration operator+ (const Duration &d) const
 
Duration operator/ (int divisor) const
 
Duration operator/ (float divisor) const
 
float operator/ (Duration other) const
 
Duration operator-= (const Duration &d)
 
Duration operator+= (const Duration &d)
 
Duration operator/= (int divisor)
 Division operations on a duration with an integer. More...
 
Duration operator/= (float divisor)
 
Duration operator* (int rhs) const
 Multiplication operations an a duration with an integer. More...
 
Duration operator* (float rhs) const
 
Duration operator*= (int rhs)
 
Duration operator*= (float rhs)
 

Static Public Member Functions

static Duration nanoseconds (int64 v)
 Can be used to construct a Duration object that is specified in nanoseconds. More...
 
static Duration microseconds (int64 v)
 Can be used to construct a Duration object that is specified in microseconds. More...
 
static Duration milliseconds (int64 v)
 Can be used to construct a Duration object that is specified in milliseconds. More...
 
static Duration seconds (int32 v)
 Can be used to construct a Duration object that is specified in seconds. More...
 
static Duration minutes (int32 v)
 Can be used to construct a Duration object that is specified in minutes. More...
 
static Duration hours (int32 v)
 Can be used to construct a Duration object that is specified in hours. More...
 
static Duration negativeInfinity ()
 Returns a special duration time representing negative infinity. More...
 
static Duration infinity ()
 Returns a special duration time representing positive infinity. More...
 
static Duration invalid ()
 Returns an invalid duration. More...
 

Detailed Description

template<bool AsString = true>
class mira::HumanReadableSerialization::Duration< AsString >

Derivation of mira::Duration with human-readable serialization.

Specialized as DurationSerializedAsIsoString, DurationSerializedAsHMS

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ Duration() [1/2]

Duration ( )
inline

◆ Duration() [2/2]

Duration ( const Base date)
inline

Member Function Documentation

◆ reflectRead()

MIRA_SPLIT_REFLECT_MEMBER void reflectRead ( Reflector &  r)
inline

◆ reflectWrite()

void reflectWrite ( Reflector &  r)
inline

◆ nanoseconds() [1/2]

static Duration nanoseconds ( int64  v)
inlinestaticinherited

Can be used to construct a Duration object that is specified in nanoseconds.

See also
seconds

◆ nanoseconds() [2/2]

tick_type nanoseconds ( ) const
inlineinherited

Returns normalized number of nanoseconds (0..999)

◆ microseconds() [1/2]

static Duration microseconds ( int64  v)
inlinestaticinherited

Can be used to construct a Duration object that is specified in microseconds.

See also
seconds

◆ microseconds() [2/2]

tick_type microseconds ( ) const
inlineinherited

Returns normalized number of microseconds (0..999)

◆ milliseconds() [1/2]

static Duration milliseconds ( int64  v)
inlinestaticinherited

Can be used to construct a Duration object that is specified in milliseconds.

See also
seconds

◆ milliseconds() [2/2]

tick_type milliseconds ( ) const
inlineinherited

Returns normalized number of milliseconds (0..999)

Examples:
tutorials/FloatProducer.C.

◆ seconds() [1/2]

static Duration seconds ( int32  v)
inlinestaticinherited

Can be used to construct a Duration object that is specified in seconds.

e.g:

Duration duration = Duration::seconds(20);

Durations can also be added:

◆ seconds() [2/2]

sec_type seconds ( ) const
inlineinherited

Returns normalized number of seconds (0..59)

◆ minutes() [1/2]

static Duration minutes ( int32  v)
inlinestaticinherited

Can be used to construct a Duration object that is specified in minutes.

See also
seconds

◆ minutes() [2/2]

min_type minutes ( ) const
inlineinherited

Returns normalized number of minutes (0..59)

◆ hours() [1/2]

static Duration hours ( int32  v)
inlinestaticinherited

Can be used to construct a Duration object that is specified in hours.

See also
seconds

◆ hours() [2/2]

hour_type hours ( ) const
inlineinherited

Returns number of hours in the duration.

◆ negativeInfinity()

static Duration negativeInfinity ( )
inlinestaticinherited

Returns a special duration time representing negative infinity.

◆ infinity()

static Duration infinity ( )
inlinestaticinherited

Returns a special duration time representing positive infinity.

◆ invalid()

static Duration invalid ( )
inlinestaticinherited

Returns an invalid duration.

◆ isValid()

bool isValid ( ) const
inlineinherited

Checks if this duration is invalid.

◆ isInfinity()

bool isInfinity ( ) const
inlineinherited

Checks if this duration is infinity.

◆ totalSeconds()

sec_type totalSeconds ( ) const
inlineinherited

Returns total number of seconds truncating any fractional seconds.

◆ totalMilliseconds()

tick_type totalMilliseconds ( ) const
inlineinherited

Returns total number of milliseconds truncating any fractional milliseconds.

◆ totalMicroseconds()

tick_type totalMicroseconds ( ) const
inlineinherited

Returns total number of microseconds truncating any fractional microseconds.

◆ totalNanoseconds()

tick_type totalNanoseconds ( ) const
inlineinherited

Returns total number of nanoseconds truncating any fractional nanoseconds.

◆ operator-() [1/2]

Duration operator- ( ) const
inlineinherited

◆ operator-() [2/2]

Duration operator- ( const Duration d) const
inlineinherited

◆ operator+()

Duration operator+ ( const Duration d) const
inlineinherited

◆ operator/() [1/3]

Duration operator/ ( int  divisor) const
inlineinherited

◆ operator/() [2/3]

Duration operator/ ( float  divisor) const
inlineinherited

◆ operator/() [3/3]

float operator/ ( Duration  other) const
inlineinherited

◆ operator-=()

Duration operator-= ( const Duration d)
inlineinherited

◆ operator+=()

Duration operator+= ( const Duration d)
inlineinherited

◆ operator/=() [1/2]

Duration operator/= ( int  divisor)
inlineinherited

Division operations on a duration with an integer.

◆ operator/=() [2/2]

Duration operator/= ( float  divisor)
inlineinherited

◆ operator*() [1/2]

Duration operator* ( int  rhs) const
inlineinherited

Multiplication operations an a duration with an integer.

◆ operator*() [2/2]

Duration operator* ( float  rhs) const
inlineinherited

◆ operator*=() [1/2]

Duration operator*= ( int  rhs)
inlineinherited

◆ operator*=() [2/2]

Duration operator*= ( float  rhs)
inlineinherited

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