Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | Friends | List of all members
utility::graph::EdgeListConstIterator Class Reference

Custom Edge list const iterator class, which returns only 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

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

Private Attributes

EdgeList const * owner_
 
EdgeListElement const * element_
 

Friends

class EdgeList
 

Detailed Description

Custom Edge list const iterator class, which returns only 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

utility::graph::EdgeListConstIterator::EdgeListConstIterator ( )
inline

default constructor, owner and element set to null

utility::graph::EdgeListConstIterator::EdgeListConstIterator ( EdgeList const *  owner)
inline

owner constructor

utility::graph::EdgeListConstIterator::EdgeListConstIterator ( EdgeList const *  owner,
EdgeListElement const *  element 
)
inline

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

utility::graph::EdgeListConstIterator::EdgeListConstIterator ( EdgeListConstIterator const &  src)
default

copy constructor

utility::graph::EdgeListConstIterator::EdgeListConstIterator ( EdgeListIterator const &  src)
inline

const-cast constructor

utility::graph::EdgeListConstIterator::~EdgeListConstIterator ( )
default

non-virtual destructor, does nothing

Member Function Documentation

bool utility::graph::EdgeListConstIterator::operator!= ( EdgeListConstIterator 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. Elements need not be valid to be compared.

References operator==().

bool utility::graph::EdgeListConstIterator::operator!= ( EdgeListIterator const &  rhs) const
inline

const-cast 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==().

Edge const* utility::graph::EdgeListConstIterator::operator* ( ) const
inline

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 utility::graph::EdgeListElement::const_edge(), debug_assert, element_, and valid().

EdgeListConstIterator const& utility::graph::EdgeListConstIterator::operator++ ( )
inline

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

References utility::graph::EdgeListElement::const_next(), debug_assert, element_, and valid().

EdgeListConstIterator const& utility::graph::EdgeListConstIterator::operator-- ( )
inline

decrement operator. Point this iterator at the previous element in the list.

References utility::graph::EdgeListElement::const_previous(), debug_assert, element_, and valid().

Edge const& utility::graph::EdgeListConstIterator::operator-> ( ) const
inline

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 utility::graph::EdgeListElement::const_edge(), debug_assert, element_, and valid().

EdgeListConstIterator& utility::graph::EdgeListConstIterator::operator= ( EdgeListConstIterator const &  rhs)
default

assignmnet operator

bool utility::graph::EdgeListConstIterator::operator== ( EdgeListConstIterator 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.

References debug_assert, element_, and owner_.

Referenced by operator!=().

bool utility::graph::EdgeListConstIterator::operator== ( EdgeListIterator const &  rhs) const
inline

const-cast 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, utility::graph::EdgeListIterator::element_, element_, utility::graph::EdgeListIterator::owner_, and owner_.

bool utility::graph::EdgeListConstIterator::valid ( ) const
inline

Is this a valid iterator?

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

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

Friends And Related Function Documentation

friend class EdgeList
friend

Member Data Documentation

EdgeListElement const* utility::graph::EdgeListConstIterator::element_
private
EdgeList const* utility::graph::EdgeListConstIterator::owner_
private

Referenced by operator==(), and valid().


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