OpenTTD Source: LinkGraph::NodeWrapper< Tnode, Tedge > Class Template Reference

OpenTTD Source 13.1

Public Member Functions | Protected Attributes
LinkGraph::NodeWrapper< Tnode, Tedge > Class Template Reference

Wrapper for a node (const or not) allowing retrieval, but no modification. More...

`#include <linkgraph.h>`

## Public Member Functions
| NodeWrapper (Tnode &node, Tedge *edges, NodeID index)
| Wrap a node. More...
uint | Supply () const
| Get supply of wrapped node. More...
uint | Demand () const
| Get demand of wrapped node. More...
StationID | Station () const
| Get ID of station belonging to wrapped node. More...
Date | LastUpdate () const
| Get node's last update. More...
TileIndex | XY () const
| Get the location of the station associated with the node. More...

## Protected Attributes
Tnode & | node
| Node being wrapped.
Tedge * | edges
| Outgoing edges for wrapped node.
NodeID | index
| ID of wrapped node.

## Detailed Description

### template<typename Tnode, typename Tedge>
class LinkGraph::NodeWrapper< Tnode, Tedge >

Wrapper for a node (const or not) allowing retrieval, but no modification.

Template Parameters

  Tedge | Actual node class, may be "const BaseNode" or just "BaseNode".
  Tedge | Actual edge class, may be "const BaseEdge" or just "BaseEdge".

Definition at line 132 of file linkgraph.h.

## Constructor & Destructor Documentation

## ◆ NodeWrapper()

template<typename Tnode , typename Tedge >

LinkGraph::NodeWrapper< Tnode, Tedge >::NodeWrapper | ( | Tnode & | node,
|  | Tedge * | edges,
|  | NodeID | index
| ) |  |
| inline

Wrap a node.

Parameters

  node | Node to be wrapped.
  edges | Outgoing edges for node to be wrapped.
  index | ID of node to be wrapped.

Definition at line 146 of file linkgraph.h.

## Member Function Documentation

## ◆ Demand()

template<typename Tnode , typename Tedge >

uint LinkGraph::NodeWrapper< Tnode, Tedge >::Demand | ( |  | ) | const
| inline

Get demand of wrapped node.

Returns
  Demand.

Definition at line 159 of file linkgraph.h.

Referenced by SymmetricScaler::HasDemandLeft(), and AsymmetricScaler::HasDemandLeft().

## ◆ LastUpdate()

template<typename Tnode , typename Tedge >

Date LinkGraph::NodeWrapper< Tnode, Tedge >::LastUpdate | ( |  | ) | const
| inline

Get node's last update.

Returns
  Last update.

Definition at line 171 of file linkgraph.h.

## ◆ Station()

template<typename Tnode , typename Tedge >

StationID LinkGraph::NodeWrapper< Tnode, Tedge >::Station | ( |  | ) | const
| inline

Get ID of station belonging to wrapped node.

Returns
  ID of node's station.

Definition at line 165 of file linkgraph.h.

Referenced by FlowMapper::Run(), and LinkGraphJob::~LinkGraphJob().

## ◆ Supply()

template<typename Tnode , typename Tedge >

uint LinkGraph::NodeWrapper< Tnode, Tedge >::Supply | ( |  | ) | const
| inline

Get supply of wrapped node.

Returns
  Supply.

Definition at line 153 of file linkgraph.h.

Referenced by SymmetricScaler::AddNode(), SymmetricScaler::EffectiveSupply(), AsymmetricScaler::EffectiveSupply(), and SymmetricScaler::HasDemandLeft().

## ◆ XY()

template<typename Tnode , typename Tedge >

TileIndex LinkGraph::NodeWrapper< Tnode, Tedge >::XY | ( |  | ) | const
| inline

Get the location of the station associated with the node.

Returns
  Location of the station.

Definition at line 177 of file linkgraph.h.

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

- src/linkgraph/linkgraph.h