38 #ifndef BLOCXX_TIMEOUT_TIMER_HPP_INCLUDE_GUARD_
39 #define BLOCXX_TIMEOUT_TIMER_HPP_INCLUDE_GUARD_
41 #include "blocxx/BLOCXX_config.h"
46 #ifdef BLOCXX_HAVE_SYS_TIME_H
51 namespace BLOCXX_NAMESPACE
107 bool expired()
const;
112 bool infinite()
const;
114 #ifdef BLOCXX_HAVE_STRUCT_TIMEVAL
116 ::timeval* asTimeval(::timeval& tv,
double maxSeconds)
const;
118 ::timeval* asTimeval(::timeval& tv)
const;
121 #ifdef BLOCXX_HAVE_STRUCT_TIMESPEC
123 ::timespec* asTimespec(::timespec& ts)
const;
127 Timeout asRelativeTimeout()
const;
128 Timeout asRelativeTimeout(
double maxSeconds)
const;
133 Timeout asAbsoluteTimeout()
const;
137 ::DWORD asDWORDMs()
const;
142 int asIntMs(
double maxSeconds)
const;
146 double calcSeconds()
const;
147 double calcSeconds(
double maxSeconds)
const;
150 virtual DateTime getCurrentTime()
const;
A TimeoutTimer is used by an algorithm to determine when a timeout has expired.
A timeout can be absolute, which means that it will happen at the specified DateTime.
The DateTime class is an abstraction for date time data.