ACE 8.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
ACE_Select_Reactor_Handler_Repository Class Reference

Used to map ACE_HANDLEs onto the appropriate ACE_Event_Handler *. More...

#include <Select_Reactor_Base.h>

Collaboration diagram for ACE_Select_Reactor_Handler_Repository:
Collaboration graph
[legend]

Public Types

typedef ACE_HANDLE key_type
 
typedef ACE_Event_Handlervalue_type
 
typedef ACE_Hash_Map_Manager_Ex< key_type, value_type, ACE_Hash< key_type >, std::equal_to< key_type >, ACE_Null_Mutexmap_type
 
typedef map_type::size_type max_handlep1_type
 
typedef map_type::size_type size_type
 

Public Member Functions

 ACE_Select_Reactor_Handler_Repository (ACE_Select_Reactor_Impl &)
 Default "do-nothing" constructor.
 
int open (size_type size)
 Initialize a repository of the appropriate size.
 
int close ()
 Close down the repository.
 
ACE_Event_Handlerfind (ACE_HANDLE handle)
 
int bind (ACE_HANDLE, ACE_Event_Handler *, ACE_Reactor_Mask)
 
int unbind (ACE_HANDLE, ACE_Reactor_Mask mask)
 Remove the binding of ACE_HANDLE in accordance with the mask.
 
int unbind_all ()
 Remove all the <ACE_HANDLE, ACE_Event_Handler> tuples.
 
bool invalid_handle (ACE_HANDLE handle)
 
bool handle_in_range (ACE_HANDLE handle)
 
size_type size () const
 Returns the current table size.
 
max_handlep1_type max_handlep1 () const
 Maximum ACE_HANDLE value, plus 1.
 
void dump () const
 Dump the state of an object.
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Private Member Functions

int unbind (ACE_HANDLE handle, map_type::iterator pos, ACE_Reactor_Mask mask)
 
map_type::iterator find_eh (ACE_HANDLE handle)
 

Private Attributes

ACE_Select_Reactor_Implselect_reactor_
 Reference to our Select_Reactor.
 
map_type event_handlers_
 Underlying table of event handlers.
 

Friends

class ACE_Select_Reactor_Handler_Repository_Iterator
 

Detailed Description

Used to map ACE_HANDLEs 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.

Member Typedef Documentation

◆ key_type

◆ map_type

The NT version implements this via a hash map ACE_Event_Handler*. Since NT implements ACE_HANDLE as a void * we can't directly index into this array. Therefore, we must explicitly map ACE_HANDLE to ACE_Event_Handler.

◆ max_handlep1_type

◆ size_type

◆ value_type

Constructor & Destructor Documentation

◆ ACE_Select_Reactor_Handler_Repository()

ACE_Select_Reactor_Handler_Repository::ACE_Select_Reactor_Handler_Repository ( ACE_Select_Reactor_Impl & select_reactor)

Default "do-nothing" constructor.

Member Function Documentation

◆ bind()

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.

◆ close()

int ACE_Select_Reactor_Handler_Repository::close ( )

Close down the repository.

◆ dump()

void ACE_Select_Reactor_Handler_Repository::dump ( ) const

Dump the state of an object.

◆ find()

ACE_Event_Handler * ACE_Select_Reactor_Handler_Repository::find ( ACE_HANDLE handle)
inline

Return the ACE_Event_Handler* associated with ACE_HANDLE.

◆ find_eh()

ACE_Select_Reactor_Handler_Repository::map_type::iterator ACE_Select_Reactor_Handler_Repository::find_eh ( ACE_HANDLE handle)
private
Returns
iterator corresponding ACE_Event_Handler* associated with ACE_HANDLE.

◆ handle_in_range()

bool ACE_Select_Reactor_Handler_Repository::handle_in_range ( ACE_HANDLE handle)

◆ invalid_handle()

bool ACE_Select_Reactor_Handler_Repository::invalid_handle ( ACE_HANDLE handle)

◆ max_handlep1()

ACE_Select_Reactor_Handler_Repository::max_handlep1_type ACE_Select_Reactor_Handler_Repository::max_handlep1 ( ) const
inline

Maximum ACE_HANDLE value, plus 1.

◆ open()

int ACE_Select_Reactor_Handler_Repository::open ( size_type 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.

◆ size()

ACE_Select_Reactor_Handler_Repository::size_type ACE_Select_Reactor_Handler_Repository::size ( ) const
inline

Returns the current table size.

◆ unbind() [1/2]

int ACE_Select_Reactor_Handler_Repository::unbind ( ACE_HANDLE handle,
map_type::iterator pos,
ACE_Reactor_Mask mask )
private

Remove the binding of handle corresponding to position pos in accordance with the mask.

◆ unbind() [2/2]

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

Remove the binding of ACE_HANDLE in accordance with the mask.

◆ unbind_all()

int ACE_Select_Reactor_Handler_Repository::unbind_all ( )

Remove all the <ACE_HANDLE, ACE_Event_Handler> tuples.

Friends And Related Symbol Documentation

◆ ACE_Select_Reactor_Handler_Repository_Iterator

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

ACE_Select_Reactor_Handler_Repository::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ event_handlers_

map_type ACE_Select_Reactor_Handler_Repository::event_handlers_
private

Underlying table of event handlers.

◆ select_reactor_

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: