#include <timeval.h>
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) |
TimeVal & | operator= (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 |
TimeVal & | operator+= (const TimeVal &other) |
TimeVal & | operator-= (const TimeVal &other) |
TimeVal & | operator+= (int64_t seconds) |
TimeVal & | operator-= (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 |
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 | ( | ) |
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 | ) |
double Conexus::TimeVal::as_double | ( | ) | const |
float Conexus::TimeVal::as_float | ( | ) | const |
long double Conexus::TimeVal::as_long_double | ( | ) | const |
void Conexus::TimeVal::cleanup | ( | ) | [protected] |
References m_microseconds, m_seconds, and MICROSECONDS.
Referenced by add(), add_microseconds(), add_milliseconds(), add_seconds(), operator=(), set(), set_microseconds(), set_seconds(), subtract(), subtract_microsecond(), subtract_milliseconds(), and subtract_seconds().
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+= | ( | int64_t | seconds | ) |
References add_seconds().
TimeVal Conexus::TimeVal::operator- | ( | int64_t | seconds | ) | const |
TimeVal & Conexus::TimeVal::operator-= | ( | int64_t | seconds | ) |
References subtract_seconds().
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.
bool Conexus::TimeVal::set_to_current_time | ( | ) |
References m_microseconds, and m_seconds.
void Conexus::TimeVal::subtract | ( | const TimeVal & | other | ) |
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 | ) |
int64_t Conexus::TimeVal::m_microseconds [protected] |
Referenced by add(), add_microseconds(), add_milliseconds(), as_double(), as_float(), as_long_double(), cleanup(), clear(), microseconds(), negative(), operator struct timeval(), operator=(), set(), set_microseconds(), set_to_current_time(), subtract(), subtract_microsecond(), and subtract_milliseconds().
int64_t Conexus::TimeVal::m_seconds [protected] |
Referenced by add(), add_seconds(), as_double(), as_float(), as_long_double(), cleanup(), clear(), negative(), operator struct timeval(), operator=(), seconds(), set(), set_seconds(), set_to_current_time(), subtract(), and subtract_seconds().