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

#include <sortdict.h>

Public Member Functions

 Iterator (const SIntDict< 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 SIntDict< T >::Iterator

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

Definition at line 603 of file sortdict.h.

Constructor & Destructor Documentation

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

Create an iterator given the dictionary.

Definition at line 607 of file sortdict.h.

608  {
609  m_li = new QListIterator<T>(*dict.m_list);
610  }
SIntList< T > * m_list
Definition: sortdict.h:448
QListIterator< T > * m_li
Definition: sortdict.h:659
template<class T>
virtual SIntDict< T >::Iterator::~Iterator ( )
inlinevirtual

Destroys the dictionary

Definition at line 613 of file sortdict.h.

614  {
615  delete m_li;
616  }
QListIterator< T > * m_li
Definition: sortdict.h:659

Member Function Documentation

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

Returns the current compound

Definition at line 635 of file sortdict.h.

636  {
637  return m_li->current();
638  }
QListIterator< T > * m_li
Definition: sortdict.h:659
type * current() const
Definition: qlist.h:146
template<class T>
T* SIntDict< 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 644 of file sortdict.h.

645  {
646  return m_li->operator++();
647  }
QListIterator< T > * m_li
Definition: sortdict.h:659
template<class T>
T* SIntDict< 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 653 of file sortdict.h.

654  {
655  return m_li->operator--();
656  }
QListIterator< T > * m_li
Definition: sortdict.h:659
template<class T>
T* SIntDict< 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 621 of file sortdict.h.

622  {
623  return m_li->toFirst();
624  }
QListIterator< T > * m_li
Definition: sortdict.h:659
type * toFirst()
Definition: qlist.h:135
template<class T>
T* SIntDict< 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 629 of file sortdict.h.

630  {
631  return m_li->toLast();
632  }
QListIterator< T > * m_li
Definition: sortdict.h:659
type * toLast()
Definition: qlist.h:136

Member Data Documentation

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

Definition at line 659 of file sortdict.h.


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