ACE  6.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
ACE_Double_Linked_List_Reverse_Iterator< T > Class Template Reference

Implements a reverse iterator for a double linked list ADT. More...

#include <Containers_T.h>

Inheritance diagram for ACE_Double_Linked_List_Reverse_Iterator< T >:
Inheritance graph
[legend]
Collaboration diagram for ACE_Double_Linked_List_Reverse_Iterator< T >:
Collaboration graph
[legend]

Public Member Functions

 ACE_Double_Linked_List_Reverse_Iterator (ACE_Double_Linked_List< T > &)
 
void reset (ACE_Double_Linked_List< T > &)
 
int first (void)
 
int advance (void)
 
T * advance_and_remove (bool dont_remove)
 
ACE_Double_Linked_List_Reverse_Iterator
< T > & 
operator++ (void)
 Prefix advance. More...
 
ACE_Double_Linked_List_Reverse_Iterator
< T > 
operator++ (int)
 Postfix advance. More...
 
ACE_Double_Linked_List_Reverse_Iterator
< T > & 
operator-- (void)
 Prefix reverse. More...
 
ACE_Double_Linked_List_Reverse_Iterator
< T > 
operator-- (int)
 Postfix reverse. More...
 
void dump (void) const
 Dump the state of an object. More...
 
- Public Member Functions inherited from ACE_Double_Linked_List_Iterator_Base< T >
int next (T *&) const
 
T * next (void) const
 
int done (void) const
 Returns 1 when all items have been seen, else 0. More...
 
T & operator* (void) const
 
void reset (ACE_Double_Linked_List< T > &)
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 
- Public Attributes inherited from ACE_Double_Linked_List_Iterator_Base< T >
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ACE_Double_Linked_List_Iterator_Base< T >
 ACE_Double_Linked_List_Iterator_Base (const ACE_Double_Linked_List< T > &)
 Constructor. More...
 
 ACE_Double_Linked_List_Iterator_Base (const ACE_Double_Linked_List_Iterator_Base< T > &iter)
 Copy constructor. More...
 
int go_head (void)
 
int go_tail (void)
 
T * not_done (void) const
 
T * do_advance (void)
 
T * do_retreat (void)
 
void dump_i (void) const
 Dump the state of an object. More...
 
- Protected Attributes inherited from ACE_Double_Linked_List_Iterator_Base< T >
T * current_
 Remember where we are. More...
 
const ACE_Double_Linked_List< T > * dllist_
 

Detailed Description

template<class T>
class ACE_Double_Linked_List_Reverse_Iterator< T >

Implements a reverse iterator for a double linked list ADT.

Iterate backwards over the double-linked list. This class provide an interface that let users access the internal element addresses directly, which seems to break the encapsulation. Notice {class T} must declare ACE_Double_Linked_List<T>, ACE_Double_Linked_List_Iterator_Base <T> and ACE_Double_Linked_List_Iterator as friend classes and class T should also have data members T* next_ and T* prev_.

Constructor & Destructor Documentation

Member Function Documentation

template<class T >
int ACE_Double_Linked_List_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.

template<class T >
T * ACE_Double_Linked_List_Reverse_Iterator< T >::advance_and_remove ( bool  dont_remove)

Advance the iterator while removing the original item from the list. Return a pointer points to the original (removed) item. If dont_remove equals false, this function behaves like {advance} but return 0 (NULL) instead.

template<class T >
void ACE_Double_Linked_List_Reverse_Iterator< T >::dump ( void  ) const

Dump the state of an object.

template<class T >
int ACE_Double_Linked_List_Reverse_Iterator< T >::first ( void  )

Move to the first element in the list. Returns 0 if the list is empty, else 1.

template<class T >
ACE_Double_Linked_List_Reverse_Iterator< T > & ACE_Double_Linked_List_Reverse_Iterator< T >::operator++ ( void  )

Prefix advance.

template<class T >
ACE_Double_Linked_List_Reverse_Iterator< T > ACE_Double_Linked_List_Reverse_Iterator< T >::operator++ ( int  )

Postfix advance.

template<class T >
ACE_Double_Linked_List_Reverse_Iterator< T > & ACE_Double_Linked_List_Reverse_Iterator< T >::operator-- ( void  )

Prefix reverse.

template<class T >
ACE_Double_Linked_List_Reverse_Iterator< T > ACE_Double_Linked_List_Reverse_Iterator< T >::operator-- ( int  )

Postfix reverse.

template<class T>
void ACE_Double_Linked_List_Reverse_Iterator< T >::reset ( ACE_Double_Linked_List< T > &  dll)

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?

Member Data Documentation

template<class T>
ACE_Double_Linked_List_Reverse_Iterator< T >::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.


The documentation for this class was generated from the following files: