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

#include <sortdict.h>

Public Member Functions

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

Private Attributes

QDictIterator< T > * m_di
 

Detailed Description

template<class T>
class SDict< T >::IteratorDict

Simple iterator for SDict. It iterates over the dictionary elements in an unsorted way, but does provide information about the element's key.

Definition at line 358 of file sortdict.h.

Constructor & Destructor Documentation

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

Create an iterator given the dictionary.

Definition at line 362 of file sortdict.h.

363  {
364  m_di = new QDictIterator<T>(*dict.m_dict);
365  }
QDictIterator< T > * m_di
Definition: sortdict.h:420
QDict< T > * m_dict
Definition: sortdict.h:101
template<class T>
virtual SDict< T >::IteratorDict::~IteratorDict ( )
inlinevirtual

Destroys the dictionary

Definition at line 368 of file sortdict.h.

369  {
370  delete m_di;
371  }
QDictIterator< T > * m_di
Definition: sortdict.h:420

Member Function Documentation

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

Returns the current compound

Definition at line 390 of file sortdict.h.

391  {
392  return m_di->current();
393  }
QDictIterator< T > * m_di
Definition: sortdict.h:420
template<class T>
QCString SDict< T >::IteratorDict::currentKey ( ) const
inline

Returns the current key

Definition at line 396 of file sortdict.h.

397  {
398  return m_di->currentKey();
399  }
QDictIterator< T > * m_di
Definition: sortdict.h:420
template<class T>
T* SDict< T >::IteratorDict::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 405 of file sortdict.h.

406  {
407  return m_di->operator++();
408  }
QDictIterator< T > * m_di
Definition: sortdict.h:420
template<class T>
T* SDict< T >::IteratorDict::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 414 of file sortdict.h.

415  {
416  return m_di->operator--();
417  }
QDictIterator< T > * m_di
Definition: sortdict.h:420
template<class T>
T* SDict< T >::IteratorDict::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 376 of file sortdict.h.

377  {
378  return m_di->toFirst();
379  }
QDictIterator< T > * m_di
Definition: sortdict.h:420
template<class T>
T* SDict< T >::IteratorDict::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 384 of file sortdict.h.

385  {
386  return m_di->toLast();
387  }
QDictIterator< T > * m_di
Definition: sortdict.h:420

Member Data Documentation

template<class T>
QDictIterator<T>* SDict< T >::IteratorDict::m_di
private

Definition at line 420 of file sortdict.h.


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