Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::time::TimeOfDay Class Reference

A class that represents a particular moment within a 24-hour day to nanosecond resolution. More...

#include <omTimeOfDay.h>

Public Member Functions

 TimeOfDay ()
 Create a TimeOfDay object that represents the first moment after midnight of a day. More...
 
 TimeOfDay (UInt newHours, UInt newMinutes, UInt newSeconds, UInt32 newNanoseconds=0)
 Create a TimeOfDay object that represents the specified moment after midnight of a day. More...
 
UInt getHour () const
 Get the hour after midnight of this TimeOfDay. More...
 
void setHour (UInt newHours)
 Set the hour after midnight of this TimeOfDay. More...
 
UInt getMinute () const
 Get the minute after the start of the hour of this TimeOfDay. More...
 
void setMinute (UInt newMinutes)
 Set the minute after the start of the hour of this TimeOfDay. More...
 
UInt getSecond () const
 Get the seconds after the start of the minute of this TimeOfDay. More...
 
void setSecond (UInt newSeconds)
 Set the second after the start of the minute of this TimeOfDay. More...
 
UInt32 getNanoseconds () const
 Get the seconds after the start of the minute of this TimeOfDay. More...
 
void setNanoseconds (UInt32 newNanoseconds)
 Set the second after the start of the minute of this TimeOfDay. More...
 
data::String toString () const
 Convert the TimeOfDay object to a String representation. More...
 
 operator data::String () const
 Convert the TimeOfDay object to a String representation. More...
 

Detailed Description

A class that represents a particular moment within a 24-hour day to nanosecond resolution.

Constructor & Destructor Documentation

om::time::TimeOfDay::TimeOfDay ( )
inline

Create a TimeOfDay object that represents the first moment after midnight of a day.

om::time::TimeOfDay::TimeOfDay ( UInt  newHours,
UInt  newMinutes,
UInt  newSeconds,
UInt32  newNanoseconds = 0 
)

Create a TimeOfDay object that represents the specified moment after midnight of a day.

This time is specified by the hour after midnight [0,23], minute after the start of the hour [0,59], second after the start of the minute [0,59], and the nanoseconds after the start of the second [0,999999999]. If any of these values are outside of the valid range, they are wrapped around and carried into the next time measurement unit.

For instance, specifying a time of 0 hours, 59 minutes, 59 seconds, and 1.5e9 nanoseconds will result in an actual time of day of 1 hour, 0 minutes, 0 seconds, and 0.5e9 nanoseconds.

Member Function Documentation

UInt om::time::TimeOfDay::getHour ( ) const
inline

Get the hour after midnight of this TimeOfDay.

void om::time::TimeOfDay::setHour ( UInt  newHours)
inline

Set the hour after midnight of this TimeOfDay.

If the specified hour value is outside of the range [0,23], the value is wrapped around to the next day so that it lies within the valid range.

UInt om::time::TimeOfDay::getMinute ( ) const
inline

Get the minute after the start of the hour of this TimeOfDay.

void om::time::TimeOfDay::setMinute ( UInt  newMinutes)

Set the minute after the start of the hour of this TimeOfDay.

If the specified minute value is outside of the range [0,59], the value is wrapped around to the next hour (or further) and the hour of this TimeOfDay is increased by the required number of hours.

UInt om::time::TimeOfDay::getSecond ( ) const
inline

Get the seconds after the start of the minute of this TimeOfDay.

void om::time::TimeOfDay::setSecond ( UInt  newSeconds)

Set the second after the start of the minute of this TimeOfDay.

If the specified second value is outside of the range [0,59], the value is wrapped around to the next minute (or further) and the minute of this TimeOfDay is increased by the required number of minutes. If necessary, the hour of this TimeOfDay may also be altered if the wrap-around is sever enough.

UInt32 om::time::TimeOfDay::getNanoseconds ( ) const
inline

Get the seconds after the start of the minute of this TimeOfDay.

void om::time::TimeOfDay::setNanoseconds ( UInt32  newNanoseconds)

Set the second after the start of the minute of this TimeOfDay.

If the specified second value is outside of the range [0,59], the value is wrapped around to the next minute (or further) and the minute of this TimeOfDay is increased by the required number of minutes. If necessary, the hour of this TimeOfDay may also be altered if the wrap-around is sever enough.

data::String om::time::TimeOfDay::toString ( ) const

Convert the TimeOfDay object to a String representation.

om::time::TimeOfDay::operator data::String ( ) const
inline

Convert the TimeOfDay object to a String representation.


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