#include <graph.hpp>
Definition at line 149 of file graph.hpp.
Public Types | |
typedef const edge | value_type |
typedef const edge & | reference |
typedef const edge *const | pointer |
typedef ptrdiff_t | difference_type |
typedef std::bidirectional_iterator_tag | iterator_category |
Public Member Functions | |
graph_edge_iterator () | |
Constructor of the graph_edge_iterator class. | |
graph_edge_iterator & | operator++ () |
Preincrement. | |
graph_edge_iterator | operator++ (int) |
Postincrement. | |
graph_edge_iterator & | operator-- () |
Predecrement. | |
graph_edge_iterator | operator-- (int) |
postdecrement. | |
reference | operator* () const |
Reference. | |
pointer | operator-> () const |
Pointer. | |
bool | operator== (const graph_edge_iterator &it) const |
Equality. | |
bool | operator!= (const graph_edge_iterator &it) const |
Difference. | |
Private Member Functions | |
graph_edge_iterator (typename graph_content::const_iterator it_begin, typename graph_content::const_iterator it_end, typename graph_content::const_iterator it_s, typename neighbours_list::const_iterator it_d) | |
Constructor with an iterator on graph class data. | |
Private Attributes | |
graph_content::const_iterator | m_vertex_begin |
Iterator of the first node. | |
graph_content::const_iterator | m_vertex_end |
Iterator of the last node. | |
graph_content::const_iterator | m_vertex_iterator |
Iterator on the list of vertex. | |
neighbours_list::const_iterator | m_neighbours_iterator |
Iterator on the list of edges. | |
edge | m_edge |
Current edge. | |
Friends | |
class | graph< vertex_type, edge_type, vertex_compare > |
Classes | |
class | edge |
Value pointed by the iterator. More... |
typedef const edge claw::graph< S, A, Comp >::graph_edge_iterator::value_type |
typedef const edge& claw::graph< S, A, Comp >::graph_edge_iterator::reference |
typedef const edge* const claw::graph< S, A, Comp >::graph_edge_iterator::pointer |
typedef ptrdiff_t claw::graph< S, A, Comp >::graph_edge_iterator::difference_type |
typedef std::bidirectional_iterator_tag claw::graph< S, A, Comp >::graph_edge_iterator::iterator_category |
claw::graph< S, A, Comp >::graph_edge_iterator::graph_edge_iterator | ( | ) | [inline] |
claw::graph< S, A, Comp >::graph_edge_iterator::graph_edge_iterator | ( | typename graph_content::const_iterator | it_begin, | |
typename graph_content::const_iterator | it_end, | |||
typename graph_content::const_iterator | it_s, | |||
typename neighbours_list::const_iterator | it_d | |||
) | [inline, explicit, private] |
Constructor with an iterator on graph class data.
it_begin | Iterator on the first node. | |
it_end | Iterator on the last node. | |
it_s | Iterator on current edge's source. | |
it_d | Iterator where scan starts. |
Definition at line 490 of file graph.tpp.
References claw::graph< S, A, Comp >::graph_edge_iterator::m_edge, claw::graph< S, A, Comp >::graph_edge_iterator::m_neighbours_iterator, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_begin, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_end, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_iterator, and claw::graph< S, A, Comp >::graph_edge_iterator::edge::set().
00494 : m_vertex_begin(it_begin), m_vertex_end(it_end), 00495 m_vertex_iterator(it_s), m_neighbours_iterator(it_d) 00496 { 00497 if (m_vertex_begin != m_vertex_end) 00498 m_edge.set( m_neighbours_iterator->second, m_vertex_iterator->first, 00499 m_neighbours_iterator->first ); 00500 } // graph_edge_iterator() [constructor on an iterator]
claw::graph< S, A, Comp >::graph_edge_iterator & claw::graph< S, A, Comp >::graph_edge_iterator::operator++ | ( | ) | [inline] |
Preincrement.
Definition at line 307 of file graph.tpp.
References claw::graph< S, A, Comp >::graph_edge_iterator::m_edge, claw::graph< S, A, Comp >::graph_edge_iterator::m_neighbours_iterator, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_end, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_iterator, and claw::graph< S, A, Comp >::graph_edge_iterator::edge::set().
00308 { 00309 bool ok = true; 00310 ++m_neighbours_iterator; 00311 00312 // end of a neighbourhood 00313 if ( m_neighbours_iterator == m_vertex_iterator->second.end() ) 00314 { 00315 // find next edge or end. 00316 ok = false; 00317 ++m_vertex_iterator; 00318 00319 while ( (m_vertex_iterator != m_vertex_end) && !ok ) 00320 if ( !m_vertex_iterator->second.empty() ) 00321 { 00322 ok = true; 00323 m_neighbours_iterator = m_vertex_iterator->second.begin(); 00324 } 00325 else 00326 ++m_vertex_iterator; 00327 } 00328 00329 if (ok) 00330 m_edge.set( m_neighbours_iterator->second, m_vertex_iterator->first, 00331 m_neighbours_iterator->first ); 00332 00333 return *this; 00334 } // operator++() [preincrement]
claw::graph< S, A, Comp >::graph_edge_iterator claw::graph< S, A, Comp >::graph_edge_iterator::operator++ | ( | int | ) | [inline] |
Postincrement.
Definition at line 343 of file graph.tpp.
00344 { 00345 graph_edge_iterator it_tmp(*this); 00346 ++(*this); 00347 return it_tmp; 00348 } // operator++() [postincrement]
claw::graph< S, A, Comp >::graph_edge_iterator & claw::graph< S, A, Comp >::graph_edge_iterator::operator-- | ( | ) | [inline] |
Predecrement.
Definition at line 357 of file graph.tpp.
References claw::graph< S, A, Comp >::graph_edge_iterator::m_edge, claw::graph< S, A, Comp >::graph_edge_iterator::m_neighbours_iterator, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_begin, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_end, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_iterator, and claw::graph< S, A, Comp >::graph_edge_iterator::edge::set().
00358 { 00359 bool ok = true; 00360 00361 if (m_vertex_iterator == m_vertex_end) 00362 { 00363 --m_vertex_iterator; 00364 m_neighbours_iterator = m_vertex_iterator->second.end(); 00365 } 00366 00367 // begining of a neighbourhood 00368 if ( m_neighbours_iterator == m_vertex_iterator->second.begin() ) 00369 { 00370 ok = false; 00371 // find previous edge or begining. 00372 while ( (m_vertex_iterator != m_vertex_begin) && !ok ) 00373 { 00374 --m_vertex_iterator; 00375 if ( !m_vertex_iterator->second.empty() ) 00376 { 00377 ok = true; 00378 m_neighbours_iterator = --m_vertex_iterator->second.end(); 00379 } 00380 } 00381 } 00382 else 00383 --m_neighbours_iterator; 00384 00385 if (!ok) 00386 m_vertex_iterator == m_vertex_end; 00387 else 00388 m_edge.set( m_neighbours_iterator->second, m_vertex_iterator->first, 00389 m_neighbours_iterator->first ); 00390 00391 return *this; 00392 } // operator--() [predecrement]
claw::graph< S, A, Comp >::graph_edge_iterator claw::graph< S, A, Comp >::graph_edge_iterator::operator-- | ( | int | ) | [inline] |
postdecrement.
Definition at line 401 of file graph.tpp.
00402 { 00403 graph_edge_iterator it_tmp(*this); 00404 --(*this); 00405 return it_tmp; 00406 } // operator--() [postdecrement]
claw::graph< S, A, Comp >::graph_edge_iterator::reference claw::graph< S, A, Comp >::graph_edge_iterator::operator* | ( | ) | const [inline] |
Reference.
Definition at line 415 of file graph.tpp.
References claw::graph< S, A, Comp >::graph_edge_iterator::m_edge.
00416 { 00417 return m_edge; 00418 } // operator*()
claw::graph< S, A, Comp >::graph_edge_iterator::pointer claw::graph< S, A, Comp >::graph_edge_iterator::operator-> | ( | ) | const [inline] |
Pointer.
Definition at line 427 of file graph.tpp.
References claw::graph< S, A, Comp >::graph_edge_iterator::m_edge.
00428 { 00429 return &m_edge; 00430 } // operator->()
bool claw::graph< S, A, Comp >::graph_edge_iterator::operator== | ( | const graph_edge_iterator & | it | ) | const [inline] |
Equality.
it | Iterator to compare to. |
Definition at line 440 of file graph.tpp.
References claw::graph< S, A, Comp >::graph_edge_iterator::m_neighbours_iterator, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_begin, claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_end, and claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_iterator.
00441 { 00442 // both are empty 00443 if ( m_vertex_begin == m_vertex_end ) 00444 return (it.m_vertex_begin == it.m_vertex_end) 00445 && (m_vertex_begin == it.m_vertex_begin); 00446 else 00447 if ( it.m_vertex_begin == it.m_vertex_end ) // -it- is empty 00448 return false; 00449 else 00450 // none is empty, perheaps at the end ? 00451 if (m_vertex_iterator == m_vertex_end) 00452 return (it.m_vertex_iterator == it.m_vertex_end) 00453 && (m_vertex_begin == it.m_vertex_begin); 00454 else 00455 if (it.m_vertex_iterator == it.m_vertex_end) 00456 return false; 00457 else 00458 return m_neighbours_iterator == it.m_neighbours_iterator; 00459 } // operator==()
bool claw::graph< S, A, Comp >::graph_edge_iterator::operator!= | ( | const graph_edge_iterator & | it | ) | const [inline] |
friend class graph< vertex_type, edge_type, vertex_compare > [friend] |
graph_content::const_iterator claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_begin [private] |
Iterator of the first node.
Definition at line 209 of file graph.hpp.
Referenced by claw::graph< S, A, Comp >::graph_edge_iterator::graph_edge_iterator(), claw::graph< S, A, Comp >::graph_edge_iterator::operator--(), and claw::graph< S, A, Comp >::graph_edge_iterator::operator==().
graph_content::const_iterator claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_end [private] |
Iterator of the last node.
Definition at line 212 of file graph.hpp.
Referenced by claw::graph< S, A, Comp >::graph_edge_iterator::graph_edge_iterator(), claw::graph< S, A, Comp >::graph_edge_iterator::operator++(), claw::graph< S, A, Comp >::graph_edge_iterator::operator--(), and claw::graph< S, A, Comp >::graph_edge_iterator::operator==().
graph_content::const_iterator claw::graph< S, A, Comp >::graph_edge_iterator::m_vertex_iterator [private] |
Iterator on the list of vertex.
Definition at line 215 of file graph.hpp.
Referenced by claw::graph< S, A, Comp >::graph_edge_iterator::graph_edge_iterator(), claw::graph< S, A, Comp >::graph_edge_iterator::operator++(), claw::graph< S, A, Comp >::graph_edge_iterator::operator--(), and claw::graph< S, A, Comp >::graph_edge_iterator::operator==().
neighbours_list::const_iterator claw::graph< S, A, Comp >::graph_edge_iterator::m_neighbours_iterator [private] |
Iterator on the list of edges.
Definition at line 218 of file graph.hpp.
Referenced by claw::graph< S, A, Comp >::graph_edge_iterator::graph_edge_iterator(), claw::graph< S, A, Comp >::graph_edge_iterator::operator++(), claw::graph< S, A, Comp >::graph_edge_iterator::operator--(), and claw::graph< S, A, Comp >::graph_edge_iterator::operator==().
edge claw::graph< S, A, Comp >::graph_edge_iterator::m_edge [private] |
Current edge.
Definition at line 221 of file graph.hpp.
Referenced by claw::graph< S, A, Comp >::graph_edge_iterator::graph_edge_iterator(), claw::graph< S, A, Comp >::graph_edge_iterator::operator*(), claw::graph< S, A, Comp >::graph_edge_iterator::operator++(), claw::graph< S, A, Comp >::graph_edge_iterator::operator--(), and claw::graph< S, A, Comp >::graph_edge_iterator::operator->().