#include <OTC/dispatch/timeout.hh> class OTCEV_Timeout : public OTC_Event {
public:
~OTCEV_Timeout();
inline OTCEV_Timeout(int theTimerId);
inline int timer() const;
void* type() const;
inline static void* typeId();
void dump(ostream& outs) const;
static int start(int theAgentId, long thePeriod);
static void cancel(int theTimerId);
static void cancelAgent(int theAgentId);
static OTC_Boolean active(int theTimerId);
static long period();
static OTC_Job* pending();
};
OTCEV_Timeout
is a derived version of OTC_Event
specifically
for notifying agents that a timer has expired.
inline OTCEV_Timeout(int theTimerId);
theTimerId
has expired.
inline int timer() const;
void* type() const;
inline static void* typeId();
void dump(ostream& outs) const;
outs
.
static int start(int theAgentId, long thePeriod);
theAgentId
should be notified
when a time period of thePeriod
milliseconds has expired. A timer ID
number is returned. The timer ID number
can be used to cancel a timer using
cancel()
. If a timer is already
scheduled to go off at the same time as
this timer will expire, this timer will
be expired after the existing timer.
thePeriod
must be a positive value,
or an exception will be raised.
static void cancel(int theTimerId);
theTimerId
.
static void cancelAgent(int theAgentId);
theAgentId
is interested.
static OTC_Boolean active(int theTimerId);
OTCLIB_TRUE
if the timer with
ID number theTimerId
has not yet expired.
static long period();
-1
if there are no timers
active, otherwise the number of
milliseconds until the next timer is due
to expire.
static OTC_Job* pending();
0
if no timeouts are
pending.
0
will never be used as a timer ID.
OTC_EVAgent
, OTC_Event