OpenTTD Source: FlowEdgeIterator Class Reference

OpenTTD Source 12.0-beta1

Public Member Functions | Private Attributes
FlowEdgeIterator Class Reference

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

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

## Private Attributes
LinkGraphJob & | job
| Link graph job we're working with.
std::vector< NodeID > | station_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 134 of file mcf.cpp.

## Constructor & Destructor Documentation

## ◆ FlowEdgeIterator()

FlowEdgeIterator::FlowEdgeIterator | ( | LinkGraphJob & | job | ) |
| inline

Constructor.

Parameters

  job | Link graph job to work with.

Definition at line 152 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 185 of file mcf.cpp.

## ◆ SetNode()

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

Setup the node to retrieve edges from.

Parameters

  source | Root of the current path tree.
  node | Current node to be checked for outgoing flows.

Definition at line 168 of file mcf.cpp.

References FlowStat::empty_sharesmap, and it.

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

- src/linkgraph/mcf.cpp