ACE  6.4.2
Public Member Functions | Public Attributes | Private Attributes | List of all members
ACE_Dev_Poll_Reactor::Handler_Repository Class Reference

Used to map ACE_HANDLEs onto the appropriate Event_Tuple. More...

Collaboration diagram for ACE_Dev_Poll_Reactor::Handler_Repository:
Collaboration graph
[legend]

Public Member Functions

 Handler_Repository (void)
 Constructor. More...
 
int open (size_t size)
 
int close (void)
 Close down the repository. More...
 
size_t size (void) const
 Returns the current table size. More...
 
size_t max_size (void) const
 Returns the current table size. More...
 
void dump (void) const
 Dump the state of an object. More...
 
Repository Manipulation Operations

Methods used to search and modify the handler repository.

Event_Tuplefind (ACE_HANDLE handle)
 
int bind (ACE_HANDLE handle, ACE_Event_Handler *handler, ACE_Reactor_Mask mask)
 
int unbind (ACE_HANDLE handle, bool decr_refcnt=true)
 
int unbind_all (void)
 Remove all the registered tuples. More...
 
Sanity Checking

Methods used to prevent "out-of-range" errors when indexing the underlying handler array.

bool invalid_handle (ACE_HANDLE handle) const
 
bool handle_in_range (ACE_HANDLE handle) const
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 

Private Attributes

int size_
 Current number of handles. More...
 
int max_size_
 Maximum number of handles. More...
 
Event_Tuplehandlers_
 The underlying array of event handlers. More...
 

Detailed Description

Used to map ACE_HANDLEs onto the appropriate Event_Tuple.

This class is simply a container that maps a handle to its corresponding event tuple. It is not meant for use outside of the Dev_Poll_Reactor.

Note
Calls to any method in this class, and any modification to a Event_Tuple returned from this class's methods, must be made while holding the repository lock.

Constructor & Destructor Documentation

ACE_Dev_Poll_Reactor::Handler_Repository::Handler_Repository ( void  )

Constructor.

Member Function Documentation

int ACE_Dev_Poll_Reactor::Handler_Repository::bind ( ACE_HANDLE  handle,
ACE_Event_Handler handler,
ACE_Reactor_Mask  mask 
)

Bind the ACE_Event_Handler to the ACE_HANDLE with the appropriate ACE_Reactor_Mask settings.

int ACE_Dev_Poll_Reactor::Handler_Repository::close ( void  )

Close down the repository.

void ACE_Dev_Poll_Reactor::Handler_Repository::dump ( void  ) const

Dump the state of an object.

ACE_Dev_Poll_Reactor::Event_Tuple * ACE_Dev_Poll_Reactor::Handler_Repository::find ( ACE_HANDLE  handle)

Return a pointer to the Event_Tuple associated with handle. If there is none associated, returns 0 and sets errno.

bool ACE_Dev_Poll_Reactor::Handler_Repository::handle_in_range ( ACE_HANDLE  handle) const
bool ACE_Dev_Poll_Reactor::Handler_Repository::invalid_handle ( ACE_HANDLE  handle) const
size_t ACE_Dev_Poll_Reactor::Handler_Repository::max_size ( void  ) const
inline

Returns the current table size.

int ACE_Dev_Poll_Reactor::Handler_Repository::open ( size_t  size)

Initialize a repository that can map handles up to the value size. Since the event tuples are accessed directly using the handle as an index, size sets the maximum handle value, minus 1.

size_t ACE_Dev_Poll_Reactor::Handler_Repository::size ( void  ) const
inline

Returns the current table size.

int ACE_Dev_Poll_Reactor::Handler_Repository::unbind ( ACE_HANDLE  handle,
bool  decr_refcnt = true 
)

Remove the binding for handle; optionally decrement the associated handler's reference count.

int ACE_Dev_Poll_Reactor::Handler_Repository::unbind_all ( void  )

Remove all the registered tuples.

Member Data Documentation

ACE_Dev_Poll_Reactor::Handler_Repository::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

Event_Tuple* ACE_Dev_Poll_Reactor::Handler_Repository::handlers_
private

The underlying array of event handlers.

The array of event handlers is directly indexed directly using an ACE_HANDLE value. This is Unix-specific.

int ACE_Dev_Poll_Reactor::Handler_Repository::max_size_
private

Maximum number of handles.

int ACE_Dev_Poll_Reactor::Handler_Repository::size_
private

Current number of handles.


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