#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);
T* advance_and_remove (int dont_remove);
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_;
};
class T
must delcare
ACE_Double_Linked_ListT
and
ACE_Double_Linked_List_Iterator as friend classes and class T
should also have data members T* next_ and T* prev_.
ACE_Double_Linked_List_Iterator (ACE_Double_Linked_List<T> &);
T *next (void) const;
int advance (void);
T* advance_and_remove (int dont_remove);
dont_remove
equals 0, this function behaves like advance() but
return 0 (NULL) instead.
int first (void);
int done (void) const;
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;