#include <ace/Signal.h> class ACE_Sig_Handlers : public ACE_Sig_Handler {
public:
virtual int register_handler ( int signum, ACE_Event_Handler *new_sh, ACE_Sig_Action *new_disp = 0, ACE_Event_Handler **old_sh = 0, ACE_Sig_Action *old_disp = 0 );
virtual int remove_handler ( int signum, ACE_Sig_Action *new_disp = 0, ACE_Sig_Action *old_disp = 0, int sigkey = -1 );
virtual ACE_Event_Handler *handler (int signum);
virtual ACE_Event_Handler *handler ( int signum, ACE_Event_Handler * );
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
static void dispatch (int signum , siginfo_t *, ucontext_t * );
static int sigkey_;
static int third_party_sig_handler_;
};
signum
. When a signal occurs that
corresponds to this signum
, the handle_signal
methods of
all the registered ACE_Event_Handlers are invoked
automatically.
virtual int register_handler (
int signum,
ACE_Event_Handler *new_sh,
ACE_Sig_Action *new_disp = 0,
ACE_Event_Handler **old_sh = 0,
ACE_Sig_Action *old_disp = 0
);
signum
. Passes back the existing ACE_Event_Handler and its
sigaction if pointers are non-zero. Returns -1 on failure and
a sigkey
that is = 0 on success.
virtual int remove_handler (
int signum,
ACE_Sig_Action *new_disp = 0,
ACE_Sig_Action *old_disp = 0,
int sigkey = -1
);
signum
.
Install the new disposition (if given) and return the previous
disposition (if desired by the caller). Returns 0 on success and
-1 if signum
is invalid.
virtual ACE_Event_Handler *handler (int signum);
virtual ACE_Event_Handler *handler (int signum, ACE_Event_Handler *);
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;