## NAME

ACE_Sig_Adapter - Provide an adapter that transforms various types of signal handlers into the scheme used by the `ACE_Reactor`.

## SYNOPSIS

    #include <ace/Signal.h>

    class ACE_Sig_Adapter : public ACE_Event_Handler
    {
      public:
        ACE_Sig_Adapter (ACE_Sig_Action &, int sigkey);
        ACE_Sig_Adapter (ACE_Event_Handler *, int sigkey);
        ACE_Sig_Adapter (ACE_Sig_Handler_Ex, int sigkey = 0);
        ~ACE_Sig_Adapter (void);
        int sigkey (void);
        virtual int handle_signal (int, siginfo_t *, ucontext_t *);
      private:
        int sigkey_;
            enum{ ACE_HANDLER,
            SIG_ACTION,
            C_FUNCTION } type_; ACE_Sig_Action sa_; ACE_Event_Handler *eh_; ACE_Sig_Handler_Ex sig_func_; };

        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 *
                );
            static void dispatch (int signum, siginfo_t *, ucontext_t *);
            void dump (void) const;
            ACE_ALLOC_HOOK_DECLARE;
          private:
            static int sigkey_;
            static int third_party_sig_handler_;
        };

`};`

## PUBLIC MEMBERS

    ACE_Sig_Adapter (ACE_Sig_Action &, int sigkey);

    ACE_Sig_Adapter (ACE_Event_Handler *, int sigkey);

    ACE_Sig_Adapter (ACE_Sig_Handler_Ex, int sigkey = 0);

    ~ACE_Sig_Adapter (void);

    int sigkey (void);

Returns this signal key that's used to remove this from the `ACE_Reactor`'s internal table.

    virtual int handle_signal (int, siginfo_t *, ucontext_t *);

Called by the `Reactor` to dispatch the signal handler.

## PRIVATE MEMBERS

    int sigkey_;

Key for this signal handler (used to remove it).

## AUTHOR

Doug Schmidt

## LIBRARY

ace