NAME

ACE_Sig_Handlers - This is an alternative signal handling dispatcher for ACE. It allows a list of signal handlers to be registered for each signal. It also makes SA_RESTART the default mode.

SYNOPSIS


#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_;
};

DESCRIPTION

Using this class a program can register one or more ACE_Event_Handler with the ACE_Sig_Handler in order to handle a designated signum. When a signal occurs that corresponds to this signum, the handle_signal methods of all the registered ACE_Event_Handlers are invoked automatically.

Registration and removal methods.

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
    );

Set/get the handler associated with a particular signal.

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;

AUTHOR

Doug Schmidt

LIBRARY

ace