QHash< Key, T >::iterator Class Reference

QHash< Key, T >::iterator Class Reference

#include <qhash.h>

Class Description

template<class Key, class T>
class QHash< Key, T >::iterator

Definition at line 330 of file qhash.h.

Public Types

typedef std::bidirectional_iterator_tag iterator_category
 
typedef qptrdiff difference_type
 
typedef T value_type
 
typedef T * pointer
 
typedef T & reference
 

Public Member Functions

 operator Node * () const
 
 iterator ()
 
 iterator (void *node)
 
const Key & key () const
 
T & value () const
 
T & operator* () const
 
T * operator-> () const
 
bool operator== (const iterator &o) const
 
bool operator!= (const iterator &o) const
 
iteratoroperator++ ()
 
iterator operator++ (int)
 
iteratoroperator-- ()
 
iterator operator-- (int)
 
iterator operator+ (int j) const
 
iterator operator- (int j) const
 
iteratoroperator+= (int j)
 
iteratoroperator-= (int j)
 
bool operator== (const const_iterator &o) const
 
bool operator!= (const const_iterator &o) const
 

Friends

class const_iterator
 

Member Typedef Documentation

typedef std::bidirectional_iterator_tag iterator_category

Definition at line 336 of file qhash.h.

typedef qptrdiff difference_type

Definition at line 337 of file qhash.h.

typedef T value_type

Definition at line 338 of file qhash.h.

typedef T* pointer

Definition at line 339 of file qhash.h.

typedef T& reference

Definition at line 340 of file qhash.h.

Constructor & Destructor Documentation

iterator ( )
inline

Definition at line 344 of file qhash.h.

344 : i(0) { }
iterator ( void node)
inlineexplicit

Definition at line 345 of file qhash.h.

345 : i(reinterpret_cast<QHashData::Node *>(node)) { }

Member Function Documentation

operator Node * ( ) const
inline

Definition at line 343 of file qhash.h.

343 { return concrete(i); }
const Key& key ( ) const
inline

Definition at line 347 of file qhash.h.

347 { return concrete(i)->key; }
T& value ( ) const
inline

Definition at line 348 of file qhash.h.

348 { return concrete(i)->value; }
T& operator* ( ) const
inline

Definition at line 349 of file qhash.h.

349 { return concrete(i)->value; }
T* operator-> ( void  ) const
inline

Definition at line 350 of file qhash.h.

350 { return &concrete(i)->value; }
bool operator== ( const iterator o) const
inline

Definition at line 351 of file qhash.h.

351 { return i == o.i; }
bool operator!= ( const iterator o) const
inline

Definition at line 352 of file qhash.h.

352 { return i != o.i; }
iterator& operator++ ( )
inline

Definition at line 354 of file qhash.h.

354  {
355  i = QHashData::nextNode(i);
356  return *this;
357  }
static Node * nextNode(Node *node)
iterator operator++ ( int  )
inline

Definition at line 358 of file qhash.h.

358  {
359  iterator r = *this;
360  i = QHashData::nextNode(i);
361  return r;
362  }
GLdouble GLdouble GLdouble r
Definition: GLee.h:1189
static Node * nextNode(Node *node)
iterator& operator-- ( )
inline

Definition at line 363 of file qhash.h.

363  {
365  return *this;
366  }
static Node * previousNode(Node *node)
iterator operator-- ( int  )
inline

Definition at line 367 of file qhash.h.

367  {
368  iterator r = *this;
370  return r;
371  }
GLdouble GLdouble GLdouble r
Definition: GLee.h:1189
static Node * previousNode(Node *node)
iterator operator+ ( int  j) const
inline

Definition at line 372 of file qhash.h.

373  { iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
GLdouble GLdouble GLdouble r
Definition: GLee.h:1189
iterator operator- ( int  j) const
inline

Definition at line 374 of file qhash.h.

374 { return operator+(-j); }
iterator operator+(int j) const
Definition: qhash.h:372
iterator& operator+= ( int  j)
inline

Definition at line 375 of file qhash.h.

375 { return *this = *this + j; }
iterator& operator-= ( int  j)
inline

Definition at line 376 of file qhash.h.

376 { return *this = *this - j; }
bool operator== ( const const_iterator o) const
inline

Definition at line 384 of file qhash.h.

385  { return i == o.i; }
bool operator!= ( const const_iterator o) const
inline

Definition at line 386 of file qhash.h.

387  { return i != o.i; }

Friends And Related Function Documentation

friend class const_iterator
friend

Definition at line 332 of file qhash.h.


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