NAME

ACE_Select_Reactor_Handler_Repository - Used to map ACE_HANDLEs onto the appropriate ACE_Event_Handler *.

SYNOPSIS

#include <ace/Select_Reactor_Base.h>

class ACE_Select_Reactor_Handler_Repository { public: friend class ACE_Select_Reactor_Handler_Repository_Iterator; ACE_Select_Reactor_Handler_Repository (ACE_Select_Reactor_Impl &); ~ACE_Select_Reactor_Handler_Repository (void); int open (size_t size); int close (void); ACE_Event_Handler *find (ACE_HANDLE handle, size_t *index_p = 0); int bind (ACE_HANDLE, ACE_Event_Handler *, ACE_Reactor_Mask); int unbind (ACE_HANDLE, ACE_Reactor_Mask mask); int unbind_all (void); int invalid_handle (ACE_HANDLE handle); int handle_in_range (ACE_HANDLE handle); size_t size (void); size_t max_handlep1 (void); void dump (void) const; ACE_ALLOC_HOOK_DECLARE; private: ACE_Select_Reactor_Impl &select_reactor_; ssize_t max_size_; int max_handlep1_; ACE_Event_Tuple *event_handlers_; ACE_Event_Handler **event_handlers_; };

DESCRIPTION

This class is necessary to shield differences between UNIX and Win32. In UNIX, ACE_HANDLE is an int, whereas in Win32 it's a void *. This class hides all these details from the bulk of the ACE_Select_Reactor code. All of these methods are called with the main Select_Reactor token lock held.

Initialization and termination methods.

ACE_Select_Reactor_Handler_Repository (ACE_Select_Reactor_Impl &);

~ACE_Select_Reactor_Handler_Repository (void);

int open (size_t size);

int close (void);

Search structure operations.

ACE_Event_Handler *find (ACE_HANDLE handle, size_t *index_p = 0);

int bind (ACE_HANDLE, ACE_Event_Handler *, ACE_Reactor_Mask);

int unbind (ACE_HANDLE, ACE_Reactor_Mask mask);

int unbind_all (void);

Sanity checking.

Check the handle to make sure it's a valid ACE_HANDLE that within the range of legal handles (i.e., = 0 && max_size_).
int invalid_handle (ACE_HANDLE handle);

Check the handle to make sure it's a valid ACE_HANDLE that within the range of currently registered handles (i.e., = 0 && max_handlep1_).

int handle_in_range (ACE_HANDLE handle);

Accessors.

size_t size (void);

size_t max_handlep1 (void);

void dump (void) const;

ACE_ALLOC_HOOK_DECLARE;

AUTHOR

Doug Schmidt

LIBRARY

ace