conexus logo

Conexus::TimeVal Class Reference

#include <timeval.h>

List of all members.

Public Member Functions

 TimeVal (int64_t seconds=0, int64_t microseconds=0)
 TimeVal (const struct timeval &tv)
 TimeVal (const TimeVal &other)
 ~TimeVal ()
int64_t seconds () const
int64_t microseconds () const
void set_seconds (int64_t seconds)
void set_microseconds (int64_t microseconds)
void set (int64_t seconds, int64_t microseconds)
TimeValoperator= (const struct timeval &tv)
void clear ()
bool set_to_current_time ()
void add (const TimeVal &other)
void subtract (const TimeVal &other)
void add_seconds (int64_t seconds)
void subtract_seconds (int64_t seconds)
void add_milliseconds (int64_t milliseconds)
void subtract_milliseconds (int64_t milliseconds)
void add_microseconds (int64_t microseconds)
void subtract_microsecond (int64_t microseconds)
TimeVal operator+ (const TimeVal &other) const
TimeVal operator- (const TimeVal &other) const
TimeVal operator+ (int64_t seconds) const
TimeVal operator- (int64_t seconds) const
TimeValoperator+= (const TimeVal &other)
TimeValoperator-= (const TimeVal &other)
TimeValoperator+= (int64_t seconds)
TimeValoperator-= (int64_t seconds)
float as_float () const
double as_double () const
long double as_long_double () const
 operator struct timeval () const
 operator float () const
 operator double () const
 operator long double () const
bool negative () const

Protected Member Functions

void cleanup ()

Protected Attributes

int64_t m_seconds
int64_t m_microseconds


Detailed Description

Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>

Constructor & Destructor Documentation

Conexus::TimeVal::TimeVal ( int64_t  seconds = 0,
int64_t  microseconds = 0 
)

Conexus::TimeVal::TimeVal ( const struct timeval &  tv  ) 

Conexus::TimeVal::TimeVal ( const TimeVal other  ) 

Conexus::TimeVal::~TimeVal (  ) 


Member Function Documentation

void Conexus::TimeVal::add ( const TimeVal other  ) 

References cleanup(), m_microseconds, and m_seconds.

void Conexus::TimeVal::add_microseconds ( int64_t  microseconds  ) 

References cleanup(), and m_microseconds.

void Conexus::TimeVal::add_milliseconds ( int64_t  milliseconds  ) 

References cleanup(), and m_microseconds.

void Conexus::TimeVal::add_seconds ( int64_t  seconds  ) 

References cleanup(), and m_seconds.

Referenced by operator+=().

double Conexus::TimeVal::as_double (  )  const

References m_microseconds, m_seconds, and MICROSECONDSD.

Referenced by operator double().

float Conexus::TimeVal::as_float (  )  const

References m_microseconds, m_seconds, and MICROSECONDSF.

Referenced by operator float().

long double Conexus::TimeVal::as_long_double (  )  const

void Conexus::TimeVal::cleanup (  )  [protected]

void Conexus::TimeVal::clear (  ) 

References m_microseconds, and m_seconds.

int64_t Conexus::TimeVal::microseconds (  )  const

References m_microseconds.

bool Conexus::TimeVal::negative (  )  const

References m_microseconds, and m_seconds.

Conexus::TimeVal::operator double (  )  const

References as_double().

Conexus::TimeVal::operator float (  )  const

References as_float().

Conexus::TimeVal::operator long double (  )  const

References as_long_double().

Conexus::TimeVal::operator struct timeval (  )  const

References m_microseconds, and m_seconds.

TimeVal Conexus::TimeVal::operator+ ( int64_t  seconds  )  const

TimeVal Conexus::TimeVal::operator+ ( const TimeVal other  )  const

TimeVal & Conexus::TimeVal::operator+= ( int64_t  seconds  ) 

References add_seconds().

TimeVal & Conexus::TimeVal::operator+= ( const TimeVal other  ) 

TimeVal Conexus::TimeVal::operator- ( int64_t  seconds  )  const

TimeVal Conexus::TimeVal::operator- ( const TimeVal other  )  const

TimeVal & Conexus::TimeVal::operator-= ( int64_t  seconds  ) 

References subtract_seconds().

TimeVal & Conexus::TimeVal::operator-= ( const TimeVal other  ) 

References subtract().

TimeVal & Conexus::TimeVal::operator= ( const struct timeval &  tv  ) 

References cleanup(), m_microseconds, and m_seconds.

int64_t Conexus::TimeVal::seconds (  )  const

References m_seconds.

void Conexus::TimeVal::set ( int64_t  seconds,
int64_t  microseconds 
)

References cleanup(), m_microseconds, and m_seconds.

void Conexus::TimeVal::set_microseconds ( int64_t  microseconds  ) 

References cleanup(), and m_microseconds.

void Conexus::TimeVal::set_seconds ( int64_t  seconds  ) 

References cleanup(), and m_seconds.

bool Conexus::TimeVal::set_to_current_time (  ) 

References m_microseconds, and m_seconds.

void Conexus::TimeVal::subtract ( const TimeVal other  ) 

References cleanup(), m_microseconds, and m_seconds.

Referenced by operator-=().

void Conexus::TimeVal::subtract_microsecond ( int64_t  microseconds  ) 

References cleanup(), and m_microseconds.

void Conexus::TimeVal::subtract_milliseconds ( int64_t  milliseconds  ) 

References cleanup(), and m_microseconds.

void Conexus::TimeVal::subtract_seconds ( int64_t  seconds  ) 

References cleanup(), and m_seconds.

Referenced by operator-=().


Member Data Documentation

int64_t Conexus::TimeVal::m_microseconds [protected]

int64_t Conexus::TimeVal::m_seconds [protected]


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

Generated on Wed Jul 8 15:51:21 2009 for conexus by doxygen 1.5.8