Rosetta 3.4
|
Custom Edge list (non-const) iterator class, which can return non-const Edge 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< Edge * > and a list< Edge const * >. More...
#include <Graph.hh>
Public Member Functions | |
EdgeListIterator () | |
default constructor, owner and element set to null | |
EdgeListIterator (EdgeList const *owner) | |
owner constructor | |
EdgeListIterator (EdgeList const *owner, EdgeListElement *element) | |
owner and element constructor: points at a position in a list | |
EdgeListIterator (EdgeListIterator const &src) | |
copy constructor | |
~EdgeListIterator () | |
non-virtual destructor, does nothing | |
EdgeListIterator const & | operator= (EdgeListIterator const &rhs) |
assignmnet operator | |
EdgeListIterator const & | operator++ () |
increment operator. Point this iterator at the next element in the list. | |
EdgeListIterator const & | operator-- () |
decrement operator. Point this iterator at the previous element in the list. | |
bool | operator== (EdgeListIterator 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. | |
bool | operator!= (EdgeListIterator 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. | |
Edge * | 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. | |
Edge & | 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. | |
bool | valid () const |
check that this iterator is valid. Will not guarantee that the iterator points at an element that has not been destroyed. | |
Friends | |
class | EdgeList |
class | EdgeListConstIterator |
Custom Edge list (non-const) iterator class, which can return non-const Edge 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< Edge * > and a list< Edge const * >.
core::graph::EdgeListIterator::EdgeListIterator | ( | ) | [inline] |
default constructor, owner and element set to null
core::graph::EdgeListIterator::EdgeListIterator | ( | EdgeList const * | owner | ) | [inline] |
owner constructor
core::graph::EdgeListIterator::EdgeListIterator | ( | EdgeList const * | owner, |
EdgeListElement * | element | ||
) | [inline] |
owner and element constructor: points at a position in a list
core::graph::EdgeListIterator::EdgeListIterator | ( | EdgeListIterator const & | src | ) | [inline] |
copy constructor
core::graph::EdgeListIterator::~EdgeListIterator | ( | ) | [inline] |
non-virtual destructor, does nothing
bool core::graph::EdgeListIterator::operator!= | ( | EdgeListIterator const & | rhs | ) | const [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==().
Edge* core::graph::EdgeListIterator::operator* | ( | ) | const [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 core::graph::EdgeListElement::edge(), and valid().
EdgeListIterator const& core::graph::EdgeListIterator::operator++ | ( | ) | [inline] |
increment operator. Point this iterator at the next element in the list.
References core::graph::EdgeListElement::next(), and valid().
EdgeListIterator const& core::graph::EdgeListIterator::operator-- | ( | ) | [inline] |
decrement operator. Point this iterator at the previous element in the list.
References core::graph::EdgeListElement::previous(), and valid().
Edge& core::graph::EdgeListIterator::operator-> | ( | ) | const [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 core::graph::EdgeListElement::edge(), and valid().
EdgeListIterator const& core::graph::EdgeListIterator::operator= | ( | EdgeListIterator const & | rhs | ) | [inline] |
assignmnet operator
bool core::graph::EdgeListIterator::operator== | ( | EdgeListIterator const & | rhs | ) | const [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.
Referenced by operator!=().
bool core::graph::EdgeListIterator::valid | ( | ) | const [inline] |
check that this iterator is valid. Will not guarantee that the iterator points at an element that has not been destroyed.
References core::graph::EdgeList::is_end_element().
Referenced by operator*(), operator++(), operator--(), and operator->().
friend class EdgeList [friend] |
friend class EdgeListConstIterator [friend] |