ACE_Select_Reactor_Handler_Repository_Iterator Class Reference

Iterate through the ACE_Select_Reactor_Handler_Repository. More...

#include <Select_Reactor_Base.h>

Collaboration diagram for ACE_Select_Reactor_Handler_Repository_Iterator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_Select_Reactor_Handler_Repository_Iterator (const ACE_Select_Reactor_Handler_Repository *s)
 ~ACE_Select_Reactor_Handler_Repository_Iterator (void)
 dtor.

int next (ACE_Event_Handler *&next_item)
int done (void) const
 Returns 1 when all items have been seen, else 0.

int advance (void)
void dump (void) const
 Dump the state of an object.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Private Attributes

const ACE_Select_Reactor_Handler_Repositoryrep_
 Reference to the Handler_Repository we are iterating over.

ssize_t current_
 Pointer to the current iteration level.


Detailed Description

Iterate through the ACE_Select_Reactor_Handler_Repository.

Definition at line 384 of file Select_Reactor_Base.h.


Constructor & Destructor Documentation

ACE_Select_Reactor_Handler_Repository_Iterator::ACE_Select_Reactor_Handler_Repository_Iterator const ACE_Select_Reactor_Handler_Repository s  ) 
 

Definition at line 458 of file Select_Reactor_Base.cpp.

00459     : rep_ (s),
00460       current_ (-1)
00461 {
00462   this->advance ();
00463 }

ACE_INLINE ACE_Select_Reactor_Handler_Repository_Iterator::~ACE_Select_Reactor_Handler_Repository_Iterator void   ) 
 

dtor.

Definition at line 20 of file Select_Reactor_Base.inl.

References ~ACE_Select_Reactor_Handler_Repository_Iterator().

Referenced by ~ACE_Select_Reactor_Handler_Repository_Iterator().

00021 {
00022 }


Member Function Documentation

int ACE_Select_Reactor_Handler_Repository_Iterator::advance void   ) 
 

Move forward by one element in the set. Returns 0 when all the items in the set have been seen, else 1.

Definition at line 490 of file Select_Reactor_Base.cpp.

References ACE_SELECT_REACTOR_EVENT_HANDLER, and ACE_Select_Reactor_Handler_Repository::max_handlep1_.

00491 {
00492   if (this->current_ < this->rep_->max_handlep1_)
00493     ++this->current_;
00494 
00495   while (this->current_ < this->rep_->max_handlep1_)
00496     if (ACE_SELECT_REACTOR_EVENT_HANDLER (this->rep_, this->current_) != 0)
00497       return 1;
00498     else
00499       ++this->current_;
00500 
00501   return this->current_ < this->rep_->max_handlep1_;
00502 }

int ACE_Select_Reactor_Handler_Repository_Iterator::done void   )  const
 

Returns 1 when all items have been seen, else 0.

Definition at line 482 of file Select_Reactor_Base.cpp.

References done(), and ACE_Select_Reactor_Handler_Repository::max_handlep1_.

Referenced by done().

00483 {
00484   return this->current_ >= this->rep_->max_handlep1_;
00485 }

void ACE_Select_Reactor_Handler_Repository_Iterator::dump void   )  const
 

Dump the state of an object.

Definition at line 507 of file Select_Reactor_Base.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, dump(), and LM_DEBUG.

Referenced by dump().

00508 {
00509 #if defined (ACE_HAS_DUMP)
00510   ACE_TRACE ("ACE_Select_Reactor_Handler_Repository_Iterator::dump");
00511 
00512   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00513   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("rep_ = %u"), this->rep_));
00514   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("current_ = %d"), this->current_));
00515   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00516 #endif /* ACE_HAS_DUMP */
00517 }

int ACE_Select_Reactor_Handler_Repository_Iterator::next ACE_Event_Handler *&  next_item  ) 
 

Pass back the that hasn't been seen in the Set. Returns 0 when all items have been seen, else 1.

Definition at line 469 of file Select_Reactor_Base.cpp.

References ACE_SELECT_REACTOR_EVENT_HANDLER, ACE_Select_Reactor_Handler_Repository::max_handlep1_, and next().

Referenced by next().

00470 {
00471   int result = 1;
00472 
00473   if (this->current_ >= this->rep_->max_handlep1_)
00474     result = 0;
00475   else
00476     next_item = ACE_SELECT_REACTOR_EVENT_HANDLER (this->rep_,
00477                                                   this->current_);
00478   return result;
00479 }


Member Data Documentation

ACE_Select_Reactor_Handler_Repository_Iterator::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 410 of file Select_Reactor_Base.h.

ssize_t ACE_Select_Reactor_Handler_Repository_Iterator::current_ [private]
 

Pointer to the current iteration level.

Definition at line 417 of file Select_Reactor_Base.h.

const ACE_Select_Reactor_Handler_Repository* ACE_Select_Reactor_Handler_Repository_Iterator::rep_ [private]
 

Reference to the Handler_Repository we are iterating over.

Definition at line 414 of file Select_Reactor_Base.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:28:39 2006 for ACE by doxygen 1.3.6