OpenTTD Source 20260110-master-g14e0917ae4
FlowEdgeIterator Class Reference

Iterator class for getting edges from a FlowStatMap. More...

Public Member Functions

 FlowEdgeIterator (LinkGraphJob &job)
 Constructor.
 
void SetNode (NodeID source, NodeID node)
 Setup the node to retrieve edges from.
 
NodeID Next ()
 Get the next node for which a flow exists.
 

Private Attributes

LinkGraphJobjob
 Link graph job we're working with.
 
TypedIndexContainer< std::vector< NodeID >, StationIDstation_to_node
 Lookup table for getting NodeIDs from StationIDs.
 
FlowStat::SharesMap::const_iterator it
 Current iterator in the shares map.
 
FlowStat::SharesMap::const_iterator end
 End of the shares map.
 

Detailed Description

Iterator class for getting edges from a FlowStatMap.

Definition at line 139 of file mcf.cpp.

Constructor & Destructor Documentation

◆ FlowEdgeIterator()

FlowEdgeIterator::FlowEdgeIterator ( LinkGraphJob job)
inline

Constructor.

Parameters
jobLink graph job to work with.

Definition at line 157 of file mcf.cpp.

References job, and LinkGraphJob::Size().

Member Function Documentation

◆ Next()

NodeID FlowEdgeIterator::Next ( )
inline

Get the next node for which a flow exists.

Returns
ID of next node with flow.

Definition at line 190 of file mcf.cpp.

◆ SetNode()

void FlowEdgeIterator::SetNode ( NodeID  source,
NodeID  node 
)
inline

Setup the node to retrieve edges from.

Parameters
sourceRoot of the current path tree.
nodeCurrent node to be checked for outgoing flows.

Definition at line 173 of file mcf.cpp.

References FlowStat::empty_sharesmap, and it.

Field Documentation

◆ end

FlowStat::SharesMap::const_iterator FlowEdgeIterator::end
private

End of the shares map.

Definition at line 150 of file mcf.cpp.

◆ it

FlowStat::SharesMap::const_iterator FlowEdgeIterator::it
private

Current iterator in the shares map.

Definition at line 147 of file mcf.cpp.

Referenced by SetNode().

◆ job

LinkGraphJob& FlowEdgeIterator::job
private

Link graph job we're working with.

Definition at line 141 of file mcf.cpp.

Referenced by FlowEdgeIterator().

◆ station_to_node

TypedIndexContainer<std::vector<NodeID>, StationID> FlowEdgeIterator::station_to_node
private

Lookup table for getting NodeIDs from StationIDs.

Definition at line 144 of file mcf.cpp.


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