CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends

graph< N, E >::const_iterator Class Reference

#include <adjgraph.h>

List of all members.

Classes

struct  value_type

Public Types

typedef graph::adj_list adj_list
typedef graph::edge_list edge_list
typedef graph::index_type index_type
typedef value_typepointer
typedef value_typereference

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 graph< N, E >::const_iterator

Definition at line 19 of file adjgraph.h.


Member Typedef Documentation

template<class N, class E>
typedef graph::adj_list graph< N, E >::const_iterator::adj_list

Definition at line 24 of file adjgraph.h.

template<class N, class E>
typedef graph::edge_list graph< N, E >::const_iterator::edge_list

Definition at line 25 of file adjgraph.h.

template<class N, class E>
typedef graph::index_type graph< N, E >::const_iterator::index_type

Definition at line 23 of file adjgraph.h.

template<class N, class E>
typedef value_type* graph< N, E >::const_iterator::pointer

Definition at line 43 of file adjgraph.h.

template<class N, class E>
typedef value_type& graph< N, E >::const_iterator::reference

Definition at line 42 of file adjgraph.h.


Constructor & Destructor Documentation

template<class N, class E>
graph< N, E >::const_iterator::const_iterator ( const graph g) [inline, explicit, private]

Definition at line 81 of file adjgraph.h.

       : vt_(g, 0, 0)
       { }
template<class N, class E>
graph< N, E >::const_iterator::const_iterator ( const graph g,
index_type  ait,
index_type  eit 
) [inline, private]

Definition at line 85 of file adjgraph.h.

        : vt_(g, ait, eit)
        {       } 

Member Function Documentation

template<class N, class E>
bool graph< N, E >::const_iterator::operator!= ( const const_iterator i) const [inline]

Definition at line 49 of file adjgraph.h.

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

                                                    {
      return ( (vt_.a_ == i.vt_.a_) && (vt_.e_ == i.vt_.e_) ) ? false : true;
    }
template<class N, class E>
const value_type& graph< N, E >::const_iterator::operator* ( void  ) const [inline]

Definition at line 72 of file adjgraph.h.

References graph< N, E >::const_iterator::vt_.

                                         {
      return vt_;    
    }
template<class N, class E>
void graph< N, E >::const_iterator::operator++ ( void  ) [inline]

Definition at line 53 of file adjgraph.h.

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

                      {
      while(vt_.gr_.size() > vt_.a_){
       // std::cout << "                   it++: ait=" << vt_.a_ << "  eit=" << vt_.e_ << std::endl;      
        index_type i = vt_.gr_.adjl_[vt_.a_].size();
        if (i > vt_.e_+1) {
           ++vt_.e_;
           return;
         }
         vt_.e_=0;
         ++vt_.a_;
         while( vt_.gr_.size() > vt_.a_ ) {
           if ( vt_.gr_.adjl_[vt_.a_].size() ) {
             return;
           }
          ++vt_.a_;
      }
     } 
    }
template<class N, class E>
const value_type* graph< N, E >::const_iterator::operator-> ( ) const [inline]

Definition at line 76 of file adjgraph.h.

References graph< N, E >::const_iterator::vt_.

                                          {
      return &vt_;
    }  
template<class N, class E>
bool graph< N, E >::const_iterator::operator< ( const const_iterator i) const [inline, private]
template<class N, class E>
bool graph< N, E >::const_iterator::operator== ( const const_iterator i) const [inline]

Definition at line 45 of file adjgraph.h.

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

                                                    {  
     return ( (vt_.a_ == i.vt_.a_) && (vt_.e_ == i.vt_.e_) ) ? true : false;
    }
template<class N, class E>
bool graph< N, E >::const_iterator::operator> ( const const_iterator i) const [inline, private]

Friends And Related Function Documentation

template<class N, class E>
friend class graph< N, E > [friend]

Definition at line 21 of file adjgraph.h.


Member Data Documentation

template<class N, class E>
value_type graph< N, E >::const_iterator::vt_ [private]