NAME
OTC_EVAgent -
Base class for objects capable of receiving events.
SYNOPSIS
#include <OTC/dispatch/evagent.hh>
class OTC_EVAgent
{
public:
virtual ~OTC_EVAgent();
inline int id() const;
static OTC_EVAgent* lookup(int theAgentId);
protected:
OTC_EVAgent();
virtual void handle(OTC_Event* theEvent) = 0;
};
CLASS TYPE
Abstract
DESCRIPTION
OTC_EVAgent is a base class for any active object capable of
receiving events. In essence this class represent a thread
of control within a process.
DESTRUCTION
virtual ~OTC_EVAgent();
Removes this agent from the table
of active agents.
IDENTIFICATION
inline int id() const;
Returns the ID number of this agent.
LOOKUP
static OTC_EVAgent* lookup(int theAgentId);
Looks in the table of active agents for
the agent with ID number theAgentId. If
found, a pointer to that agent is
returned, otherwise 0 is returned.
INITIALISATION
OTC_EVAgent();
Allocates a new agent ID and adds this
object to the table of active agents.
EVENT CALLBACK
virtual void handle(OTC_Event* theEvent) = 0;
Must be redefined in a derived class to
handle theEvent.
SEE ALSO
OTC_Event, OTC_Dispatcher
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED