NAME
OTCEV_Timeout -
Event object to notify that a timer has expired.
SYNOPSIS
#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();
};
CLASS TYPE
Concrete
DESCRIPTION
OTCEV_Timeout is a derived version of OTC_Event specifically
for notifying agents that a timer has expired.
CONSTRUCTION
inline OTCEV_Timeout(int theTimerId);
Creates a timeout event object for
notification that the timer with ID number
theTimerId has expired.
QUERY
inline int timer() const;
Returns the ID number of the timer which
expired.
IDENTIFICATION
void* type() const;
Returns a value that uniquely identifies
this type of event.
inline static void* typeId();
Returns a value that uniquely identifies
this type of event.
DEBUGGING
void dump(ostream& outs) const;
Dumps info about the event onto outs.
SUBSCRIPTION
static int start(int theAgentId, long thePeriod);
Registers that the agent identified by ID
number 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);
Cancels the timer with ID number
theTimerId.
static void cancelAgent(int theAgentId);
Cancels any timers in which the agent
with ID number theAgentId is interested.
static OTC_Boolean active(int theTimerId);
Returns OTCLIB_TRUE if the timer with
ID number theTimerId has not yet expired.
SCHEDULING
static long period();
Returns -1 if there are no timers
active, otherwise the number of
milliseconds until the next timer is due
to expire.
static OTC_Job* pending();
Returns a job for the next pending
timeout or 0 if no timeouts are
pending.
NOTES
A value of 0 will never be used as a timer ID.
SEE ALSO
OTC_EVAgent, OTC_Event
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED