ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > Class Template Reference

Base const iterator for the ACE_Hash_Map_Manager_Ex. More...

#include <Hash_Map_Manager_T.h>

Inheritance diagram for ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ACE_Hash_Map_Const_Iterator_Base_Ex (const ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &mm, int head)
int next (ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&next_entry) const
int done (void) const
 Returns 1 when all items have been seen, else 0.

ACE_Hash_Map_Entry< EXT_ID,
INT_ID > & 
operator * (void) const
 Returns a reference to the interal element this is pointing to.

ACE_Hash_Map_Entry< EXT_ID,
INT_ID > * 
operator-> (void) const
 Returns a pointer to the interal element this is pointing to.

const ACE_Hash_Map_Manager_Ex<
EXT_ID, INT_ID, HASH_KEY,
COMPARE_KEYS, ACE_LOCK > & 
map (void)
bool operator== (const ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &) const
 Check if two iterators point to the same position.

bool operator!= (const ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &) const

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Protected Member Functions

int forward_i (void)
int reverse_i (void)
void dump_i (void) const
 Dump the state of an object.


Protected Attributes

const ACE_Hash_Map_Manager_Ex<
EXT_ID, INT_ID, HASH_KEY,
COMPARE_KEYS, ACE_LOCK > * 
map_man_
 Map we are iterating over.

ssize_t index_
 Keeps track of how far we've advanced in the table.

ACE_Hash_Map_Entry< EXT_ID,
INT_ID > * 
next_

Detailed Description

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
class ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >

Base const iterator for the ACE_Hash_Map_Manager_Ex.

This class factors out common code from its templatized subclasses.

Definition at line 668 of file Hash_Map_Manager_T.h.


Constructor & Destructor Documentation

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Const_Iterator_Base_Ex const ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &  mm,
int  head
 

Contructor. If head != 0, the iterator constructed is positioned at the head of the map, it is positioned at the end otherwise.

Definition at line 617 of file Hash_Map_Manager_T.inl.

References ACE_TRACE, ssize_t, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size_.

00619   : map_man_ (&mm),
00620     index_ (head != 0 ? -1 : (ssize_t) mm.total_size_),
00621     next_ (0)
00622 {
00623   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::ACE_Hash_Map_Const_Iterator_Base_Ex");
00624 
00625   if (mm.table_ != 0)
00626     this->next_ = &mm.table_[head != 0 ? 0 : mm.total_size_ - 1];
00627 }


Member Function Documentation

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::done void   )  const
 

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

Definition at line 647 of file Hash_Map_Manager_T.inl.

References ACE_TRACE, and ssize_t.

00648 {
00649   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::done");
00650 
00651   return this->map_man_->table_ == 0
00652     || this->index_ >= (ssize_t) this->map_man_->total_size_
00653     || this->index_ < 0;
00654 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
void ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump_i void   )  const [protected]
 

Dump the state of an object.

Definition at line 459 of file Hash_Map_Manager_T.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_TEXT, ACE_TRACE, and LM_DEBUG.

Referenced by ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump().

00460 {
00461   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::dump_i");
00462 
00463   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00464   ACE_DEBUG ((LM_DEBUG,  ACE_TEXT ("index_ = %d "), this->index_));
00465   ACE_DEBUG ((LM_DEBUG,  ACE_TEXT ("next_ = %x"), this->next_));
00466   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00467 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::forward_i void   )  [protected]
 

Move forward by one element in the set. Returns 0 when there's no more item in the set after the current items, else 1.

Definition at line 470 of file Hash_Map_Manager_T.cpp.

References ACE_TRACE, and ssize_t.

Referenced by ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Const_Iterator_Ex(), ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::advance(), and ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator++().

00471 {
00472   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::forward_i");
00473 
00474   if (this->map_man_->table_ == 0)
00475     return -1;
00476   // Handle initial case specially.
00477   else if (this->index_ == -1)
00478     {
00479       this->index_++;
00480       return this->forward_i ();
00481     }
00482   else if (this->index_ >= (ssize_t) this->map_man_->total_size_)
00483     return 0;
00484 
00485   this->next_ = this->next_->next_;
00486   if (this->next_ == &this->map_man_->table_[this->index_])
00487     {
00488       while (++this->index_ < (ssize_t) this->map_man_->total_size_)
00489         {
00490           this->next_ = this->map_man_->table_[this->index_].next_;
00491           if (this->next_ != &this->map_man_->table_[this->index_])
00492             break;
00493         }
00494     }
00495 
00496   return this->index_ < (ssize_t) this->map_man_->total_size_;
00497 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE const ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > & ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map void   ) 
 

