#include <Hash_Map_Manager_T.h>
Inheritance diagram for ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >:
Public Member Functions | |
ACE_Hash_Map_Iterator_Base_Ex (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 is pointing to. | |
ACE_Hash_Map_Entry< EXT_ID, INT_ID > * | operator-> (void) const |
Returns a pointer to the interal element is pointing to. | |
ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > & | map (void) |
bool | operator== (const ACE_Hash_Map_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_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 | |
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_ |
This class factors out common code from its templatized subclasses.
Definition at line 539 of file Hash_Map_Manager_T.h.
|
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 398 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_.
00400 : map_man_ (&mm), 00401 index_ (head != 0 ? -1 : (ssize_t) mm.total_size_), 00402 next_ (0) 00403 { 00404 ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::ACE_Hash_Map_Iterator_Base_Ex"); 00405 00406 if (mm.table_ != 0) 00407 this->next_ = &mm.table_[head != 0 ? 0 : mm.total_size_ - 1]; 00408 } |
|
Returns 1 when all items have been seen, else 0.
Definition at line 428 of file Hash_Map_Manager_T.inl. References ACE_TRACE, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map_man_.
|
|
Dump the state of an object.
Definition at line 390 of file Hash_Map_Manager_T.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, and LM_DEBUG. Referenced by ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump(), and ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump().
00391 { 00392 ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::dump_i"); 00393 00394 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); 00395 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("index_ = %d "), this->index_)); 00396 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("next_ = %x"), this->next_)); 00397 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); 00398 } |
|
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 401 of file Hash_Map_Manager_T.cpp. References ACE_TRACE, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map_man_. Referenced by ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Iterator_Ex(), ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::advance(), ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator++(), and ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator--().
00402 { 00403 ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::forward_i"); 00404 00405 if (this->map_man_->table_ == 0) 00406 return -1; 00407 // Handle initial case specially. 00408 else if (this->index_ == -1) 00409 { 00410 this->index_++; 00411 return this->forward_i (); 00412 } 00413 else if (this->index_ >= static_cast<ssize_t> (this->map_man_->total_size_)) 00414 return 0; 00415 00416 this->next_ = this->next_->next_; 00417 if (this->next_ == &this->map_man_->table_[this->index_]) 00418 { 00419 while (++this->index_ < static_cast<ssize_t> (this->map_man_->total_size_)) 00420 { 00421 this->next_ = this->map_man_->table_[this->index_].next_; 00422 if (this->next_ != &this->map_man_->table_[this->index_]) 00423 break; 00424 } 00425 } 00426 00427 return this->index_ < static_cast<ssize_t> (this->map_man_->total_size_); 00428 } |
|
Returns reference the Hash_Map_Manager_Ex that is being iterated over. Definition at line 471 of file Hash_Map_Manager_T.inl. References ACE_TRACE, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map_man_.
|
|
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 411 of file Hash_Map_Manager_T.inl. References ACE_TRACE, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map_man_. Referenced by ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator *(), and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator->().
00412 { 00413 ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::next"); 00414 00415 if (this->map_man_->table_ != 0 00416 && this->index_ < static_cast<ssize_t> (this->map_man_->total_size_) 00417 && this->index_ >= 0 00418 && this->next_ != &this->map_man_->table_[this->index_]) 00419 { 00420 entry = this->next_; 00421 return 1; 00422 } 00423 else 00424 return 0; 00425 } |
|
Returns a reference to the interal element is pointing to.
Definition at line 439 of file Hash_Map_Manager_T.inl. References ACE_ASSERT, ACE_TRACE, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next().
00440 { 00441 ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator*"); 00442 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *retv = 0; 00443 00444 int result = this->next (retv); 00445 00446 ACE_UNUSED_ARG (result); 00447 ACE_ASSERT (result != 0); 00448 00449 return *retv; 00450 } |
|
|
Returns a pointer to the interal element is pointing to.
Definition at line 454 of file Hash_Map_Manager_T.inl. References ACE_ASSERT, ACE_TRACE, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next().
00455 { 00456 ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator->"); 00457 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *retv = 0; 00458 00459 int result = this->next (retv); 00460 00461 ACE_UNUSED_ARG (result); 00462 ACE_ASSERT (result != 0); 00463 00464 return retv; 00465 } |
|
Check if two iterators point to the same position.
Definition at line 478 of file Hash_Map_Manager_T.inl. References ACE_TRACE, ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::index_, ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map_man_, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::next_.
|
|
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 431 of file Hash_Map_Manager_T.cpp. References ACE_TRACE, and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::map_man_. Referenced by ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Reverse_Iterator_Ex(), ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::advance(), ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator++(), and ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator--().
00432 { 00433 ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::reverse_i"); 00434 00435 if (this->map_man_->table_ == 0) 00436 return -1; 00437 else if (this->index_ == static_cast<ssize_t> (this->map_man_->total_size_)) 00438 { 00439 this->index_--; 00440 return this->reverse_i (); 00441 } 00442 else if (this->index_ < 0) 00443 return 0; 00444 00445 this->next_ = this->next_->prev_; 00446 if (this->next_ == &this->map_man_->table_[this->index_]) 00447 { 00448 while (--this->index_ >= 0) 00449 { 00450 this->next_ = this->map_man_->table_[this->index_].prev_; 00451 if (this->next_ != &this->map_man_->table_[this->index_]) 00452 break; 00453 } 00454 } 00455 00456 return this->index_ >= 0; 00457 } |
|
|
Keeps track of how far we've advanced in the table.
Definition at line 590 of file Hash_Map_Manager_T.h. Referenced by ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator!=(), and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator==(). |
|
|
Keeps track of how far we've advanced in a linked list in each table slot. Definition at line 594 of file Hash_Map_Manager_T.h. Referenced by ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator!=(), and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator==(). |