Rosetta
2019.07
|
Custom DirectedEdge list (non-const) iterator class, which can return non-const DirectedEdge pointers. This iterator cannot be used to change the structure of its list without access to that list directly. Customized since STL's const-iterator cannot be prevented from giving non-const access to its data. The former workaround to this problem was to define two sets of edge lists on each vertex: a list< DirectedEdge * > and a list< DirectedEdge const * >. More...
#include <Digraph.hh>
Public Member Functions | |
DirectedEdgeListIterator () | |
default constructor, owner and element set to null More... | |
DirectedEdgeListIterator (DirectedEdgeList const *owner) | |
owner constructor More... | |
DirectedEdgeListIterator (DirectedEdgeList const *owner, DirectedEdgeListElement *element) | |
owner and element constructor: points at a position in a list More... | |
DirectedEdgeListIterator (DirectedEdgeListIterator const &src) | |
copy constructor More... | |
~DirectedEdgeListIterator () | |
non-virtual destructor, does nothing More... | |
DirectedEdgeListIterator & | operator= (DirectedEdgeListIterator const &rhs) |
assignmnet operator More... | |
DirectedEdgeListIterator const & | operator++ () |
increment operator. Point this iterator at the next element in the list. More... | |
DirectedEdgeListIterator const & | operator-- () |
decrement operator. Point this iterator at the previous element in the list. More... | |
bool | operator== (DirectedEdgeListIterator 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!= (DirectedEdgeListIterator 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. More... | |
DirectedEdge * | operator* () const |
dereference operator: return the edge pointer pointed to by the list element this iterator is hovering over. This method returns a non-const edge pointer, which defines this class as a non-const iterator. There are no methods, though, to access the list element itself. More... | |
DirectedEdge & | operator-> () const |
dereference operator: return the edge pointer pointed to by the list element this iterator is hovering over. This method returns a non-const edge pointer, which defines this class as a non-const iterator. There are no methods, though, 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... | |
Private Attributes | |
DirectedEdgeList const * | owner_ |
DirectedEdgeListElement * | element_ |
Friends | |
class | DirectedEdgeList |
class | DirectedEdgeListConstIterator |
Custom DirectedEdge list (non-const) iterator class, which can return non-const DirectedEdge pointers. This iterator cannot be used to change the structure of its list without access to that list directly. Customized since STL's const-iterator cannot be prevented from giving non-const access to its data. The former workaround to this problem was to define two sets of edge lists on each vertex: a list< DirectedEdge * > and a list< DirectedEdge const * >.
|
inline |
default constructor, owner and element set to null
|
inline |
owner constructor
|
inline |
owner and element constructor: points at a position in a list
|
inline |
copy constructor
|
inline |
non-virtual destructor, does nothing
|
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.
References operator==().
|
inline |
dereference operator: return the edge pointer pointed to by the list element this iterator is hovering over. This method returns a non-const edge pointer, which defines this class as a non-const iterator. There are no methods, though, to access the list element itself.
References debug_assert, utility::graph::DirectedEdgeListElement::edge(), element_, and valid().
|
inline |
increment operator. Point this iterator at the next element in the list.
References debug_assert, element_, utility::graph::DirectedEdgeListElement::next(), and valid().
|
inline |
decrement operator. Point this iterator at the previous element in the list.
References debug_assert, element_, utility::graph::DirectedEdgeListElement::previous(), and valid().
|
inline |
dereference operator: return the edge pointer pointed to by the list element this iterator is hovering over. This method returns a non-const edge pointer, which defines this class as a non-const iterator. There are no methods, though, to access the list element itself.
References debug_assert, utility::graph::DirectedEdgeListElement::edge(), element_, and valid().
|
inline |
|
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 debug_assert, element_, and owner_.
Referenced by operator!=().
|
inline |
check that this iterator is valid. Will not guarantee that the iterator points at an element that has not been destroyed.
References element_, utility::graph::DirectedEdgeList::is_end_element(), and owner_.
Referenced by operator*(), operator++(), operator--(), and operator->().
|
friend |
|
friend |
|
private |
|
private |