1 #ifndef UTIL_LIST_ITERATOR_H 2 #define UTIL_LIST_ITERATOR_H 4 #include <util/containers/Node.h> 9 template <
typename Data>
class List;
26 template <
typename Data>
54 { list.
begin(*
this); }
62 { current_ = nodePtr; }
73 {
return (current_ == 0); }
81 {
return (current_->next() == 0); }
89 {
return (current_->previous() == 0); }
100 {
return current_->data(); }
108 {
return current_->data(); }
116 {
return &(current_->data()); }
124 {
return &(current_->data()); }
138 current_ = current_->next();
152 current_ = current_->prev();
ListIterator< Data > & operator++()
Go to the next element in a linked list.
ListIterator(const List< Data > &list)
Constructor for initialized iterator.
const Data & operator*() const
Get a const reference to the associated Data object.
const Data * operator->() const
Get a pointer to const to the associated Data object.
void begin(ListIterator< Data > &iterator) const
Set an iterator to the front of this List.
bool isBack() const
Is this the back of the List?
ListIterator()
Default constructor.
Utility classes for scientific computation.
bool isFront() const
Is this the front of the List?
Linked list class template.
Bidirectional iterator for a List.
bool isEnd() const
Has the end of the list been reached?
ListIterator< Data > & operator--()
Go to the previous element in a linked list.
Linked List Node, class template.
void setCurrent(Node< Data > *nodePtr)
Point the iterator at a Node.