Rosetta 3.4
Public Member Functions | Friends
core::graph::EdgeListIterator Class Reference

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>

Collaboration diagram for core::graph::EdgeListIterator:
Collaboration graph
[legend]

List of all members.

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.
Edgeoperator* () 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.
Edgeoperator-> () 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

Detailed Description

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 * >.


Constructor & Destructor Documentation

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


Member Function Documentation

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->().


Friends And Related Function Documentation

friend class EdgeList [friend]
friend class EdgeListConstIterator [friend]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines