Emergency 20 Dokumentation  4.2.0
qsf::Time Class Reference

Data type for encapsulating time information. It might represents points in time and time spans. The native resolution is currently microseconds with one microsecond being the minimal representable value. These objects are lightweight and are copyable via the default mechanisms. More...

#include <Time.h>

Public Member Functions

 Time ()
 
float getWeeks () const
 
float getDays () const
 
float getHours () const
 
float getMinutes () const
 
float getSeconds () const
 
int64 getMilliseconds () const
 
int64 getMicroseconds () const
 
void setWeeks (float weeks)
 
void setDays (float days)
 
void setHours (float hours)
 
void setMinutes (float minutes)
 
void setSeconds (float seconds)
 
void setMilliseconds (int64 milliseconds)
 
void setMicroseconds (int64 microseconds)
 
Time operator- () const
 
Time operator+ (const Time &other) const
 
Timeoperator+= (const Time &other)
 
Time operator- (const Time &other) const
 
Timeoperator-= (const Time &other)
 
Time operator* (float multiplier) const
 
Timeoperator*= (float multiplier)
 
Time operator/ (float divisor) const
 
Timeoperator/= (float divisor)
 
Time operator% (const Time &other) const
 
Timeoperator%= (const Time &other)
 
float operator/ (const Time &divisor) const
 
bool operator== (const Time &other) const
 
bool operator!= (const Time &other) const
 
bool operator< (const Time &other) const
 
bool operator> (const Time &other) const
 
bool operator>= (const Time &other) const
 
bool operator<= (const Time &other) const
 

Static Public Member Functions

static std::string currentSystemTimeAsString ()
 Return the current system time as string (In UTC) More...
 
static std::string currentSystemTimeAsFilenameString ()
 Return the current time as filename string (In UTC) More...
 
static std::string currentLocalTimeAsString ()
 Return the current local time as string. More...
 
static std::string currentLocalTimeAsFilenameString ()
 Return the current local time as filename string. More...
 
static Time now ()
 Return a Time object representing the current time with medium (~10ms) precision. More...
 
static Time highResolutionNow ()
 Return a Time object representing the current time with high (microsecond) precision. More...
 
static Time fromWeeks (float weeks)
 
static Time fromWeeks (double weeks)
 
static Time fromWeeks (int64 weeks)
 
static Time fromDays (float days)
 
static Time fromDays (double days)
 
static Time fromDays (int64 days)
 
static Time fromHours (float hours)
 
static Time fromHours (double hours)
 
static Time fromHours (int64 hours)
 
static Time fromMinutes (float minutes)
 
static Time fromMinutes (double minutes)
 
static Time fromMinutes (int64 minutes)
 
static Time fromSeconds (float seconds)
 
static Time fromSeconds (double seconds)
 
static Time fromSeconds (int64 seconds)
 
static Time fromMilliseconds (int64 milliseconds)
 
static Time fromMicroseconds (int64 microseconds)
 

Static Public Attributes

static const Time ZERO
 A zero value for time. More...
 
static const Time MAX
 A maximum value for time. More...
 

Detailed Description

Data type for encapsulating time information. It might represents points in time and time spans. The native resolution is currently microseconds with one microsecond being the minimal representable value. These objects are lightweight and are copyable via the default mechanisms.

Constructor & Destructor Documentation

qsf::Time::Time ( )
inline

Member Function Documentation

static std::string qsf::Time::currentLocalTimeAsFilenameString ( )
static

Return the current local time as filename string.

Returns
The current time as filename string "%Y-%m-%d-%H-%M-%S"
static std::string qsf::Time::currentLocalTimeAsString ( )
static

Return the current local time as string.

