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

Const iterator for edges. More...

#include <LowMemGraph.hh>

Public Member Functions

 LowMemEdgeListConstIter ()
 Default constructor. Don't use this. More...
 
 LowMemEdgeListConstIter (LowMemGraphBase const *graph, platform::Size cur_offset)
 This one is for iterating all the edges. More...
 
 LowMemEdgeListConstIter (LowMemGraphBase const *graph, LowMemNode const *owner, platform::Size cur_offset)
 
LowMemEdgeListConstIter const & operator++ ()
 increment operator. Point this iterator at the next element in the list. More...
 
LowMemEdgeListConstIter const & operator-- ()
 decrement operator. Point this iterator at the previous element in the list. More...
 
bool operator== (LowMemEdgeListConstIter 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!= (LowMemEdgeListConstIter 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...
 
LowMemEdge 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...
 
LowMemEdge 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
 check that this iterator is valid. Will not guarantee that the iterator points at an element that has not been destroyed. More...
 

Protected Member Functions

void fast_forward ()
 The graph edge list can have deleted edges. This ensures we pass over them. More...
 
void fast_backward ()
 This will allow cur_offset_ to go to 0. Which will throw an exception later which is what we want if someone goes past begin. More...
 

Private Attributes

LowMemGraphBase const * graph_
 
LowMemNode const * owner_
 
platform::Size cur_offset_
 

Detailed Description

Const iterator for edges.

Constructor & Destructor Documentation

utility::graph::LowMemEdgeListConstIter::LowMemEdgeListConstIter ( )

Default constructor. Don't use this.

utility::graph::LowMemEdgeListConstIter::LowMemEdgeListConstIter ( LowMemGraphBase const *  graph,
platform::Size  cur_offset 
)

This one is for iterating all the edges.

References fast_forward().

utility::graph::LowMemEdgeListConstIter::LowMemEdgeListConstIter ( LowMemGraphBase const *  graph,
LowMemNode const *  owner,
platform::Size  cur_offset 
)

Member Function Documentation

void utility::graph::LowMemEdgeListConstIter::fast_backward ( )
protected

This will allow cur_offset_ to go to 0. Which will throw an exception later which is what we want if someone goes past begin.

References cur_offset_, and owner_.

Referenced by operator--().

void utility::graph::LowMemEdgeListConstIter::fast_forward ( )
protected

The graph edge list can have deleted edges. This ensures we pass over them.

References cur_offset_, and owner_.

Referenced by LowMemEdgeListConstIter(), and operator++().

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

LowMemEdge const * utility::graph::LowMemEdgeListConstIter::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.

References cur_offset_, debug_assert, graph_, utility::graph::LowMemNode::internal_get_edge(), utility::graph::LowMemGraphBase::internal_get_edge(), owner_, and valid().

LowMemEdgeListConstIter const & utility::graph::LowMemEdgeListConstIter::operator++ ( )

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

References cur_offset_, debug_assert, fast_forward(), and valid().

LowMemEdgeListConstIter const & utility::graph::LowMemEdgeListConstIter::operator-- ( )

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

References cur_offset_, debug_assert, fast_backward(), and valid().

LowMemEdge const & utility::graph::LowMemEdgeListConstIter::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.

References cur_offset_, debug_assert, graph_, utility::graph::LowMemNode::internal_get_edge(), utility::graph::LowMemGraphBase::internal_get_edge(), owner_, and valid().

bool utility::graph::LowMemEdgeListConstIter::operator== ( LowMemEdgeListConstIter 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 cur_offset_, debug_assert, graph_, and owner_.

Referenced by operator!=().

bool utility::graph::LowMemEdgeListConstIter::valid ( ) const

check that this iterator is valid. Will not guarantee that the iterator points at an element that has not been destroyed.

References cur_offset_, graph_, utility::graph::LowMemGraphBase::internal_edge_list_size(), utility::graph::LowMemNode::num_edges(), and owner_.

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

Member Data Documentation

platform::Size utility::graph::LowMemEdgeListConstIter::cur_offset_
private
LowMemGraphBase const* utility::graph::LowMemEdgeListConstIter::graph_
private
LowMemNode const* utility::graph::LowMemEdgeListConstIter::owner_
private

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