Public Member Functions | Private Attributes | List of all members
SDict< T >::Iterator Class Reference

#include <sortdict.h>

Public Member Functions

 Iterator (const SDict< T > &dict)
 
virtual ~Iterator ()
 
T * toFirst () const
 
T * toLast () const
 
T * current () const
 
T * operator++ ()
 
T * operator-- ()
 

Private Attributes

QListIterator< T > * m_li
 

Detailed Description

template<class T>
class SDict< T >::Iterator

Simple iterator for SDict. It iterates in the order in which the elements are stored.

Definition at line 294 of file sortdict.h.

Constructor & Destructor Documentation

template<class T>
SDict< T >::Iterator::Iterator ( const SDict< T > &  dict)
inline

Create an iterator given the dictionary.

Definition at line 298 of file sortdict.h.

299  {
300  m_li = new QListIterator<T>(*dict.m_list);
301  }
SList< T > * m_list
Definition: sortdict.h:100
QListIterator< T > * m_li
Definition: sortdict.h:350
template<class T>
virtual SDict< T >::Iterator::~Iterator ( )
inlinevirtual

Destroys the dictionary

Definition at line 304 of file sortdict.h.

305  {
306  delete m_li;
307  }
QListIterator< T > * m_li
Definition: sortdict.h:350

Member Function Documentation

template<class T>
T* SDict< T >::Iterator::current ( ) const
inline

Returns the current compound

Definition at line 326 of file sortdict.h.

327  {
328  return m_li->current();
329  }
type * current() const
Definition: qlist.h:146
QListIterator< T > * m_li
Definition: sortdict.h:350
template<class T>
T* SDict< T >::Iterator::operator++ ( )
inline

Moves the iterator to the next element.

Returns
the new "current" element, or zero if the iterator was already pointing at the last element.

Definition at line 335 of file sortdict.h.

336  {
337  return m_li->operator++();
338  }
QListIterator< T > * m_li
Definition: sortdict.h:350
template<class T>
T* SDict< T >::Iterator::operator-- ( )
inline

Moves the iterator to the previous element.

Returns
the new "current" element, or zero if the iterator was already pointing at the first element.

Definition at line 344 of file sortdict.h.

345  {
346  return m_li->operator--();
347  }
QListIterator< T > * m_li
Definition: sortdict.h:350
template<class T>
T* SDict< T >::Iterator::toFirst ( ) const
inline

Set the iterator to the first element in the list.

Returns
The first compound, or zero if the list was empty.

Definition at line 312 of file sortdict.h.

313  {
314  return m_li->toFirst();
315  }
QListIterator< T > * m_li
Definition: sortdict.h:350
type * toFirst()
Definition: qlist.h:135
template<class T>
T* SDict< T >::Iterator::toLast ( ) const
inline

Set the iterator to the last element in the list.

Returns
The first compound, or zero if the list was empty.

Definition at line 320 of file sortdict.h.

321  {
322  return m_li->toLast();
323  }
QListIterator< T > * m_li
Definition: sortdict.h:350
type * toLast()
Definition: qlist.h:136

Member Data Documentation

template<class T>
QListIterator<T>* SDict< T >::Iterator::m_li
private

Definition at line 350 of file sortdict.h.


The documentation for this class was generated from the following file: