Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

List< T >::Pos Class Reference

The local class implements a list iterator. More...

#include <List.h>

Collaboration diagram for List< T >::Pos:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Pos ()
 Empty constructor.

 Pos (Data *p)
 Constructor.

Posoperator++ ()
 The pre-increment operator moves the iterator to the successor in the list.

Posoperator-- ()
 The pre-decrement operator moves the iterator to the predecessor in the list.

Pos operator++ (int)
 The post-increment operator moves the iterator to the successor in the list.

Pos operator-- (int)
 The post-decrement operator moves the iterator to the predecessor in the list.

 operator bool () const
 The operator returns whether the iterator points to a list entry.

bool operator== (const Pos &pos) const
 The operator determines whether two iterators point to the same list element.

bool operator!= (const Pos &pos) const
 The operator determines whether two iterators point to different list elements.


Private Attributes

Dataentry
 A pointer to the current list entry.


Friends

class List< T >

Detailed Description

template<class T>
class List< T >::Pos

The local class implements a list iterator.

Definition at line 43 of file List.h.


Constructor & Destructor Documentation

template<class T>
List< T >::Pos::Pos  )  [inline]
 

Empty constructor.

The iterator points nowhere.

Definition at line 53 of file List.h.

References List< T >::Pos::entry.

template<class T>
List< T >::Pos::Pos Data p  )  [inline]
 

Constructor.

The iterator points to the given list node.

Parameters:
p The list node.

Definition at line 60 of file List.h.

References List< T >::Pos::entry.


Member Function Documentation

template<class T>
Pos& List< T >::Pos::operator++  )  [inline]
 

The pre-increment operator moves the iterator to the successor in the list.

If the iterator is moved behind the end of the list, it will point nowhere. Note that the iterator must point to a list element before this operation.

Returns:
A reference to the new state of the iterator.

Definition at line 69 of file List.h.

References List< T >::Pos::entry, and List< T >::Data::next.

template<class T>
Pos& List< T >::Pos::operator--  )  [inline]
 

The pre-decrement operator moves the iterator to the predecessor in the list.

If the iterator is moved before the beginning of the list, it will point nowhere. Note that the iterator must point to a list element before this operation.

Returns:
A reference to the new state of the iterator.

Definition at line 78 of file List.h.

References List< T >::Pos::entry, and List< T >::Data::prev.

template<class T>
Pos List< T >::Pos::operator++ int   )  [inline]
 

The post-increment operator moves the iterator to the successor in the list.

If the iterator is moved behind the end of the list, it will point nowhere. Note that the iterator must point to a list element before this operation.

Returns:
The state of the iterator before the operation.

Definition at line 87 of file List.h.

References List< T >::Pos::entry, and List< T >::Data::next.

template<class T>
Pos List< T >::Pos::operator-- int   )  [inline]
 

The post-decrement operator moves the iterator to the predecessor in the list.

If the iterator is moved before the beginning of the list, it will point nowhere. Note that the iterator must point to a list element before this operation.

Returns:
The state of the iterator before the operation.

Definition at line 96 of file List.h.

References List< T >::Pos::entry, and List< T >::Data::prev.

template<class T>
List< T >::Pos::operator bool  )  const [inline]
 

The operator returns whether the iterator points to a list entry.

If it does not point to a list entry, it points "nowhere".

Returns:
Does it point to a list entry?

Definition at line 103 of file List.h.

References List< T >::Pos::entry.

template<class T>
bool List< T >::Pos::operator== const Pos pos  )  const [inline]
 

The operator determines whether two iterators point to the same list element.

Parameters:
pos The other iterator.
Returns:
Are they equal?

Definition at line 110 of file List.h.

References List< T >::Pos::entry.

template<class T>
bool List< T >::Pos::operator!= const Pos pos  )  const [inline]
 

The operator determines whether two iterators point to different list elements.

Parameters:
pos The other iterator.
Returns:
Are they unequal?

Definition at line 117 of file List.h.

References List< T >::Pos::entry.


Friends And Related Function Documentation

template<class T>
friend class List< T > [friend]
 

Definition at line 119 of file List.h.


Member Data Documentation

template<class T>
Data* List< T >::Pos::entry [private]
 

A pointer to the current list entry.

Definition at line 46 of file List.h.

Referenced by List< T >::insert(), List< T >::Pos::operator bool(), List< T >::Pos::operator!=(), List< T >::Pos::operator++(), List< T >::Pos::operator--(), List< T >::Pos::operator==(), List< T >::operator[](), List< T >::Pos::Pos(), and List< T >::remove().


The documentation for this class was generated from the following file:
Generated on Thu Sep 23 20:09:23 2004 for GT2004 by doxygen 1.3.6