## NAME

ACE_Priority_Reactor - Implements priority based dispatching.

## SYNOPSIS

    #include <ace/Priority_Reactor.h>

    class ACE_Priority_Reactor : public ACE_Select_Reactor
    {
      public:
        ACE_Priority_Reactor (
            ACE_Sig_Handler * = 0,
            ACE_Timer_Queue * = 0
            );
        ACE_Priority_Reactor (
            size_t size,
            int restart = 0,
            ACE_Sig_Handler * = 0,
            ACE_Timer_Queue * = 0
            );
        virtual ~ACE_Priority_Reactor (void);
        void dump (void) const;
        ACE_ALLOC_HOOK_DECLARE;
      protected:
        virtual int dispatch_io_set (
            int number_of_active_handles,
            int &number_dispatched,
            int mask,
            ACE_Handle_Set &dispatch_mask,
            ACE_Handle_Set &ready_mask,
            ACE_EH_PTMF callback
            );
      private:
        void init_bucket (void);
        typedef ACE_Unbounded_Queue<ACE_Event_Tuple> QUEUE;
        QUEUE** bucket_;
        ACE_Allocator* tuple_allocator_;
        ACE_Priority_Reactor (const ACE_Select_Reactor &);
        ACE_Priority_Reactor &operator = (const ACE_Select_Reactor &);
    };

## DESCRIPTION

This class refines the dispatching mechanism for the Select_Reactor by taking advantage of the priority method on ACE_Event_Handler.

## Initialization and termination methods.

    ACE_Priority_Reactor (ACE_Sig_Handler * = 0, ACE_Timer_Queue * = 0);

Initialize `ACE_Priority_Reactor` with the default size.

    ACE_Priority_Reactor (
        size_t size,
        int restart = 0,
        ACE_Sig_Handler * = 0,
        ACE_Timer_Queue * = 0
        );

Initialize `ACE_Priority_Reactor` with size `size`.

    virtual ~ACE_Priority_Reactor (void);

Close down the select_reactor and release all of its resources.

    void dump (void) const;

Dump the state of an object.

    ACE_ALLOC_HOOK_DECLARE;

Declare the dynamic allocation hooks.

## Dispatching methods.

    virtual int dispatch_io_set (
        int number_of_active_handles,
        int &number_dispatched,
        int mask,
        ACE_Handle_Set &dispatch_mask,
        ACE_Handle_Set &ready_mask,
        ACE_EH_PTMF callback
        );

We simply override this function to implement the priority dispatching.

## AUTHOR

Doug Schmidt

## LIBRARY

ace