MIRA
|
Use this class to represent time durations. More...
#include <utils/Time.h>
Public Member Functions | |
Duration (hour_type hour, min_type min, sec_type sec, fractional_seconds_type fs=0) | |
Duration (const Base &d) | |
Construct from base class. More... | |
Duration (const boost::posix_time::special_values sv) | |
Construct from special value. More... | |
Duration () | |
Default constructor constructs to Duration of 0 length. More... | |
template<typename Reflector > | |
MIRA_SPLIT_REFLECT_MEMBER void | reflectRead (Reflector &r) |
Reflect. More... | |
template<typename Reflector > | |
void | reflectWrite (Reflector &r) |
bool | isValid () const |
Checks if this duration is invalid. More... | |
bool | isInfinity () const |
Checks if this duration is infinity. More... | |
hour_type | hours () const |
Returns number of hours in the duration. More... | |
min_type | minutes () const |
Returns normalized number of minutes (0..59) More... | |
sec_type | seconds () const |
Returns normalized number of seconds (0..59) More... | |
tick_type | milliseconds () const |
Returns normalized number of milliseconds (0..999) More... | |
tick_type | microseconds () const |
Returns normalized number of microseconds (0..999) More... | |
tick_type | nanoseconds () const |
Returns normalized number of nanoseconds (0..999) 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... | |
Protected Types | |
typedef boost::posix_time::time_duration | Base |
Use this class to represent time durations.
Time durations can be added to each other and to Time objects. For specifying time durations you can use microseconds, milliseconds, seconds, minutes and hours. The underlying class is boost::posix_time::time_duration. For documentation see http://boost.org/doc/libs/1_44_0/doc/html/date_time/posix_time.html .
|
protected |
|
inline |
|
inline |
Construct from special value.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Can be used to construct a Duration object that is specified in seconds.
e.g:
Durations can also be added:
|
inlinestatic |
|
inlinestatic |
|
inline |
Reflect.
|
inline |
|
inlinestatic |
Returns a special duration time representing negative infinity.
|
inlinestatic |
Returns a special duration time representing positive infinity.
|
inlinestatic |
Returns an invalid duration.
|
inline |
Checks if this duration is invalid.
|
inline |
Checks if this duration is infinity.
|
inline |
Returns number of hours in the duration.
|
inline |
Returns normalized number of minutes (0..59)
|
inline |
Returns normalized number of seconds (0..59)
|
inline |
Returns normalized number of milliseconds (0..999)
|
inline |
Returns normalized number of microseconds (0..999)
|
inline |
Returns normalized number of nanoseconds (0..999)
|
inline |
Returns total number of seconds truncating any fractional seconds.
|
inline |
Returns total number of milliseconds truncating any fractional milliseconds.
|
inline |
Returns total number of microseconds truncating any fractional microseconds.
|
inline |
Returns total number of nanoseconds truncating any fractional nanoseconds.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Division operations on a duration with an integer.
|
inline |
|
inline |
Multiplication operations an a duration with an integer.
|
inline |
|
inline |
|
inline |