CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
math::Graph< N, E >::const_iterator Class Reference

#include <Graph.h>

Classes

struct  value_type
 

Public Types

using adj_list = Graph::adj_list
 
using edge_list = Graph::edge_list
 
using index_type = Graph::index_type
 
using pointer = value_type *
 
using reference = value_type &
 

Public Member Functions

bool operator!= (const const_iterator &i) const
 
const value_typeoperator* () const
 
void operator++ ()
 
const value_typeoperator-> () const
 
bool operator== (const const_iterator &i) const
 

Private Member Functions

 const_iterator (const Graph &g)
 
 const_iterator (const Graph &g, index_type ait, index_type eit)
 
bool operator< (const const_iterator &i) const
 
bool operator> (const const_iterator &i) const
 

Private Attributes

value_type vt_
 

Friends

class Graph< N, E >
 

Detailed Description

template<class N, class E>
class math::Graph< N, E >::const_iterator

Definition at line 24 of file Graph.h.

Member Typedef Documentation

template<class N, class E>
using math::Graph< N, E >::const_iterator::adj_list = Graph::adj_list

Definition at line 29 of file Graph.h.

template<class N, class E>
using math::Graph< N, E >::const_iterator::edge_list = Graph::edge_list

Definition at line 30 of file Graph.h.

template<class N, class E>
using math::Graph< N, E >::const_iterator::index_type = Graph::index_type

Definition at line 28 of file Graph.h.

template<class N, class E>
using math::Graph< N, E >::const_iterator::pointer = value_type*

Definition at line 49 of file Graph.h.

template<class N, class E>
using math::Graph< N, E >::const_iterator::reference = value_type&

Definition at line 48 of file Graph.h.

Constructor & Destructor Documentation

template<class N, class E>
math::Graph< N, E >::const_iterator::const_iterator ( const Graph g)
inlineexplicitprivate

Definition at line 90 of file Graph.h.

Referenced by math::Graph< Node2, AnotherDummy2 >::begin_iter(), and math::Graph< Node2, AnotherDummy2 >::end_iter().

91  : vt_( g, 0, 0 )
92  {}
template<class N, class E>
math::Graph< N, E >::const_iterator::const_iterator ( const Graph g,
index_type  ait,
index_type  eit 
)
inlineprivate

Definition at line 94 of file Graph.h.

95  : vt_( g, ait, eit )
96  {}

Member Function Documentation

template<class N, class E>
bool math::Graph< N, E >::const_iterator::operator!= ( const const_iterator i) const
inline

Definition at line 55 of file Graph.h.

References math::Graph< N, E >::const_iterator::value_type::a_, math::Graph< N, E >::const_iterator::value_type::e_, and math::Graph< N, E >::const_iterator::vt_.

55  {
56  return (( vt_.a_ == i.vt_.a_ ) && ( vt_.e_ == i.vt_.e_ )) ? false : true;
57  }
template<class N, class E>
const value_type& math::Graph< N, E >::const_iterator::operator* ( ) const
inline

Definition at line 81 of file Graph.h.

References math::Graph< N, E >::const_iterator::vt_.

81  {
82  return vt_;
83  }
template<class N, class E>
void math::Graph< N, E >::const_iterator::operator++ ( )
inline

Definition at line 59 of file Graph.h.

References math::Graph< N, E >::const_iterator::value_type::a_, math::Graph< N, E >::adjl_, math::Graph< N, E >::const_iterator::value_type::e_, math::Graph< N, E >::const_iterator::value_type::gr_, mps_fire::i, math::Graph< N, E >::size(), and math::Graph< N, E >::const_iterator::vt_.

59  {
60  while( vt_.gr_.size() > vt_.a_ )
61  {
62  index_type i = vt_.gr_.adjl_[vt_.a_].size();
63  if( i > vt_.e_+1 )
64  {
65  ++vt_.e_;
66  return;
67  }
68  vt_.e_=0;
69  ++vt_.a_;
70  while( vt_.gr_.size() > vt_.a_ )
71  {
72  if( vt_.gr_.adjl_[vt_.a_].size())
73  {
74  return;
75  }
76  ++vt_.a_;
77  }
78  }
79  }
Graph::index_type index_type
Definition: Graph.h:28
auto size() const -> adj_list::size_type
Definition: Graph.h:196
adj_list adjl_
Definition: Graph.h:210
template<class N, class E>
const value_type* math::Graph< N, E >::const_iterator::operator-> ( ) const
inline

Definition at line 85 of file Graph.h.

References math::Graph< N, E >::const_iterator::vt_.

85  {
86  return &vt_;
87  }
template<class N, class E>
bool math::Graph< N, E >::const_iterator::operator< ( const const_iterator i) const
inlineprivate
template<class N, class E>
bool math::Graph< N, E >::const_iterator::operator== ( const const_iterator i) const
inline

Definition at line 51 of file Graph.h.

References math::Graph< N, E >::const_iterator::value_type::a_, math::Graph< N, E >::const_iterator::value_type::e_, and math::Graph< N, E >::const_iterator::vt_.

51  {
52  return (( vt_.a_ == i.vt_.a_ ) && ( vt_.e_ == i.vt_.e_ )) ? true : false;
53  }
template<class N, class E>
bool math::Graph< N, E >::const_iterator::operator> ( const const_iterator i) const
inlineprivate

Friends And Related Function Documentation

template<class N, class E>
friend class Graph< N, E >
friend

Definition at line 26 of file Graph.h.

Member Data Documentation

template<class N, class E>
value_type math::Graph< N, E >::const_iterator::vt_
private