#include <Containers_T.h>
Inheritance diagram for ACE_DLList_Iterator< T >:
Public Member Functions | |
ACE_DLList_Iterator (ACE_DLList< T > &l) | |
void | reset (ACE_DLList< T > &l) |
int | advance (void) |
int | next (T *&) |
T * | next (void) const |
int | remove (void) |
void | dump (void) const |
Delegates to ACE_Double_Linked_List_Iterator. | |
Private Attributes | |
ACE_DLList< T > * | list_ |
Friends | |
class | ACE_DLList< T > |
class | ACE_DLList_Node |
This implementation uses ACE_Double_Linked_List_Iterator to perform the logic behind this container class. It delegates all of its calls to ACE_Double_Linked_List_Iterator.
Definition at line 1087 of file Containers_T.h.
ACE_INLINE ACE_DLList_Iterator< T >::ACE_DLList_Iterator | ( | ACE_DLList< T > & | l | ) |
Definition at line 379 of file Containers_T.inl.
00380 : ACE_Double_Linked_List_Iterator <ACE_DLList_Node> ((ACE_DLList_Base &)l), 00381 list_ (&l) 00382 { 00383 }
ACE_INLINE int ACE_DLList_Iterator< T >::advance | ( | void | ) |
Move forward by one element in the list. Returns 0 when all the items in the list have been seen, else 1.
Reimplemented from ACE_Double_Linked_List_Iterator< T >.
Definition at line 410 of file Containers_T.inl.
References ACE_Double_Linked_List_Iterator< ACE_DLList_Node >::advance().
00411 { 00412 return this->ACE_Double_Linked_List_Iterator <ACE_DLList_Node>::advance (); 00413 }
ACE_INLINE void ACE_DLList_Iterator< T >::dump | ( | void | ) | const |
Delegates to ACE_Double_Linked_List_Iterator.
Reimplemented from ACE_Double_Linked_List_Iterator< T >.
Definition at line 416 of file Containers_T.inl.
References ACE_Double_Linked_List_Iterator< ACE_DLList_Node >::dump().
00417 { 00418 #if defined (ACE_HAS_DUMP) 00419 ACE_Double_Linked_List_Iterator <ACE_DLList_Node>::dump (); 00420 #endif /* ACE_HAS_DUMP */ 00421 }
ACE_INLINE T * ACE_DLList_Iterator< T >::next | ( | void | ) | const |
Reimplemented from ACE_Double_Linked_List_Iterator_Base< T >.
Definition at line 403 of file Containers_T.inl.
References ACE_DLList_Node::item_, and ACE_Double_Linked_List_Iterator_Base< ACE_DLList_Node >::next().
00404 { 00405 ACE_DLList_Node *temp = ACE_Double_Linked_List_Iterator <ACE_DLList_Node>::next (); 00406 return (T *) (temp ? temp->item_ : 0); 00407 }
ACE_INLINE int ACE_DLList_Iterator< T >::next | ( | T *& | ) |
Pass back the {next_item} that hasn't been seen in the list. Returns 0 when all items have been seen, else 1.
Definition at line 393 of file Containers_T.inl.
References ACE_DLList_Node::item_, and ACE_Double_Linked_List_Iterator_Base< ACE_DLList_Node >::next().
00394 { 00395 ACE_DLList_Node *temp = 00396 ACE_Double_Linked_List_Iterator <ACE_DLList_Node>::next (); 00397 if (temp) 00398 ptr = (T *) temp->item_; 00399 return temp ? 1 : 0; 00400 }
ACE_INLINE int ACE_DLList_Iterator< T >::remove | ( | void | ) |
Removes the current item (i.e., {next}) from the list. Note that DLList iterators do not support {advance_and_remove} directly (defined in its base class) and you will need to release the element returned by it.
Definition at line 371 of file Containers_T.inl.
References ACE_Double_Linked_List_Iterator< ACE_DLList_Node >::advance(), ACE_DLList_Iterator< T >::list_, and ACE_Double_Linked_List_Iterator_Base< ACE_DLList_Node >::next().
00372 { 00373 ACE_DLList_Node *temp = this->ACE_Double_Linked_List_Iterator <ACE_DLList_Node>::next (); 00374 this->ACE_Double_Linked_List_Iterator <ACE_DLList_Node>::advance (); 00375 return list_->remove (temp); 00376 }
ACE_INLINE void ACE_DLList_Iterator< T >::reset | ( | ACE_DLList< T > & | l | ) |
Retasks the iterator to iterate over a new Double_Linked_List. This allows clients to reuse an iterator without incurring the constructor overhead. If you do use this, be aware that if there are more than one reference to this iterator, the other "clients" may be very bothered when their iterator changes. @ Here be dragons. Comments?
Definition at line 386 of file Containers_T.inl.
References ACE_DLList_Iterator< T >::list_, and ACE_Double_Linked_List_Iterator< ACE_DLList_Node >::reset().
00387 { 00388 list_ = &l; 00389 this->ACE_Double_Linked_List_Iterator <ACE_DLList_Node>::reset ((ACE_DLList_Base &)l); 00390 }
friend class ACE_DLList< T > [friend] |
Definition at line 1090 of file Containers_T.h.
friend class ACE_DLList_Node [friend] |
Definition at line 1091 of file Containers_T.h.
ACE_DLList<T>* ACE_DLList_Iterator< T >::list_ [private] |
Definition at line 1137 of file Containers_T.h.
Referenced by ACE_DLList_Iterator< T >::remove(), and ACE_DLList_Iterator< T >::reset().