Qt 4.8
Public Functions | Properties | List of all members
Graph< Vertex, EdgeData >::const_iterator Class Reference

#include <qgraph_p.h>

Public Functions

 const_iterator (const Graph *graph, bool begin)
 
Vertex * from () const
 
bool operator!= (const const_iterator &o) const
 
Vertex * operator* ()
 
const_iteratoroperator++ ()
 
const_iteratoroperator= (const const_iterator &o) const
 
bool operator== (const const_iterator &o) const
 
Vertex * to () const
 

Properties

Q_TYPENAME QHash< Vertex *, EdgeData * >::const_iterator column
 
const Graphg
 
Q_TYPENAME QHash< Vertex *, QHash< Vertex *, EdgeData * > *>::const_iterator row
 

Detailed Description

template<typename Vertex, typename EdgeData>
class Graph< Vertex, EdgeData >::const_iterator

Definition at line 71 of file qgraph_p.h.

Constructors and Destructors

◆ const_iterator()

template<typename Vertex, typename EdgeData>
Graph< Vertex, EdgeData >::const_iterator::const_iterator ( const Graph graph,
bool  begin 
)
inline

Definition at line 73 of file qgraph_p.h.

Referenced by Graph< AnchorVertex, AnchorData >::connections(), Graph< AnchorVertex, AnchorData >::constBegin(), Graph< AnchorVertex, AnchorData >::constEnd(), and Graph< AnchorVertex, AnchorData >::vertices().

73  : g(graph){
74  if (begin) {
75  row = g->m_graph.constBegin();
76  //test if the graph is empty
77  if (row != g->m_graph.constEnd())
78  {
79  column = (*row)->constBegin();
80  }
81  } else {
82  row = g->m_graph.constEnd();
83  }
84  }
Q_TYPENAME QHash< Vertex *, QHash< Vertex *, EdgeData * > *>::const_iterator row
Definition: qgraph_p.h:124
QHash< Vertex *, QHash< Vertex *, EdgeData * > * > m_graph
Definition: qgraph_p.h:281
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
const Graph * g
Definition: qgraph_p.h:123
Q_TYPENAME QHash< Vertex *, EdgeData * >::const_iterator column
Definition: qgraph_p.h:125

Functions

◆ from()

template<typename Vertex, typename EdgeData>
Vertex* Graph< Vertex, EdgeData >::const_iterator::from ( ) const
inline

Definition at line 90 of file qgraph_p.h.

Referenced by Graph< AnchorVertex, AnchorData >::connections().

90  {
91  return row.key();
92  }
Q_TYPENAME QHash< Vertex *, QHash< Vertex *, EdgeData * > *>::const_iterator row
Definition: qgraph_p.h:124
const Key key(const T &value) const
Returns the first key mapped to value.
Definition: qhash.h:674

◆ operator!=()

template<typename Vertex, typename EdgeData>
bool Graph< Vertex, EdgeData >::const_iterator::operator!= ( const const_iterator o) const
inline

Definition at line 99 of file qgraph_p.h.

99  {
100  if (row == g->m_graph.end()) {
101  return row != o.row;
102  } else {
103  return row != o.row || column != o.column;
104  }
105  }
Q_TYPENAME QHash< Vertex *, QHash< Vertex *, EdgeData * > *>::const_iterator row
Definition: qgraph_p.h:124
QHash< Vertex *, QHash< Vertex *, EdgeData * > * > m_graph
Definition: qgraph_p.h:281
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
const Graph * g
Definition: qgraph_p.h:123
Q_TYPENAME QHash< Vertex *, EdgeData * >::const_iterator column
Definition: qgraph_p.h:125

◆ operator*()

template<typename Vertex, typename EdgeData>
Vertex* Graph< Vertex, EdgeData >::const_iterator::operator* ( )
inline

Definition at line 86 of file qgraph_p.h.

86  {
87  return column.key();
88  }
const Key key(const T &value) const
Returns the first key mapped to value.
Definition: qhash.h:674
Q_TYPENAME QHash< Vertex *, EdgeData * >::const_iterator column
Definition: qgraph_p.h:125

◆ operator++()

template<typename Vertex, typename EdgeData>
const_iterator& Graph< Vertex, EdgeData >::const_iterator::operator++ ( )
inline

Definition at line 109 of file qgraph_p.h.

109  {
110  if (row != g->m_graph.constEnd()) {
111  ++column;
112  if (column == (*row)->constEnd()) {
113  ++row;
114  if (row != g->m_graph.constEnd()) {
115  column = (*row)->constBegin();
116  }
117  }
118  }
119  return *this;
120  }
Q_TYPENAME QHash< Vertex *, QHash< Vertex *, EdgeData * > *>::const_iterator row
Definition: qgraph_p.h:124
QHash< Vertex *, QHash< Vertex *, EdgeData * > * > m_graph
Definition: qgraph_p.h:281
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
const Graph * g
Definition: qgraph_p.h:123
Q_TYPENAME QHash< Vertex *, EdgeData * >::const_iterator column
Definition: qgraph_p.h:125

◆ operator=()

template<typename Vertex, typename EdgeData>
const_iterator& Graph< Vertex, EdgeData >::const_iterator::operator= ( const const_iterator o) const
inline

Definition at line 106 of file qgraph_p.h.

106 { row = o.row; column = o.column; return *this;}
Q_TYPENAME QHash< Vertex *, QHash< Vertex *, EdgeData * > *>::const_iterator row
Definition: qgraph_p.h:124
Q_TYPENAME QHash< Vertex *, EdgeData * >::const_iterator column
Definition: qgraph_p.h:125

◆ operator==()

template<typename Vertex, typename EdgeData>
bool Graph< Vertex, EdgeData >::const_iterator::operator== ( const const_iterator o) const
inline

Definition at line 98 of file qgraph_p.h.

98 { return !(*this != o); }

◆ to()

template<typename Vertex, typename EdgeData>
Vertex* Graph< Vertex, EdgeData >::const_iterator::to ( ) const
inline

Definition at line 94 of file qgraph_p.h.

Referenced by Graph< AnchorVertex, AnchorData >::connections().

94  {
95  return column.key();
96  }
const Key key(const T &value) const
Returns the first key mapped to value.
Definition: qhash.h:674
Q_TYPENAME QHash< Vertex *, EdgeData * >::const_iterator column
Definition: qgraph_p.h:125

Properties

◆ column

template<typename Vertex, typename EdgeData>
Q_TYPENAME QHash<Vertex *, EdgeData *>::const_iterator Graph< Vertex, EdgeData >::const_iterator::column
private

◆ g

template<typename Vertex, typename EdgeData>
const Graph* Graph< Vertex, EdgeData >::const_iterator::g
private

◆ row

template<typename Vertex, typename EdgeData>
Q_TYPENAME QHash<Vertex *, QHash<Vertex *, EdgeData *> * >::const_iterator Graph< Vertex, EdgeData >::const_iterator::row
private

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