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

ntime Class Reference

List of all members.

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.


Public Methods

 ntime ()
 Default (null) constructor.

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

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

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

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

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

 operator const void * () const
 Returns true unless the time is equal to the special ntime::none() value.

ntime operator+ (ntime other) const
 Returns the sum of two times.

ntime operator- (ntime other) const
 Returns the difference of two times.

template<class T> ntime operator * (T times) const
 Multiplies by a constant.

template<class T> ntime operator/ (T times) const
 Divides by a constant.

ntime & operator+= (ntime other)
 Adds to this time.

ntime & operator-= (ntime other)
 Subtracts from this time.

 NMSTL_ARITH_OPS (ntime, val)
string as_string () const
 Returns the time, in seconds, as a string.


Static Public Methods

ntime now ()
 Returns the current time.

ntime now_plus_secs (long long val)
 Returns the current time plus a certain number of seconds.

ntime now_plus_msecs (long long val)
 Returns the current time plus a certain number of milliseconds.

ntime now_plus_usecs (long long val)
 Returns the current time plus a certain number of microseconds.

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

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

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

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

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

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

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


Constructor & Destructor Documentation

ntime::ntime (    ) 
 

Default (null) constructor.


Member Function Documentation

string ntime::as_string (    )  const
 

Returns the time, in seconds, as a string.

ntime ntime::msecs (  double    val )  [static]
 

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

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

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

ntime::NMSTL_ARITH_OPS (  ntime   ,
val   
) 
 

ntime ntime::none (    )  [static]
 

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

ntime ntime::now (    )  [static]
 

Returns the current time.

ntime ntime::now_plus_msecs (  long long    val )  [static]
 

Returns the current time plus a certain number of milliseconds.

ntime ntime::now_plus_secs (  long long    val )  [static]
 

Returns the current time plus a certain number of seconds.

ntime ntime::now_plus_usecs (  long long    val )  [static]
 

Returns the current time plus a certain number of microseconds.

template<class T>
ntime ntime::operator * (  T    times )  const
 

Multiplies by a constant.

ntime::operator const void * (    )  const
 

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

ntime ntime::operator+ (  ntime    other )  const
 

Returns the sum of two times.

ntime& ntime::operator+= (  ntime    other ) 
 

Adds to this time.

ntime ntime::operator- (  ntime    other )  const
 

Returns the difference of two times.

ntime& ntime::operator-= (  ntime    other ) 
 

Subtracts from this time.

template<class T>
ntime ntime::operator/ (  T    times )  const
 

Divides by a constant.

ntime ntime::secs (  double    val )  [static]
 

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

template<class T>
ntime ntime::secs (  T    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 (  T    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 Dec 20 13:35:10 2002 for NMSTL