My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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.

References SDict< T >::Iterator::m_li, and SDict< T >::m_list.

{
m_li = new QListIterator<T>(*dict.m_list);
}
template<class T>
virtual SDict< T >::Iterator::~Iterator ( )
inlinevirtual

Destroys the dictionary

Definition at line 304 of file sortdict.h.

References SDict< T >::Iterator::m_li.

{
delete m_li;
}

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.

References SDict< T >::Iterator::m_li.

{
return m_li->current();
}
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.

References SDict< T >::Iterator::m_li.

{
return m_li->operator++();
}
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.

References SDict< T >::Iterator::m_li.

{
return m_li->operator--();
}
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.

References SDict< T >::Iterator::m_li.

{
return m_li->toFirst();
}
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.

References SDict< T >::Iterator::m_li.

{
return m_li->toLast();
}

Member Data Documentation

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

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