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();
Bidirectional iterator for a List.
ListIterator< Data > & operator++()
Go to the next element in a linked list.
Data const & operator*() const
Get a const reference to the associated Data object.
Data const * operator->() const
Get a pointer to const to the associated Data object.
ListIterator()
Default constructor.
bool isBack() const
Is this the back of the List?
void setCurrent(Node< Data > *nodePtr)
Point the iterator at a Node.
ListIterator(List< Data > const &list)
Constructor for initialized iterator.
bool isFront() const
Is this the front of the 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 class template.
void begin(ListIterator< Data > &iterator) const
Set an iterator to the front of this List.
Linked List Node, class template.
Utility classes for scientific computation.