ACE_HANDLEs onto the appropriate
ACE_Event_Handler *.
#include <ace/Reactor.h>
class ACE_Reactor_Handler_Repository {
public:friend class ACE_Reactor_Handler_Repository_Iterator;ACE_Reactor_Handler_Repository (ACE_Reactor &);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 max_handlep1 (void);void dump (void) const;ACE_ALLOC_HOOK_DECLARE;private:ACE_Reactor &reactor_;ssize_t max_size_;int max_handlep1_;struct ACE_NT_EH_Record {
public:ACE_HANDLE handle_;ACE_Event_Handler *event_handler_;};
ACE_NT_EH_Record *event_handlers_;
ACE_Event_Handler **event_handlers_;
};
ACE_HANDLE is an int, whereas in Win32
it's a void *. This class hides all these details from the
bulk of the ACE_Reactor code. All of these methods are
called with the main Reactor token lock held.
ACE_Reactor_Handler_Repository (ACE_Reactor &);
int open (size_t size);
size.
int close (void);
ACE_Event_Handler *find (ACE_HANDLE handle, size_t *index_p = 0);
ACE_Event_Handler * associated with ACE_HANDLE.
If index_p is non-0, then return the index location of the
handle, if found.
int bind (ACE_HANDLE, ACE_Event_Handler *, ACE_Reactor_Mask);
ACE_Event_Handler * to the ACE_HANDLE with the
appropriate ACE_Reactor_Mask settings.
int unbind (ACE_HANDLE, ACE_Reactor_Mask mask);
ACE_HANDLE in accordance with the mask.
int unbind_all (void);
ACE_HANDLE, ACE_Event_Handler tuples.
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 max_handlep1 (void);
Maximum ACE_HANDLE value, plus 1.
void dump (void) const;
Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
Declare the dynamic allocation hooks.
AUTHOR
Doug Schmidt
LIBRARY
ace