![]() |
Rosetta
2021.16
|
Const iterator for edges. More...
#include <LowMemGraph.hh>
Public Member Functions | |
| LowMemEdgeListConstIter () | |
| Default constructor. Don't use this. More... | |
| LowMemEdgeListConstIter (LowMemGraphBase const *graph, platform::Size cur_offset) | |
| This one is for iterating all the edges. More... | |
| LowMemEdgeListConstIter (LowMemGraphBase const *graph, LowMemNode const *owner, platform::Size cur_offset) | |
| LowMemEdgeListConstIter const & | operator++ () |
| increment operator. Point this iterator at the next element in the list. More... | |
| LowMemEdgeListConstIter const & | operator-- () |
| decrement operator. Point this iterator at the previous element in the list. More... | |
| bool | operator== (LowMemEdgeListConstIter const &rhs) const |
| equality operator. Do these elements point at the same list element? Asserts that they belong to the same list. Never compare elements from separate lists. More... | |
| bool | operator!= (LowMemEdgeListConstIter const &rhs) const |
| inequality operator. Do these elements point to different elements from the same list? Asserts that they belong to the same list. Never compare elements from separate lists. Elements need not be valid to be compared. More... | |
| LowMemEdge const * | operator* () const |
| dereference operator: return the edge pointer pointed to by the list element this iterator is hovering over. This method returns a const edge pointer, which defines this class as a const iterator. There are no methods, of course, to access the list element itself. More... | |
| LowMemEdge const & | operator-> () const |
| dereference operator: return the edge pointer pointed to by the list element this iterator is hovering over. This method returns a const edge pointer, which defines this class as a const iterator. There are no methods, of course, to access the list element itself. More... | |
| bool | valid () const |
| check that this iterator is valid. Will not guarantee that the iterator points at an element that has not been destroyed. More... | |
Protected Member Functions | |
| void | fast_forward () |
| The graph edge list can have deleted edges. This ensures we pass over them. More... | |
| void | fast_backward () |
| This will allow cur_offset_ to go to 0. Which will throw an exception later which is what we want if someone goes past begin. More... | |
Private Attributes | |
| LowMemGraphBase const * | graph_ |
| LowMemNode const * | owner_ |
| platform::Size | cur_offset_ |
Const iterator for edges.
| utility::graph::LowMemEdgeListConstIter::LowMemEdgeListConstIter | ( | ) |
Default constructor. Don't use this.
| utility::graph::LowMemEdgeListConstIter::LowMemEdgeListConstIter | ( | LowMemGraphBase const * | graph, |
| platform::Size | cur_offset | ||
| ) |
This one is for iterating all the edges.
References fast_forward().
| utility::graph::LowMemEdgeListConstIter::LowMemEdgeListConstIter | ( | LowMemGraphBase const * | graph, |
| LowMemNode const * | owner, | ||
| platform::Size | cur_offset | ||
| ) |
|
protected |
This will allow cur_offset_ to go to 0. Which will throw an exception later which is what we want if someone goes past begin.
References cur_offset_, and owner_.
Referenced by operator--().
|
protected |
The graph edge list can have deleted edges. This ensures we pass over them.
References cur_offset_, and owner_.
Referenced by LowMemEdgeListConstIter(), and operator++().
|
inline |
inequality operator. Do these elements point to different elements from the same list? Asserts that they belong to the same list. Never compare elements from separate lists. Elements need not be valid to be compared.
References operator==().
| LowMemEdge const * utility::graph::LowMemEdgeListConstIter::operator* | ( | ) | const |
dereference operator: return the edge pointer pointed to by the list element this iterator is hovering over. This method returns a const edge pointer, which defines this class as a const iterator. There are no methods, of course, to access the list element itself.
References cur_offset_, debug_assert, graph_, utility::graph::LowMemNode::internal_get_edge(), utility::graph::LowMemGraphBase::internal_get_edge(), owner_, and valid().
| LowMemEdgeListConstIter const & utility::graph::LowMemEdgeListConstIter::operator++ | ( | ) |
increment operator. Point this iterator at the next element in the list.
References cur_offset_, debug_assert, fast_forward(), and valid().
| LowMemEdgeListConstIter const & utility::graph::LowMemEdgeListConstIter::operator-- | ( | ) |
decrement operator. Point this iterator at the previous element in the list.
References cur_offset_, debug_assert, fast_backward(), and valid().
| LowMemEdge const & utility::graph::LowMemEdgeListConstIter::operator-> | ( | ) | const |
dereference operator: return the edge pointer pointed to by the list element this iterator is hovering over. This method returns a const edge pointer, which defines this class as a const iterator. There are no methods, of course, to access the list element itself.
References cur_offset_, debug_assert, graph_, utility::graph::LowMemNode::internal_get_edge(), utility::graph::LowMemGraphBase::internal_get_edge(), owner_, and valid().
|
inline |
equality operator. Do these elements point at the same list element? Asserts that they belong to the same list. Never compare elements from separate lists.
References cur_offset_, debug_assert, graph_, and owner_.
Referenced by operator!=().
| bool utility::graph::LowMemEdgeListConstIter::valid | ( | ) | const |
check that this iterator is valid. Will not guarantee that the iterator points at an element that has not been destroyed.
References cur_offset_, graph_, utility::graph::LowMemGraphBase::internal_edge_list_size(), utility::graph::LowMemNode::num_edges(), and owner_.
Referenced by operator*(), operator++(), operator--(), and operator->().
|
private |
Referenced by fast_backward(), fast_forward(), operator*(), operator++(), operator--(), operator->(), operator==(), and valid().
|
private |
Referenced by operator*(), operator->(), operator==(), and valid().
|
private |
Referenced by fast_backward(), fast_forward(), operator*(), operator->(), operator==(), and valid().
1.8.7