NAME
ACE_Double_Linked_List_Iterator -
Implement an iterator over a container double-linked list
SYNOPSIS
#include <ace/Containers.h>
template<class T>
class ACE_Double_Linked_List_Iterator
{
public:
ACE_Double_Linked_List_Iterator (ACE_Double_Linked_List<T> &);
T *next (void) const;
int advance (void);
int first (void);
int done (void) const;
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
protected:
T *not_done (void) const;
T *do_advance (void);
T *current_;
ACE_Double_Linked_List<T> &dllist_;
};
DESCRIPTION
Iterate thru the double-linked list. This class provide
an interface that let users access the internal element
addresses directly, which (IMHO) seems to break the
encasulation. Notice class T must delcare
ACE_Double_Linked_ListT and
ACE_Double_Linked_List_Iterator as friend classes.
Initialization method.
ACE_Double_Linked_List_Iterator (ACE_Double_Linked_List<T> &);
Iteration methods.
T *next (void) const;
Return the address of next (current) unvisited item in the list.
0 if there is no more element available.
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.
int first (void);
Move to the first element in the list. Returns 0 if the
list is empty, else 1.
int done (void) const;
Returns 1 when all items have been seen, else 0.
void dump (void) const;
Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
Declare the dynamic allocation hooks.
AUTHOR
Doug Schmidt
LIBRARY
ace