Returns reference the Hash_Map_Manager_Ex that is being iterated over.

Definition at line 690 of file Hash_Map_Manager_T.inl.

References ACE_TRACE.

00691 {
00692   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::map");
00693   return *this->map_man_;
00694 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  next_entry  )  const
 

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

Definition at line 630 of file Hash_Map_Manager_T.inl.

References ACE_TRACE, and ssize_t.

Referenced by ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator *(), and ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator->().

00631 {
00632   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::next");
00633 
00634   if (this->map_man_->table_ != 0
00635       && this->index_ < (ssize_t) this->map_man_->total_size_
00636       && this->index_ >= 0
00637       && this->next_ != &this->map_man_->table_[this->index_])
00638     {
00639       entry = this->next_;
00640       return 1;
00641     }
00642   else
00643     return 0;
00644 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Entry< EXT_ID, INT_ID > & ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator * void   )  const
 

Returns a reference to the interal element this is pointing to.

Definition at line 658 of file Hash_Map_Manager_T.inl.

References ACE_ASSERT, ACE_TRACE, and ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next().

00659 {
00660   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator*");
00661   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *retv = 0;
00662 
00663   int result = this->next (retv);
00664 
00665   ACE_UNUSED_ARG (result);
00666   ACE_ASSERT (result != 0);
00667 
00668   return *retv;
00669 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE bool ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator!= const ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &   )  const
 

Definition at line 706 of file Hash_Map_Manager_T.inl.

References ACE_TRACE, ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::index_, ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map_man_, and ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next_.

00707 {
00708   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator!=");
00709   return this->next_ != rhs.next_
00710     || this->index_ != rhs.index_
00711     || this->map_man_ != rhs.map_man_;
00712 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Entry< EXT_ID, INT_ID > * ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator-> void   )  const
 

Returns a pointer to the interal element this is pointing to.

Definition at line 673 of file Hash_Map_Manager_T.inl.

References ACE_ASSERT, ACE_TRACE, and ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next().

00674 {
00675   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator->");
00676   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *retv = 0;
00677 
00678   int result = this->next (retv);
00679 
00680   ACE_UNUSED_ARG (result);
00681   ACE_ASSERT (result != 0);
00682 
00683   return retv;
00684 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE bool ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator== const ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &   )  const
 

Check if two iterators point to the same position.

Definition at line 697 of file Hash_Map_Manager_T.inl.

References ACE_TRACE, ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::index_, ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map_man_, and ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next_.

00698 {
00699   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator==");
00700   return this->map_man_ == rhs.map_man_
00701     && this->index_ == rhs.index_
00702     && this->next_ == rhs.next_;
00703 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::reverse_i void   )  [protected]
 

Move backward by one element in the set. Returns 0 when there's no more item in the set before the current item, else 1.

Definition at line 500 of file Hash_Map_Manager_T.cpp.

References ACE_TRACE, and ssize_t.

Referenced by ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator--().

00501 {
00502   ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::reverse_i");
00503 
00504   if (this->map_man_->table_ == 0)
00505     return -1;
00506   else if (this->index_ == (ssize_t) this->map_man_->total_size_)
00507     {
00508       this->index_--;
00509       return this->reverse_i ();
00510     }
00511   else if (this->index_ < 0)
00512     return 0;
00513 
00514   this->next_ = this->next_->prev_;
00515   if (this->next_ == &this->map_man_->table_[this->index_])
00516     {
00517       while (--this->index_ >= 0)
00518         {
00519           this->next_ = this->map_man_->table_[this->index_].prev_;
00520           if (this->next_ != &this->map_man_->table_[this->index_])
00521             break;
00522         }
00523     }
00524 
00525   return this->index_ >= 0;
00526 }


Member Data Documentation

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented in ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >, and ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >.

Definition at line 701 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ssize_t ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::index_ [protected]
 

Keeps track of how far we've advanced in the table.

Definition at line 719 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator!=(), and ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator==().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>* ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map_man_ [protected]
 

Map we are iterating over.

Definition at line 716 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator!=(), and ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator==().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_Hash_Map_Entry<EXT_ID, INT_ID>* ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next_ [protected]
 

Keeps track of how far we've advanced in a linked list in each table slot.

Definition at line 723 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator!=(), and ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator==().


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 12:54:55 2008 for ACE by doxygen 1.3.6