Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
QMapConstIterator< K, T > Class Template Reference

#include <qmap.h>

Public Types

typedef QMapNode< K, T > * NodePtr
 

Public Member Functions

 QMapConstIterator ()
 
 QMapConstIterator (QMapNode< K, T > *p)
 
 QMapConstIterator (const QMapConstIterator< K, T > &it)
 
 QMapConstIterator (const QMapIterator< K, T > &it)
 
bool operator== (const QMapConstIterator< K, T > &it) const
 
bool operator!= (const QMapConstIterator< K, T > &it) const
 
const T & operator* () const
 
const K & key () const
 
const T & data () const
 
QMapConstIterator< K, T > & operator++ ()
 
QMapConstIterator< K, T > operator++ (int)
 
QMapConstIterator< K, T > & operator-- ()
 
QMapConstIterator< K, T > operator-- (int)
 

Public Attributes

QMapNode< K, T > * node
 

Private Member Functions

int inc ()
 
int dec ()
 

Detailed Description

template<class K, class T>
class QMapConstIterator< K, T >

Definition at line 185 of file qmap.h.

Member Typedef Documentation

template<class K, class T>
typedef QMapNode< K, T >* QMapConstIterator< K, T >::NodePtr

Typedefs

Definition at line 191 of file qmap.h.

Constructor & Destructor Documentation

template<class K, class T>
QMapConstIterator< K, T >::QMapConstIterator ( )
inline

Functions

Definition at line 201 of file qmap.h.

201 : node( 0 ) {}
QMapNode< K, T > * node
Definition: qmap.h:196
template<class K, class T>
QMapConstIterator< K, T >::QMapConstIterator ( QMapNode< K, T > *  p)
inline

Definition at line 202 of file qmap.h.

202 : node( p ) {}
QMapNode< K, T > * node
Definition: qmap.h:196
template<class K, class T>
QMapConstIterator< K, T >::QMapConstIterator ( const QMapConstIterator< K, T > &  it)
inline

Definition at line 203 of file qmap.h.

203 : node( it.node ) {}
QMapNode< K, T > * node
Definition: qmap.h:196
template<class K, class T>
QMapConstIterator< K, T >::QMapConstIterator ( const QMapIterator< K, T > &  it)
inline

Definition at line 204 of file qmap.h.

204 : node( it.node ) {}
QMapNode< K, T > * node
Definition: qmap.h:97
QMapNode< K, T > * node
Definition: qmap.h:196

Member Function Documentation

template<class K, class T>
const T& QMapConstIterator< K, T >::data ( ) const
inline

Definition at line 214 of file qmap.h.

214 { return node->data; }
QMapNode< K, T > * node
Definition: qmap.h:196
template<class K, class T>
int QMapConstIterator< K, T >::dec ( )
inlineprivate

Definition at line 236 of file qmap.h.

236  {
237  QMapNodeBase* tmp = node;
238  if (tmp->color == QMapNodeBase::Red &&
239  tmp->parent->parent == tmp ) {
240  tmp = tmp->right;
241  } else if (tmp->left != 0) {
242  QMapNodeBase* y = tmp->left;
243  while ( y->right )
244  y = y->right;
245  tmp = y;
246  } else {
247  QMapNodeBase* y = tmp->parent;
248  while (tmp == y->left) {
249  tmp = y;
250  y = y->parent;
251  }
252  tmp = y;
253  }
254  node = (NodePtr)tmp;
255  return 0;
256  }
QMapNodeBase * left
Definition: qmap.h:51
QMapNodeBase * parent
Definition: qmap.h:53
QMapNode< K, T > * NodePtr
Definition: qmap.h:191
string tmp
Definition: languages.py:63
QMapNode< K, T > * node
Definition: qmap.h:196
QMapNodeBase * right
Definition: qmap.h:52
Color color
Definition: qmap.h:55
template<class K, class T>
int QMapConstIterator< K, T >::inc ( )
inlineprivate

Definition at line 217 of file qmap.h.

217  {
218  QMapNodeBase* tmp = node;
219  if ( tmp->right ) {
220  tmp = tmp->right;
221  while ( tmp->left )
222  tmp = tmp->left;
223  } else {
224  QMapNodeBase* y = tmp->parent;
225  while (tmp == y->right) {
226  tmp = y;
227  y = y->parent;
228  }
229  if (tmp->right != y)
230  tmp = y;
231  }
232  node = (NodePtr)tmp;
233  return 0;
234  }
QMapNodeBase * left
Definition: qmap.h:51
QMapNodeBase * parent
Definition: qmap.h:53
QMapNode< K, T > * NodePtr
Definition: qmap.h:191
string tmp
Definition: languages.py:63
QMapNode< K, T > * node
Definition: qmap.h:196
QMapNodeBase * right
Definition: qmap.h:52
template<class K, class T>
const K& QMapConstIterator< K, T >::key ( ) const
inline

Definition at line 213 of file qmap.h.

213 { return node->key; }
QMapNode< K, T > * node
Definition: qmap.h:196
template<class K, class T>
bool QMapConstIterator< K, T >::operator!= ( const QMapConstIterator< K, T > &  it) const
inline

Definition at line 207 of file qmap.h.

207 { return node != it.node; }
QMapNode< K, T > * node
Definition: qmap.h:196
template<class K, class T>
const T& QMapConstIterator< K, T >::operator* ( ) const
inline

Definition at line 208 of file qmap.h.

208 { return node->data; }
QMapNode< K, T > * node
Definition: qmap.h:196
template<class K, class T>
QMapConstIterator<K,T>& QMapConstIterator< K, T >::operator++ ( )
inline

Definition at line 259 of file qmap.h.

259  {
260  inc();
261  return *this;
262  }
template<class K, class T>
QMapConstIterator<K,T> QMapConstIterator< K, T >::operator++ ( int  )
inline

Definition at line 264 of file qmap.h.

264  {
265  QMapConstIterator<K,T> tmp = *this;
266  inc();
267  return tmp;
268  }
string tmp
Definition: languages.py:63
template<class K, class T>
QMapConstIterator<K,T>& QMapConstIterator< K, T >::operator-- ( )
inline

Definition at line 270 of file qmap.h.

270  {
271  dec();
272  return *this;
273  }
template<class K, class T>
QMapConstIterator<K,T> QMapConstIterator< K, T >::operator-- ( int  )
inline

Definition at line 275 of file qmap.h.

275  {
276  QMapConstIterator<K,T> tmp = *this;
277  dec();
278  return tmp;
279  }
string tmp
Definition: languages.py:63
template<class K, class T>
bool QMapConstIterator< K, T >::operator== ( const QMapConstIterator< K, T > &  it) const
inline

Definition at line 206 of file qmap.h.

206 { return node == it.node; }
QMapNode< K, T > * node
Definition: qmap.h:196

Member Data Documentation

template<class K, class T>
QMapNode<K,T>* QMapConstIterator< K, T >::node

Variables

Definition at line 196 of file qmap.h.


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