OpenTTD Source 20260917-master-gec444f7315
GraphEdgeIterator Class Reference

Iterator class for getting the edges in the order of their next_edge members. More...

Public Member Functions

 GraphEdgeIterator (LinkGraphJob &job)
 Construct a GraphEdgeIterator.
void SetNode (NodeID, NodeID node)
 Setup the node to start iterating at.
NodeID Next ()
 Retrieve the ID of the node the next edge points to.

Private Attributes

LinkGraphJob & job
 Job being executed.
std::vector< LinkGraphJob::EdgeAnnotation >::const_iterator i
 Iterator pointing to current edge.
std::vector< LinkGraphJob::EdgeAnnotation >::const_iterator end
 Iterator pointing beyond last edge.

Detailed Description

Iterator class for getting the edges in the order of their next_edge members.

Definition at line 101 of file mcf.cpp.

Constructor & Destructor Documentation

◆ GraphEdgeIterator()

GraphEdgeIterator::GraphEdgeIterator ( LinkGraphJob & job)
inline

Construct a GraphEdgeIterator.

Parameters
jobJob to iterate on.

Definition at line 114 of file mcf.cpp.

References end, i, and job.

Member Function Documentation

◆ Next()

NodeID GraphEdgeIterator::Next ( )
inline

Retrieve the ID of the node the next edge points to.

Returns
Next edge's target node ID or INVALID_NODE.

Definition at line 130 of file mcf.cpp.

◆ SetNode()

void GraphEdgeIterator::SetNode ( NodeID ,
NodeID node )
inline

Setup the node to start iterating at.

Parameters
nodeNode to start iterating at.

Definition at line 120 of file mcf.cpp.

Field Documentation

◆ end

std::vector<LinkGraphJob::EdgeAnnotation>::const_iterator GraphEdgeIterator::end
private

Iterator pointing beyond last edge.

Definition at line 106 of file mcf.cpp.

Referenced by GraphEdgeIterator().

◆ i

std::vector<LinkGraphJob::EdgeAnnotation>::const_iterator GraphEdgeIterator::i
private

Iterator pointing to current edge.

Definition at line 105 of file mcf.cpp.

Referenced by GraphEdgeIterator().

◆ job

LinkGraphJob& GraphEdgeIterator::job
private

Job being executed.

Definition at line 103 of file mcf.cpp.

Referenced by GraphEdgeIterator().


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