Main Page | Modules | Class Hierarchy | Class List | Directories | Class Members | Related Pages | Examples

Timeval Class Reference
[Data Structures]

#include <basic_types.h>

List of all members.

Public Member Functions

 Timeval (void)
 Timeval (const timeval_t &ts)
 Timeval (const struct timespec &ts)
 Timeval (double seconds)
 Timeval (const Timeval &rhs)
bool operator== (const Timeval &rhs) const
bool operator< (const Timeval &rhs) const
bool operator<= (const Timeval &rhs) const
bool operator> (const Timeval &rhs) const
bool operator>= (const Timeval &rhs) const
Timevaloperator-= (const Timeval &rhs) throw ( ArithmeticUnderflowException )
Timeval operator- (const Timeval &rhs) const throw ( ArithmeticUnderflowException )
Timevaloperator+= (const Timeval &rhs) throw ( ArithmeticOverflowException )
Timeval operator+ (const Timeval &rhs) const throw ( ArithmeticOverflowException )
double getDoubleValue (void) const
 return the value of the timestamp in epoch-seconds as a double
 operator double () const

Protected Attributes

timespec timestamp

Friends

std::ostream & operator<< (std::ostream &os, const Timeval &time)


Detailed Description

wrapper for a struct timespec, which nominally has nanosecond accuracy. On our IBM Debian linux boxen at least, timing accuracy appears to be roughly to the microsecond.
Examples:

profile_streams_thesis.cc, test_harness.cc, and test_hist.cc.


Constructor & Destructor Documentation

Timeval::Timeval void   ) 
 

default constructor initializes to current time

Timeval::Timeval const timeval_t &  ts  ) 
 

initialize from the given struct timeval

Timeval::Timeval const struct timespec &  ts  ) 
 

initialize from the given struct timespec

Timeval::Timeval double  seconds  ) 
 

initialize from the given number of seconds

Parameters:
seconds decimal number of seconds

Timeval::Timeval const Timeval rhs  ) 
 

copy c-tor


Member Function Documentation

bool Timeval::operator< const Timeval rhs  )  const
 

true if the left timestamp is before the right timestamp

bool Timeval::operator<= const Timeval rhs  )  const
 

true if the left timestamp is before or equal to the right timestamp

bool Timeval::operator== const Timeval rhs  )  const
 

true if the timestamps are equal, to the smallest resolution supported

bool Timeval::operator> const Timeval rhs  )  const
 

true if the left timestamp is after the right timestamp

bool Timeval::operator>= const Timeval rhs  )  const
 

true if the left timestamp is after or equal to the right timestamp


The documentation for this class was generated from the following files:
Generated on Thu Apr 5 01:02:39 2007 for ANTARES by  doxygen 1.4.2