Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Select_Reactor_Handler_Repository Class Reference

Used to map <ACE_HANDLE>s onto the appropriate <ACE_Event_Handler> *. More...

`#include <Select_Reactor_Base.h>`

Collaboration diagram for ACE_Select_Reactor_Handler_Repository:

[legend]
List of all members.

## Public Methods
| ACE_Select_Reactor_Handler_Repository (ACE_Select_Reactor_Impl &)
| Default "do-nothing" constructor. More...
| ~ACE_Select_Reactor_Handler_Repository (void)
| dtor. More...
int | open (size_t size)
| Initialize a repository of the appropriate <size>. More...
int | close (void)
| Close down the repository. More...
ACE_Event_Handler * | find (ACE_HANDLE handle, size_t *index_p=0)
int | bind (ACE_HANDLE, ACE_Event_Handler *, ACE_Reactor_Mask)
| Bind the <ACE_Event_Handler *> to the <ACE_HANDLE> with the appropriate <ACE_Reactor_Mask> settings. More...
int | unbind (ACE_HANDLE, ACE_Reactor_Mask mask)
| Remove the binding of <ACE_HANDLE> in accordance with the <mask>. More...
int | unbind_all (void)
| Remove all the <ACE_HANDLE, ACE_Event_Handler> tuples. More...
int | invalid_handle (ACE_HANDLE handle)
int | handle_in_range (ACE_HANDLE handle)
size_t | size (void) const
| Returns the current table size. More...
size_t | max_handlep1 (void)
| Maximum ACE_HANDLE value, plus 1. More...
void | dump (void) const
| Dump the state of an object. More...
## Public Attributes
| ACE_ALLOC_HOOK_DECLARE
| Declare the dynamic allocation hooks. More...
## Private Attributes
ACE_Select_Reactor_Impl & | select_reactor_
| Reference to our <Select_Reactor>. More...
ssize_t | max_size_
| Maximum number of handles. More...
int | max_handlep1_
| The highest currently active handle, plus 1 (ranges between 0 and <max_size_>. More...
ACE_Event_Tuple * | event_handlers_
## Friends
class | ACE_Select_Reactor_Handler_Repository_Iterator

## Detailed Description

Used to map <ACE_HANDLE>s onto the appropriate <ACE_Event_Handler> *.

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.

## Constructor & Destructor Documentation

ACE_Select_Reactor_Handler_Repository::ACE_Select_Reactor_Handler_Repository | ( | ACE_Select_Reactor_Impl & | select_reactor | ) |

| Default "do-nothing" constructor.

ACE_INLINE ACE_Select_Reactor_Handler_Repository::~ACE_Select_Reactor_Handler_Repository | ( | void |  | ) |

| dtor.

## Member Function Documentation

int ACE_Select_Reactor_Handler_Repository::bind | ( | ACE_HANDLE | handle,
|  | ACE_Event_Handler * | event_handler,
|  | ACE_Reactor_Mask | mask
| ) |

| Bind the <ACE_Event_Handler *> to the <ACE_HANDLE> with the appropriate <ACE_Reactor_Mask> settings.

int ACE_Select_Reactor_Handler_Repository::close | ( | void |  | ) |

| Close down the repository.

void ACE_Select_Reactor_Handler_Repository::dump | ( | void |  | ) | const

| Dump the state of an object.

ACE_Event_Handler * ACE_Select_Reactor_Handler_Repository::find | ( | ACE_HANDLE | handle,
|  | size_t * | index_p = 0
| ) |

| Return the <ACE_Event_Handler *> associated with <ACE_HANDLE>. If <index_p> is non-0, then return the index location of the <handle>, if found.

int ACE_Select_Reactor_Handler_Repository::handle_in_range | ( | ACE_HANDLE | handle | ) |

int ACE_Select_Reactor_Handler_Repository::invalid_handle | ( | ACE_HANDLE | handle | ) |

size_t ACE_Select_Reactor_Handler_Repository::max_handlep1 | ( | void |  | ) |

| Maximum ACE_HANDLE value, plus 1.

int ACE_Select_Reactor_Handler_Repository::open | ( | size_t | size | ) |

| Initialize a repository of the appropriate <size>. On Unix platforms, the size parameter should be as large as the maximum number of file descriptors allowed for a given process. This is necessary since a file descriptor is used to directly index the array of event handlers maintained by the Reactor's handler repository. Direct indexing is used for efficiency reasons.

ACE_INLINE size_t ACE_Select_Reactor_Handler_Repository::size | ( | void |  | ) | const

| Returns the current table size.

int ACE_Select_Reactor_Handler_Repository::unbind | ( | ACE_HANDLE | handle,
|  | ACE_Reactor_Mask | mask
| ) |

| Remove the binding of <ACE_HANDLE> in accordance with the <mask>.

int ACE_Select_Reactor_Handler_Repository::unbind_all | ( | void |  | ) |

| Remove all the <ACE_HANDLE, ACE_Event_Handler> tuples.

## Friends And Related Function Documentation

friend class ACE_Select_Reactor_Handler_Repository_Iterator`[friend]`

## Member Data Documentation

ACE_Select_Reactor_Handler_Repository::ACE_ALLOC_HOOK_DECLARE

| Declare the dynamic allocation hooks.

ACE_Event_Tuple* ACE_Select_Reactor_Handler_Repository::event_handlers_`[private]`

| The NT version implements this via a dynamically allocated array of <ACE_Event_Tuple *>. Since NT implements ACE_HANDLE as a void * we can't directly index into this array. Therefore, we just do a linear search (for now). Next, we'll modify things to use hashing or something faster...

int ACE_Select_Reactor_Handler_Repository::max_handlep1_`[private]`

| The highest currently active handle, plus 1 (ranges between 0 and <max_size_>.

ssize_t ACE_Select_Reactor_Handler_Repository::max_size_`[private]`

| Maximum number of handles.

ACE_Select_Reactor_Impl& ACE_Select_Reactor_Handler_Repository::select_reactor_`[private]`

| Reference to our <Select_Reactor>.

The documentation for this class was generated from the following files:

- Select_Reactor_Base.h
- Select_Reactor_Base.cpp
- Select_Reactor_Base.i