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

ACE_Map_Iterator Class Template Reference

Forward iterator for the ACE_Map_Manager. More...

#include <Map_Manager.h>

Inheritance diagram for ACE_Map_Iterator:

Inheritance graph
[legend]
Collaboration diagram for ACE_Map_Iterator:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Map_Iterator (ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK > &mm, int pass_end=0)
int advance (void)
 Move forward by one element in the set. Returns 0 when all the items in the set have been seen, else 1. More...

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

ACE_Map_Iterator< EXT_ID,
INT_ID, ACE_LOCK > & 
operator++ (void)
 Prefix advance. More...

ACE_Map_Iterator< EXT_ID,
INT_ID, ACE_LOCK > 
operator++ (int)
 Postfix advance. More...

ACE_Map_Iterator< EXT_ID,
INT_ID, ACE_LOCK > & 
operator-- (void)
 Prefix reverse. More...

ACE_Map_Iterator< EXT_ID,
INT_ID, ACE_LOCK > 
operator-- (int)
 Postfix reverse. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Detailed Description

template<class EXT_ID, class INT_ID, class ACE_LOCK>
class ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >

Forward iterator for the ACE_Map_Manager.

This class does not perform any internal locking of the <ACE_Map_Manager> it is iterating upon since locking is inherently inefficient and/or error-prone within an STL-style iterator. If you require locking, you can explicitly use an <ACE_Guard> or <ACE_Read_Guard> on the <ACE_Map_Manager>'s internal lock, which is accessible via its <mutex> method.

Definition at line 570 of file Map_Manager.h.


Constructor & Destructor Documentation

template<class EXT_ID, class INT_ID, class ACE_LOCK>
ACE_INLINE ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >::ACE_Map_Iterator ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK > &    mm,
int    pass_end = 0
 

Definition at line 482 of file Map_Manager.i.

References ACE_Map_Iterator_Base::done, ACE_Map_Iterator_Base::map_man_, and ACE_Map_Iterator_Base::next_.

00484   : ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> (mm)
00485 {
00486   if (!pass_end)
00487     {
00488 
00489 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00490 
00491       // Start here.
00492       this->next_ = this->map_man_->occupied_list_.next ();
00493 
00494       while (1)
00495         {
00496           // Stop if we reach the end.
00497           if (this->done ())
00498             break;
00499 
00500           // Break if we find a non-free slot.
00501           if (!this->map_man_->search_structure_[this->next_].free_)
00502             {
00503               break;
00504             }
00505 
00506           // Go to the next item in the list.
00507           this->next_ = this->map_man_->search_structure_[this->next_].next ();
00508         }
00509 
00510 #else
00511 
00512       this->next_ = this->map_man_->occupied_list_.next ();
00513 
00514 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00515 
00516     }
00517 }


Member Function Documentation

template<class EXT_ID, class INT_ID, class ACE_LOCK>
ACE_INLINE int ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >::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 520 of file Map_Manager.i.

References ACE_Map_Iterator_Base::forward_i.

Referenced by ACE_Token_Collection::acquire, ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::cancel, ACE_WIN32_Asynch_Connect::cancel_uncompleted, ACE_POSIX_Asynch_Connect::cancel_uncompleted, ACE_Token_Manager::check_deadlock, ACE_Token_Collection::release, ACE_Token_Collection::renew, ACE_Token_Manager::token_waiting_for, ACE_Token_Collection::tryacquire, ACE_Token_Collection::~ACE_Token_Collection, ACE_Token_Invariant_Manager::~ACE_Token_Invariant_Manager, and ACE_Token_Manager::~ACE_Token_Manager.

00521 {
00522   return this->forward_i ();
00523 }

template<class EXT_ID, class INT_ID, class ACE_LOCK>
void ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >::dump void    const
 

Dump the state of an object.

Definition at line 675 of file Map_Manager.cpp.

References ACE_Map_Iterator_Base::dump_i.

00676 {
00677   this->dump_i ();
00678 }

template<class EXT_ID, class INT_ID, class ACE_LOCK>
ACE_INLINE ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK > ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >::operator++ int   
 

Postfix advance.

Definition at line 535 of file Map_Manager.i.

References ACE_Map_Iterator_Base::forward_i.

00536 {
00537   ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00538   this->forward_i ();
00539   return retv;
00540 }

template<class EXT_ID, class INT_ID, class ACE_LOCK>
ACE_INLINE ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK > & ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >::operator++ void   
 

Prefix advance.

Definition at line 527 of file Map_Manager.i.

References ACE_Map_Iterator_Base::forward_i.

00528 {
00529   this->forward_i ();
00530   return *this;
00531 }

template<class EXT_ID, class INT_ID, class ACE_LOCK>
ACE_INLINE ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK > ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >::operator-- int   
 

Postfix reverse.

Definition at line 552 of file Map_Manager.i.

References ACE_Map_Iterator_Base::reverse_i.

00553 {
00554   ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00555   this->reverse_i ();
00556   return retv;
00557 }

template<class EXT_ID, class INT_ID, class ACE_LOCK>
ACE_INLINE ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK > & ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >::operator-- void   
 

Prefix reverse.

Definition at line 544 of file Map_Manager.i.

References ACE_Map_Iterator_Base::reverse_i.

00545 {
00546   this->reverse_i ();
00547   return *this;
00548 }


Member Data Documentation

template<class EXT_ID, class INT_ID, class ACE_LOCK>
ACE_Map_Iterator::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_Map_Iterator_Base.

Definition at line 601 of file Map_Manager.h.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:50:02 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002