ACE_Map_Const_Iterator< EXT_ID, INT_ID, ACE_LOCK > Class Template Reference

Forward const iterator for the ACE_Map_Manager. More...

#include <Map_Manager.h>

Inheritance diagram for ACE_Map_Const_Iterator< EXT_ID, INT_ID, ACE_LOCK >:

Inheritance graph
[legend]
Collaboration diagram for ACE_Map_Const_Iterator< EXT_ID, INT_ID, ACE_LOCK >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_Map_Const_Iterator (const ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK > &mm, int pass_end=0)
int advance (void)
void dump (void) const
 Dump the state of an object.
ACE_Map_Const_Iterator< EXT_ID,
INT_ID, ACE_LOCK > & 
operator++ (void)
 Prefix advance.
ACE_Map_Const_Iterator< EXT_ID,
INT_ID, ACE_LOCK > 
operator++ (int)
 Postfix advance.
ACE_Map_Const_Iterator< EXT_ID,
INT_ID, ACE_LOCK > & 
operator-- (void)
 Prefix reverse.
ACE_Map_Const_Iterator< EXT_ID,
INT_ID, ACE_LOCK > 
operator-- (int)
 Postfix reverse.

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.

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 622 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 574 of file Map_Manager.inl.

References ACE_Map_Const_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK >::map_man_, and ACE_Map_Const_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK >::next_.

00576   : ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> (mm)
00577 {
00578   if (!pass_end)
00579     {
00580 
00581 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00582 
00583       // Start here.
00584       this->next_ = this->map_man_->occupied_list_.next ();
00585 
00586       while (1)
00587         {
00588           // Stop if we reach the end.
00589           if (this->done ())
00590             break;
00591 
00592           // Break if we find a non-free slot.
00593           if (!this->map_man_->search_structure_[this->next_].free_)
00594             {
00595               break;
00596             }
00597 
00598           // Go to the next item in the list.
00599           this->next_ = this->map_man_->search_structure_[this->next_].next ();
00600         }
00601 
00602 #else
00603 
00604       this->next_ = this->map_man_->occupied_list_.next ();
00605 
00606 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00607 
00608     }
00609 }


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 612 of file Map_Manager.inl.

References ACE_Map_Const_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK >::forward_i().

00613 {
00614   return this->forward_i ();
00615 }

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 684 of file Map_Manager.cpp.

References ACE_Map_Const_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK >::dump_i().

00685 {
00686 #if defined (ACE_HAS_DUMP)
00687   this->dump_i ();
00688 #endif /* ACE_HAS_DUMP */
00689 }

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 627 of file Map_Manager.inl.

00628 {
00629   ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00630   ++*this;
00631   return retv;
00632 }

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 619 of file Map_Manager.inl.

References ACE_Map_Const_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK >::forward_i().

00620 {
00621   this->forward_i ();
00622   return *this;
00623 }

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 644 of file Map_Manager.inl.

00645 {
00646   ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00647   --*this;
00648   return retv;
00649 }

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 636 of file Map_Manager.inl.

References ACE_Map_Const_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK >::reverse_i().

00637 {
00638   this->reverse_i ();
00639   return *this;
00640 }


Member Data Documentation

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

Declare the dynamic allocation hooks.

Reimplemented from ACE_Map_Const_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK >.

Definition at line 653 of file Map_Manager.h.


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:35:18 2010 for ACE by  doxygen 1.4.7