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::LowMemEdgeListIter Class Reference

Non-const iterator for edges. More...

#include <LowMemGraph.hh>

Public Member Functions

 LowMemEdgeListIter ()
 Default constructor. Don't use this. More...
 
 LowMemEdgeListIter (LowMemGraphBase *graph, platform::Size cur_offset)
 This one is for iterating all the edges. More...
 
 LowMemEdgeListIter (LowMemGraphBase *graph, LowMemNode *owner, platform::Size cur_offset)
 
LowMemEdgeListIter const & operator++ ()
 increment operator. Point this iterator at the next element in the list. More...
 
LowMemEdgeListIter const & operator-- ()
 decrement operator. Point this iterator at the previous element in the list. More...
 
bool operator== (LowMemEdgeListIter 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!= (LowMemEdgeListIter 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...
 
LowMemEdgeoperator* () 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...
 
LowMemEdgeoperator-> () 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...
 

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

LowMemGraphBasegraph_
 
LowMemNodeowner_
 
platform::Size cur_offset_
 

Detailed Description

Non-const iterator for edges.

Constructor & Destructor Documentation

utility::graph::LowMemEdgeListIter::LowMemEdgeListIter ( )

Default constructor. Don't use this.

utility::graph::LowMemEdgeListIter::LowMemEdgeListIter ( LowMemGraphBase graph,
platform::Size  cur_offset 
)

This one is for iterating all the edges.

References fast_forward().

utility::graph::LowMemEdgeListIter::LowMemEdgeListIter ( LowMemGraphBase graph,
LowMemNode owner,
platform::Size  cur_offset 
)

Member Function Documentation

void utility::graph::LowMemEdgeListIter::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::LowMemEdgeListIter::fast_forward ( )
protected

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

References cur_offset_, and owner_.

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

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

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

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

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

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

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

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

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

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

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

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

bool utility::graph::LowMemEdgeListIter::operator== ( LowMemEdgeListIter 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::LowMemEdgeListIter::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::LowMemEdgeListIter::cur_offset_
private
LowMemGraphBase* utility::graph::LowMemEdgeListIter::graph_
private
LowMemNode* utility::graph::LowMemEdgeListIter::owner_
private

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