Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::G::TimeVal Class Reference

A GTimeVal C++ wrapper interface. More...

#include <inti/glib/timeval.h>

List of all members.

Public Member Functions

Constructors
Accessors
Methods

Detailed Description

A GTimeVal C++ wrapper interface.

TimeVal represents a time expressed in seconds and microseconds. TimeVal uses default copy, assignment and destruction.


Constructor & Destructor Documentation

Inti::G::TimeVal::TimeVal long  seconds,
long  microseconds
 

Construct a time value using the specified seconds and microseconds.

Parameters:
seconds The number of seconds.
microseconds The number of microseconds.

Both seconds and microseconds can be positive or negative. If microseconds is greater than G_USEC_PER_SEC this method will calculate the number of seconds in microseconds and adjust seconds.

Inti::G::TimeVal::TimeVal const double &  timeval  ) 
 

Construct a time value from a double representation.

Parameters:
timeval The double time value.

In timeval the whole digits represents seconds and the fractional part represents microseconds. As an example, such a double value is returned by G::Timer::elapsed().

Inti::G::TimeVal::TimeVal const GTimeVal &  timeval  ) 
 

Construct a time value from a existing GTimeVal.

Parameters:
timeval A reference to a GTimeVal.


Member Function Documentation

void Inti::G::TimeVal::add const TimeVal other  ) 
 

Adds other to this time value.

Parameters:
other Another TimeVal object.

void Inti::G::TimeVal::add long  seconds,
long  microseconds
 

Adds the specified number of seconds and microseconds to the time value.

Parameters:
seconds The number of seconds to add.
microseconds The number of microseconds to add.

Both seconds and microseconds can be positive or negative. If microseconds is greater than G_USEC_PER_SEC this method will calculate the number of seconds in microseconds and adjust seconds.

void Inti::G::TimeVal::add long  microseconds  ) 
 

Adds the specified number of microseconds to the time value.

Parameters:
microseconds The number of microseconds to add, either positive or negative.

long Inti::G::TimeVal::difference const TimeVal other  ) 
 

Gets the time difference between this time value and other.

Parameters:
other Another TimeVal object.
Returns:
The time difference in microseconds.

bool Inti::G::TimeVal::equal const TimeVal other  )  const
 

Tests this time value and other for equality.

Parameters:
other Another TimeVal object.
Returns:
true if this time value is equal to other.

double Inti::G::TimeVal::get_double  )  const
 

Converts the time value into a double floating-point value.

Returns:
The time as a double floating-point.

In the return value the whole digits represent the seconds and the the fractional part represents the microseconds.

bool Inti::G::TimeVal::operator!= const TimeVal other  )  [inline]
 

Inequality operator.

Parameters:
other Another TimeVal object.
Returns:
true if this time value is not equal to other.

TimeVal& Inti::G::TimeVal::operator+= const TimeVal other  ) 
 

Adds other to the time value.

Parameters:
other Another TimeVal object.
Returns:
A reference to the time value.

TimeVal& Inti::G::TimeVal::operator+= long  microseconds  ) 
 

Adds microseconds to the time value.

Parameters:
microseconds The number of microseconds to add.
Returns:
A reference to the time value.

TimeVal& Inti::G::TimeVal::operator-= const TimeVal other  ) 
 

Subtract other from the time value.

Parameters:
other Another TimeVal object.
Returns:
A reference to the time value.

TimeVal& Inti::G::TimeVal::operator-= long  microseconds  ) 
 

Subtracts microseconds from the time value.

Parameters:
microseconds The number of microseconds to subtract.
Returns:
A reference to the time value.

bool Inti::G::TimeVal::operator< const TimeVal other  ) 
 

Less-than operator.

Parameters:
other Another TimeVal object.
Returns:
true if this time value is less than other.

bool Inti::G::TimeVal::operator<= const TimeVal other  )  [inline]
 

Less-than-or-equal-to operator.

Parameters:
other Another TimeVal object.
Returns:
true if this time value is less than or equal to other.

bool Inti::G::TimeVal::operator== const TimeVal other  )  [inline]
 

Equality operator.

Parameters:
other Another TimeVal object.
Returns:
true if this time value is equal to other.

bool Inti::G::TimeVal::operator> const TimeVal other  ) 
 

Greater-than operator.

Parameters:
other Another TimeVal object.
Returns:
true if this time value is greater than other.

bool Inti::G::TimeVal::operator>= const TimeVal other  )  [inline]
 

Greater-than-or-equal-to operator.

Parameters:
other Another TimeVal object.
Returns:
true if this time value is greater than or equal to other.

void Inti::G::TimeVal::subtract const TimeVal other  ) 
 

Subtracts other from this time value.

Parameters:
other Another TimeVal object.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:09 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002