Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ntime Class Reference

A class encapsulating a duration or a point in time. More...

List of all members.

Public Methods

long long to_secs () const
 Returns the duration in seconds. More...

long long to_msecs () const
 Returns the duration in milliseconds. More...

long long to_usecs () const
 Returns the duration in microseconds. More...

timespec to_timespec () const
 Returns the duration as a timespec. More...

timeval to_timeval () const
 Returns the duration as a timeval. More...

 operator bool () const
 Returns true unless the time is equal to the special ntime::now() value. More...

ntime operator+ (ntime other) const
ntime operator- (ntime other) const
ntime & operator+= (ntime other)
ntime & operator-= (ntime other)
bool operator== (ntime other) const
bool operator!= (ntime other) const
bool operator< (ntime other) const
bool operator> (ntime other) const
bool operator<= (ntime other) const
bool operator>= (ntime other) const

Static Public Methods

ntime now ()
 Returns the current time. More...

template<class T> ntime secs (T val)
 Creates a time value corresponding to a particular number of seconds. More...

ntime secs (double val)
 Creates a time value corresponding to a particular number of seconds. More...

template<class T> ntime msecs (T val)
 Creates a time value corresponding to a particular number of milliseconds. More...

ntime msecs (double val)
 Creates a time value corresponding to a particular number of milliseconds. More...

template<class T> ntime usecs (T val)
 Creates a time value corresponding to a particular number of microseconds. More...

ntime usecs (double val)
 Creates a time value corresponding to a particular number of microseconds. More...

ntime none ()
 Returns a special time value meaning "no time at all.". More...


Detailed Description

A class encapsulating a duration or a point in time.

This class is named ntime rather than time to avoid collisions with the time function.


Member Function Documentation

ntime ntime::msecs double    val [static]
 

Creates a time value corresponding to a particular number of milliseconds.

template<class T>
ntime ntime::msecs   val [static]
 

Creates a time value corresponding to a particular number of milliseconds.

ntime ntime::none   [static]
 

Returns a special time value meaning "no time at all.".

ntime ntime::now   [static]
 

Returns the current time.

ntime::operator bool   const
 

Returns true unless the time is equal to the special ntime::now() value.

bool ntime::operator!= ntime    other const
 

ntime ntime::operator+ ntime    other const
 

ntime& ntime::operator+= ntime    other
 

ntime ntime::operator- ntime    other const
 

ntime& ntime::operator-= ntime    other
 

bool ntime::operator< ntime    other const
 

bool ntime::operator<= ntime    other const
 

bool ntime::operator== ntime    other const
 

bool ntime::operator> ntime    other const
 

bool ntime::operator>= ntime    other const
 

ntime ntime::secs double    val [static]
 

Creates a time value corresponding to a particular number of seconds.

template<class T>
ntime ntime::secs   val [static]
 

Creates a time value corresponding to a particular number of seconds.

long long ntime::to_msecs   const
 

Returns the duration in milliseconds.

long long ntime::to_secs   const
 

Returns the duration in seconds.

timespec ntime::to_timespec   const
 

Returns the duration as a timespec.

timeval ntime::to_timeval   const
 

Returns the duration as a timeval.

long long ntime::to_usecs   const
 

Returns the duration in microseconds.

ntime ntime::usecs double    val [static]
 

Creates a time value corresponding to a particular number of microseconds.

template<class T>
ntime ntime::usecs   val [static]
 

Creates a time value corresponding to a particular number of microseconds.


The documentation for this class was generated from the following file:
Generated on Fri Sep 20 20:07:30 2002 for NMSTL