## NAME

ACE_WFMO_Reactor_Handler_Repository -

Used to map `ACE_HANDLE`s onto the appropriate `ACE_Event_Handler` * and other information.

## SYNOPSIS

    #include <ace/WFMO_Reactor.h>

    class ACE_WFMO_Reactor_Handler_Repository
    {
      public:
        friend class ACE_WFMO_Reactor;

        class Common_Info
        {
          public:
            int io_entry_;
            ACE_Event_Handler *event_handler_;
            ACE_HANDLE io_handle_;
            long network_events_;
            int delete_event_;
            int delete_entry_;
            ACE_Reactor_Mask close_masks_;
            Common_Info (void);
            void reset (void);
            void set (
                int io_entry,
                ACE_Event_Handler *event_handler,
                ACE_HANDLE io_handle,
                long network_events,
                int delete_event,
                int delete_entry,
                ACE_Reactor_Mask close_masks
                );
            void set (Common_Info &common_info);
            void dump (void) const;
        };

class Current_Info { `public:` `int suspend_entry_;` `Current_Info (void);` `void reset (void);` `void set ( int io_entry, ACE_Event_Handler *event_handler, ACE_HANDLE io_handle, long network_events, int delete_event, int delete_entry = 0, ACE_Reactor_Mask close_masks = ACE_Event_Handler::NULL_MASK, int suspend_entry = 0 );` `void set (Common_Info &common_info, int suspend_entry = 0);` `void dump (ACE_HANDLE event_handle) const;` `};`

class To_Be_Added_Info { `public:` `ACE_HANDLE event_handle_;` `int suspend_entry_;` `To_Be_Added_Info (void);` `void reset (void);` `void set ( ACE_HANDLE event_handle, int io_entry, ACE_Event_Handler *event_handler, ACE_HANDLE io_handle, long network_events, int delete_event, int delete_entry = 0, ACE_Reactor_Mask close_masks = ACE_Event_Handler::NULL_MASK, int suspend_entry = 0 );` `void set ( ACE_HANDLE event_handle, Common_Info &common_info, int suspend_entry = 0 );` `void dump (void) const;` `};`

class Suspended_Info { `public:` `ACE_HANDLE event_handle_;` `int resume_entry_;` `Suspended_Info (void);` `void reset (void);` `void set ( ACE_HANDLE event_handle, int io_entry, ACE_Event_Handler *event_handler, ACE_HANDLE io_handle, long network_events, int delete_event, int delete_entry = 0, ACE_Reactor_Mask close_masks = 0, int resume_entry = 0 );` `void set ( ACE_HANDLE event_handle, Common_Info &common_info, int resume_entry = 0 );` `void dump (void) const;` `};` `ACE_WFMO_Reactor_Handler_Repository ( ACE_WFMO_Reactor &wfmo_reactor );` `virtual ~ACE_WFMO_Reactor_Handler_Repository (void);` `int open (size_t size);` `int close (void);` `int bind (ACE_HANDLE, ACE_Event_Handler *);` `int bind_i ( int io_entry, ACE_Event_Handler *event_handler, long network_events, ACE_HANDLE io_handle, ACE_HANDLE event_handle, int delete_event );` `int unbind (ACE_HANDLE, ACE_Reactor_Mask mask);` `int unbind_i ( ACE_HANDLE, ACE_Reactor_Mask mask, int &changes_required );` `void unbind_all (void);` `int invalid_handle (ACE_HANDLE handle) const;` `size_t max_handlep1 (void) const;` `ACE_HANDLE *handles (void) const;` `Current_Info *current_info (void) const;` `virtual int changes_required (void);` `virtual int make_changes (void);` `int scheduled_for_deletion (size_t slot) const;` `int modify_network_events_i ( ACE_HANDLE io_handle, ACE_Reactor_Mask new_masks, ACE_Reactor_Mask &old_masks, long &new_network_events, ACE_HANDLE &event_handle, int &delete_event, int operation );` `ACE_Reactor_Mask bit_ops ( long &existing_masks, ACE_Reactor_Mask to_be_removed_masks, int operation );` `int suspend_handler_i (ACE_HANDLE handle, int &changes_required);` `int resume_handler_i (ACE_HANDLE handle, int &changes_required);` `int make_changes_in_current_infos (void);` `int make_changes_in_suspension_infos (void);` `int make_changes_in_to_be_added_infos (void);` `int remove_handler_i (size_t slot, ACE_Reactor_Mask mask);` `int remove_suspended_handler_i ( size_t slot, ACE_Reactor_Mask mask );` `int remove_to_be_added_handler_i ( size_t slot, ACE_Reactor_Mask to_be_removed_masks );` `void dump (void) const;` `protected:` `ACE_WFMO_Reactor &wfmo_reactor_;` `size_t max_size_;` `ACE_HANDLE *current_handles_;` `Current_Info *current_info_;` `size_t max_handlep1_;` `To_Be_Added_Info *to_be_added_info_;` `size_t handles_to_be_added_;` `Suspended_Info *current_suspended_info_;` `size_t suspended_handles_;` `size_t handles_to_be_suspended_;` `size_t handles_to_be_resumed_;` `size_t handles_to_be_deleted_;` `};`

## Search structure operations.

    int bind (ACE_HANDLE, ACE_Event_Handler *);

Bind the `ACE_Event_Handler *` to the `ACE_HANDLE`. This is for the simple event entry.

    int bind_i (
        int io_entry,
        ACE_Event_Handler *event_handler,
        long network_events,
        ACE_HANDLE io_handle,
        ACE_HANDLE event_handle,
        int delete_event
        );

Insert I/O `Event_Handler` entry into the system. This method assumes that the lock are head *before* this method is invoked.

    int unbind (ACE_HANDLE, ACE_Reactor_Mask mask);

Remove the binding of `ACE_HANDLE` in accordance with the `mask`.

    int unbind_i (
        ACE_HANDLE,
        ACE_Reactor_Mask mask,
        int &changes_required
        );

Non-lock-grabbing version of `unbind`

    void unbind_all (void);

Remove all bindings of `ACE_HANDLE, ACE_Event_Handler` tuples.

## Sanity checking.

Check the `handle` to make sure it's a valid ACE_HANDLE

    int invalid_handle (ACE_HANDLE handle) const;

## Accessors.

    size_t max_handlep1 (void) const;

Maximum ACE_HANDLE value, plus 1.

    ACE_HANDLE *handles (void) const;

Pointer to the beginning of the current array of `ACE_HANDLE` *'s.

    Current_Info *current_info (void) const;

Pointer to the beginning of the current array of `ACE_Event_Handler` *'s.

    virtual int changes_required (void);

Check if changes to the handle set are required.

    virtual int make_changes (void);

Make changes to the handle set

    int scheduled_for_deletion (size_t slot) const;

Check to see if `slot` has been scheduled for deletion

    int modify_network_events_i (
        ACE_HANDLE io_handle,
        ACE_Reactor_Mask new_masks,
        ACE_Reactor_Mask &old_masks,
        long &new_network_events,
        ACE_HANDLE &event_handle,
        int &delete_event,
        int operation
        );

This method is used to calculate the network mask after a mask_op request to `WFMO_Reactor`. Note that because the `Event_Handler` may already be in the handler repository, we may have to find the old event and the old network events

    ACE_Reactor_Mask bit_ops (
        long &existing_masks,
        ACE_Reactor_Mask to_be_removed_masks,
        int operation
        );

This method is used to change the network mask left (if any) after a remove request to `WFMO_Reactor`

    int suspend_handler_i (ACE_HANDLE handle, int &changes_required);

Temporarily suspend entry

    int resume_handler_i (ACE_HANDLE handle, int &changes_required);

Resume suspended entry

    int make_changes_in_current_infos (void);

Deletions and suspensions in current_info_

    int make_changes_in_suspension_infos (void);

Deletions and resumptions in current_suspended_info_

    int make_changes_in_to_be_added_infos (void);

Deletions in to_be_added_info_, or transfers to current_info_ or current_suspended_info_ from to_be_added_info_

    int remove_handler_i (size_t slot, ACE_Reactor_Mask mask);

Removes the `ACE_Event_Handler` at `slot` from the table.

    int remove_suspended_handler_i (size_t slot, ACE_Reactor_Mask mask);

Removes the `ACE_Event_Handler` at `slot` from the table.

    int remove_to_be_added_handler_i (
        size_t slot,
        ACE_Reactor_Mask to_be_removed_masks
        );

Removes the `ACE_Event_Handler` at `slot` from the table.

    void dump (void) const;

Dump the state of an object.

## AUTHOR

Irfan Pyarali, Tim Harrison, and Doug Schmidt

## LIBRARY

ace