NAME
OUXEV_Signal -
Event object to notify that signal has occurred.
SYNOPSIS
#include <OUX/dispatch/signal.hh>
class OUXEV_Signal : public OTC_Event
{
public:
~OUXEV_Signal();
inline OUXEV_Signal(int theSignal);
inline int signal() const;
void* type() const;
inline static void* typeId();
void dump(ostream& outs) const;
static void subscribe(int theAgentId, int theSignal);
static void unsubscribe(int theAgentId, int theSignal);
static void unsubscribeAgent(int theAgentId);
static void capacity(u_int theCapacity);
static OTC_Job* pending();
inline static int fd();
protected:
void cancelSource(int theAgentId);
};
CLASS TYPE
Concrete
DESCRIPTION
OUXEV_Signal is a derived version of OTC_Event specifically
for notifying agents of the occurence of a UNIX signal. The
class also provides the interface for registration of interest
in signals by agents.
CONSTRUCTION
inline OUXEV_Signal(int theSignal);
Creates an event object for theSignal.
QUERY
inline int signal() const;
Returns the number of the signal that
occurred.
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 void subscribe(int theAgentId, int theSignal);
Registers that the agent with ID number
theAgentId should be notified when
theSignal occurs.
static void unsubscribe(int theAgentId, int theSignal);
Forget that the agent with ID number
theAgentId is interested in being
notified about occurences of theSignal.
static void unsubscribeAgent(int theAgentId);
Forget that the agent identified by
theAgentId is interested in any signals.
INITIALISATION
static void capacity(u_int theCapacity);
Sets the capacity of the array used to
hold information about pending signals.
Must be called before any signal
subscriptions are made. If called after
signal subscriptions have been made,
the call is ignored. If not called at all,
the default size of 64 is used. If
theCapacity is 0 an exception is
raised.
SCHEDULING
static OTC_Job* pending();
Returns a job for the next pending
signal or 0 if no pending signals
exist.
inline static int fd();
Returns a file descriptor which can be
waited upon to determine if a signal has
occurred. Returns -1 if no signals have
yet been subscribed to.
NON DELIVERY
void cancelSource(int theAgentId);
Unsubscribes the agent with ID
theAgentId to which this event was to be
delivered, from all further signals. This
function will be called when the agent to
which this event was to be delivred does
not exist.
SEE ALSO
OTC_Event, OTC_EVAgent
LIBRARY
OUX
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED