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

ACE_Map_Const_Iterator Class Template Reference

Forward const iterator for the ACE_Map_Manager. More...

#include <Map_Manager.h>

Inheritance diagram for ACE_Map_Const_Iterator:

Inheritance graph
[legend]
Collaboration diagram for ACE_Map_Const_Iterator:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Map_Const_Iterator (const 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_Const_Iterator< EXT_ID,
INT_ID, ACE_LOCK > & 
operator++ (void)
 Prefix advance. More...

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

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

ACE_Map_Const_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_Const_Iterator< EXT_ID, INT_ID, ACE_LOCK >

Forward const 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 617 of file Map_Manager.h.


Constructor & Destructor Documentation

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

Definition at line 560 of file Map_Manager.i.

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

00562   : ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> (mm)
00563 {
00564   if (!pass_end)
00565     {
00566 
00567 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00568 
00569       // Start here.
00570       this->next_ = this->map_man_->occupied_list_.next ();
00571 
00572       while (1)
00573         {
00574           // Stop if we reach the end.
00575           if (this->done ())
00576             break;
00577 
00578           // Break if we find a non-free slot.
00579           if (!this->map_man_->search_structure_[this->next_].free_)
00580             {
00581               break;
00582             }
00583 
00584           // Go to the next item in the list.
00585           this->next_ = this->map_man_->search_structure_[this->next_].next ();
00586         }
00587 
00588 #else
00589 
00590       this->next_ = this->map_man_->occupied_list_.next ();
00591 
00592 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00593 
00594     }
00595 }


Member Function Documentation

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

References ACE_Map_Const_Iterator_Base::forward_i.

00599 {
00600   return this->forward_i ();
00601 }

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

Dump the state of an object.

Definition at line 681 of file Map_Manager.cpp.

References ACE_Map_Const_Iterator_Base::dump_i.

00682 {
00683   this->dump_i ();
00684 }

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

Postfix advance.

Definition at line 613 of file Map_Manager.i.

References ACE_Map_Const_Iterator_Base::forward_i.

00614 {
00615   ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00616   this->forward_i ();
00617   return retv;
00618 }

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

Prefix advance.

Definition at line 605 of file Map_Manager.i.

References ACE_Map_Const_Iterator_Base::forward_i.

00606 {
00607   this->forward_i ();
00608   return *this;
00609 }

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

Postfix reverse.

Definition at line 630 of file Map_Manager.i.

References ACE_Map_Const_Iterator_Base::reverse_i.

00631 {
00632   ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00633   this->reverse_i ();
00634   return retv;
00635 }

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

Prefix reverse.

Definition at line 622 of file Map_Manager.i.

References ACE_Map_Const_Iterator_Base::reverse_i.

00623 {
00624   this->reverse_i ();
00625   return *this;
00626 }


Member Data Documentation

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

Declare the dynamic allocation hooks.

Reimplemented from ACE_Map_Const_Iterator_Base.

Definition at line 648 of file Map_Manager.h.


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