Returns
The current time as string "%Y-%m-%d %H:%M:%S" (don't use it directly as filename)
static std::string qsf::Time::currentSystemTimeAsFilenameString ( )
static

Return the current time as filename string (In UTC)

Returns
The current time as filename string "%Y-%m-%d-%H-%M-%S"
static std::string qsf::Time::currentSystemTimeAsString ( )
static

Return the current system time as string (In UTC)

Returns
The current time as string "%Y-%m-%d %H:%M:%S" (don't use it directly as filename)
Time qsf::Time::fromDays ( float  days)
inlinestatic
Time qsf::Time::fromDays ( double  days)
inlinestatic
Time qsf::Time::fromDays ( int64  days)
inlinestatic
Time qsf::Time::fromHours ( float  hours)
inlinestatic
Time qsf::Time::fromHours ( double  hours)
inlinestatic
Time qsf::Time::fromHours ( int64  hours)
inlinestatic
Time qsf::Time::fromMicroseconds ( int64  microseconds)
inlinestatic
Time qsf::Time::fromMilliseconds ( int64  milliseconds)
inlinestatic
Time qsf::Time::fromMinutes ( float  minutes)
inlinestatic
Time qsf::Time::fromMinutes ( double  minutes)
inlinestatic
Time qsf::Time::fromMinutes ( int64  minutes)
inlinestatic
Time qsf::Time::fromSeconds ( float  seconds)
inlinestatic
Time qsf::Time::fromSeconds ( double  seconds)
inlinestatic
Time qsf::Time::fromSeconds ( int64  seconds)
inlinestatic
Time qsf::Time::fromWeeks ( float  weeks)
inlinestatic
Time qsf::Time::fromWeeks ( double  weeks)
inlinestatic
Time qsf::Time::fromWeeks ( int64  weeks)
inlinestatic
float qsf::Time::getDays ( ) const
inline
float qsf::Time::getHours ( ) const
inline
int64 qsf::Time::getMicroseconds ( ) const
inline
int64 qsf::Time::getMilliseconds ( ) const
inline
float qsf::Time::getMinutes ( ) const
inline
float qsf::Time::getSeconds ( ) const
inline
float qsf::Time::getWeeks ( ) const
inline
static Time qsf::Time::highResolutionNow ( )
static

Return a Time object representing the current time with high (microsecond) precision.

Returns
A Time object representing the current time
static Time qsf::Time::now ( )
static

Return a Time object representing the current time with medium (~10ms) precision.

Returns
A Time object representing the current time
bool qsf::Time::operator!= ( const Time other) const
inline
Time qsf::Time::operator% ( const Time other) const
inline
Time & qsf::Time::operator%= ( const Time other)
inline
Time qsf::Time::operator* ( float  multiplier) const
inline
Time & qsf::Time::operator*= ( float  multiplier)
inline
Time qsf::Time::operator+ ( const Time other) const
inline
Time & qsf::Time::operator+= ( const Time other)
inline
Time qsf::Time::operator- ( ) const
inline
Time qsf::Time::operator- ( const Time other) const
inline
Time & qsf::Time::operator-= ( const Time other)
inline
Time qsf::Time::operator/ ( float  divisor) const
inline
float qsf::Time::operator/ ( const Time divisor) const
inline
Time & qsf::Time::operator/= ( float  divisor)
inline
bool qsf::Time::operator< ( const Time other) const
inline
bool qsf::Time::operator<= ( const Time other) const
inline
bool qsf::Time::operator== ( const Time other) const
inline
bool qsf::Time::operator> ( const Time other) const
inline
bool qsf::Time::operator>= ( const Time other) const
inline
void qsf::Time::setDays ( float  days)
inline
void qsf::Time::setHours ( float  hours)
inline
void qsf::Time::setMicroseconds ( int64  microseconds)
inline
void qsf::Time::setMilliseconds ( int64  milliseconds)
inline
void qsf::Time::setMinutes ( float  minutes)
inline
void qsf::Time::setSeconds ( float  seconds)
inline
void qsf::Time::setWeeks ( float  weeks)
inline

Member Data Documentation

const Time qsf::Time::MAX
static

A maximum value for time.

const Time qsf::Time::ZERO
static

A zero value for time.


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