Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | Friends | List of all members
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]

Public Member Functions

 EdgeListIterator ()
 default constructor, owner and element set to null More...
 
 EdgeListIterator (EdgeList const *owner)
 owner constructor More...
 
 EdgeListIterator (EdgeList const *owner, EdgeListElement *element)
 owner and element constructor: points at a position in a list More...
 
 EdgeListIterator (EdgeListIterator const &src)
 copy constructor More...
 
 ~EdgeListIterator ()
 non-virtual destructor, does nothing More...
 
EdgeListIterator const & operator= (EdgeListIterator const &rhs)
 assignmnet operator More...
 
EdgeListIterator const & operator++ ()
 increment operator. Point this iterator at the next element in the list. More...
 
EdgeListIterator const & operator-- ()
 decrement operator. Point this iterator at the previous element in the list. More...
 
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. More...
 
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. More...
 
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. More...
 
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. 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

EdgeList const * owner_
 
EdgeListElementelement_
 

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

Definition at line 142 of file Graph.hh.

Constructor & Destructor Documentation

core::graph::EdgeListIterator::EdgeListIterator ( )
inline

default constructor, owner and element set to null

Definition at line 147 of file Graph.hh.

core::graph::EdgeListIterator::EdgeListIterator ( EdgeList const *  owner)
inline

owner constructor

Definition at line 151 of file Graph.hh.

core::graph::EdgeListIterator::EdgeListIterator ( EdgeList const *  owner,
EdgeListElement element 
)
inline

owner and element constructor: points at a position in a list

Definition at line 155 of file Graph.hh.

core::graph::EdgeListIterator::EdgeListIterator ( EdgeListIterator const &  src)
inline

copy constructor

Definition at line 159 of file Graph.hh.

core::graph::EdgeListIterator::~EdgeListIterator ( )
inline

non-virtual destructor, does nothing

Definition at line 163 of file Graph.hh.

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.

Definition at line 194 of file Graph.hh.

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.

Definition at line 201 of file Graph.hh.

References core::graph::EdgeListElement::edge(), element_, and valid().

EdgeListIterator const& core::graph::EdgeListIterator::operator++ ( )
inline

increment operator. Point this iterator at the next element in the list.

Definition at line 175 of file Graph.hh.

References element_, 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.

Definition at line 180 of file Graph.hh.

References element_, 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.

Definition at line 206 of file Graph.hh.

References core::graph::EdgeListElement::edge(), element_, and valid().

EdgeListIterator const& core::graph::EdgeListIterator::operator= ( EdgeListIterator const &  rhs)
inline

assignmnet operator

Definition at line 166 of file Graph.hh.

References element_, and owner_.

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.

Definition at line 186 of file Graph.hh.

References element_, and owner_.

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.

Definition at line 876 of file Graph.hh.

References element_, core::graph::EdgeList::is_end_element(), and owner_.

Referenced by operator*(), operator++(), operator--(), and operator->().

Friends And Related Function Documentation

friend class EdgeList
friend

Definition at line 212 of file Graph.hh.

friend class EdgeListConstIterator
friend

Definition at line 213 of file Graph.hh.

Member Data Documentation

EdgeListElement* core::graph::EdgeListIterator::element_
private
EdgeList const* core::graph::EdgeListIterator::owner_
private

The documentation for this class was generated from the following file: