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

ACE_DLList_Reverse_Iterator Class Template Reference

A double-linked list container class iterator. More...

#include <Containers_T.h>

Inheritance diagram for ACE_DLList_Reverse_Iterator:

Inheritance graph
[legend]
Collaboration diagram for ACE_DLList_Reverse_Iterator:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_DLList_Reverse_Iterator (ACE_DLList< T > &l)
void reset (ACE_DLList< T > &l)
int advance (void)
 Move forward by one element in the list. Returns 0 when all the items in the list have been seen, else 1. More...

int 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. More...

T * next (void) const
 
Deprecated:
Delegates to ACE_Double_Linked_List_Iterator.
More...


int 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. More...

void dump (void) const
 Delegates to ACE_Double_Linked_List_Iterator. More...


Private Attributes

ACE_DLList< T > * list_

Friends

class ACE_DLList< T >
class ACE_DLList_Node

Detailed Description

template<class T>
class ACE_DLList_Reverse_Iterator< T >

A double-linked list container class iterator.

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 1150 of file Containers_T.h.


Constructor & Destructor Documentation

template<class T>
ACE_INLINE ACE_DLList_Reverse_Iterator< T >::ACE_DLList_Reverse_Iterator ACE_DLList< T > &    l
 

Definition at line 429 of file Containers_T.i.

00430   : ACE_Double_Linked_List_Reverse_Iterator <ACE_DLList_Node> ((ACE_DLList_Base &)l),
00431     list_ (&l)
00432 {
00433 }


Member Function Documentation

template<class T>
ACE_INLINE int ACE_DLList_Reverse_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_Reverse_Iterator< ACE_DLList_Node >.

Definition at line 443 of file Containers_T.i.

00444 {
00445   return ACE_Double_Linked_List_Reverse_Iterator <ACE_DLList_Node>::advance ();
00446 }

template<class T>
ACE_INLINE void ACE_DLList_Reverse_Iterator< T >::dump void    const
 

Delegates to ACE_Double_Linked_List_Iterator.

Reimplemented from ACE_Double_Linked_List_Reverse_Iterator< ACE_DLList_Node >.

Definition at line 466 of file Containers_T.i.

00467 {
00468   ACE_Double_Linked_List_Reverse_Iterator <ACE_DLList_Node>::dump ();
00469 }

template<class T>
ACE_INLINE T * ACE_DLList_Reverse_Iterator< T >::next void    const
 

Deprecated:
Delegates to ACE_Double_Linked_List_Iterator.

Reimplemented from ACE_Double_Linked_List_Iterator_Base< ACE_DLList_Node >.

Definition at line 458 of file Containers_T.i.

References ACE_DLList_Node::item_.

00459 {
00460   ACE_DLList_Node *temp = ACE_Double_Linked_List_Reverse_Iterator <ACE_DLList_Node>::next ();
00461   return (T *) (temp ? temp->item_ : 0);
00462 }

template<class T>
ACE_INLINE int ACE_DLList_Reverse_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 449 of file Containers_T.i.

References ACE_DLList_Node::item_.

00450 {
00451   ACE_DLList_Node *temp =
00452     ACE_Double_Linked_List_Reverse_Iterator <ACE_DLList_Node>::next ();
00453   ptr = (T *) temp->item_;
00454   return ptr ? 1 : 0;
00455 }

template<class T>
ACE_INLINE int ACE_DLList_Reverse_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 421 of file Containers_T.i.

References list_.

00422 {
00423   ACE_DLList_Node *temp = ACE_Double_Linked_List_Reverse_Iterator <ACE_DLList_Node>::next ();
00424   this->ACE_Double_Linked_List_Reverse_Iterator <ACE_DLList_Node>::advance ();
00425   return list_->remove (temp);
00426 }

template<class T>
ACE_INLINE void ACE_DLList_Reverse_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 436 of file Containers_T.i.

References list_.

00437 {
00438   list_ = &l;
00439   this->ACE_Double_Linked_List_Reverse_Iterator <ACE_DLList_Node>::reset ((ACE_DLList_Base &)l);
00440 }


Friends And Related Function Documentation

template<class T>
friend class ACE_DLList< T > [friend]
 

Definition at line 1153 of file Containers_T.h.

template<class T>
friend class ACE_DLList_Node [friend]
 

Definition at line 1154 of file Containers_T.h.


Member Data Documentation

template<class T>
ACE_DLList<T>* ACE_DLList_Reverse_Iterator::list_ [private]
 

Definition at line 1194 of file Containers_T.h.

Referenced by remove, and reset.


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