NAME
ACE_Handler_Repository -
Used to map ACE_HANDLEs onto the appropriate ACE_Event_Handler *.
SYNOPSIS
#include <ace/Reactor.h>
class ACE_Handler_Repository
{
public:
friend class ACE_Handler_Repository_Iterator;
ACE_Handler_Repository (void);
int open (size_t size);
int close (ACE_Reactor *);
ACE_Event_Handler *find (ACE_HANDLE);
int bind (ACE_HANDLE, ACE_Event_Handler *);
int unbind (
ACE_HANDLE,
ACE_Handle_Set &rd_mask,
ACE_Handle_Set &wr_mask,
ACE_Handle_Set &ex_mask
);
int invalid_handle (ACE_HANDLE);
size_t max_handlep1 (void);
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
ssize_t max_size_;
ssize_t cur_size_;
struct ACE_NT_EH_Record
{
public:
ACE_HANDLE handle_;
ACE_Event_Handler *event_handler_;
};
ACE_NT_EH_Record *event_handlers_;
ACE_HANDLE max_handlep1_;
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 Reactor code.
Initialization and termination methods.
ACE_Handler_Repository (void);
Default "do-nothing" constructor.
int open (size_t size);
Initialize a repository of the appropriate size.
int close (ACE_Reactor *);
Destroy the handler and cleanup the Reactor.
Search structure operations.
ACE_Event_Handler *find (ACE_HANDLE);
Return the ACE_Event_Handler * associated with ACE_HANDLE.
int bind (ACE_HANDLE, ACE_Event_Handler *);
Bind the ACE_Event_Handler * to the ACE_HANDLE.
int unbind (
ACE_HANDLE,
ACE_Handle_Set &rd_mask,
ACE_Handle_Set &wr_mask,
ACE_Handle_Set &ex_mask
);
Remove the binding of ACE_HANDLE.
Performs sanity checking on the ACE_HANDLE.
int invalid_handle (ACE_HANDLE);
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