OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

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.
uint | Supply () const
| Get supply of wrapped node.
uint | Demand () const
| Get demand of wrapped node.
StationID | Station () const
| Get ID of station belonging to wrapped node.
Date | LastUpdate () const
| Get node's last update.
TileIndex | XY () const
| Get the location of the station associated with the node.

## 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 126 of file linkgraph.h.

## Constructor & Destructor Documentation

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 140 of file linkgraph.h.

## Member Function Documentation

template<typename Tnode, typename Tedge>

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

Get demand of wrapped node.

Returns
  Demand.

Definition at line 153 of file linkgraph.h.

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

template<typename Tnode, typename Tedge>

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

Get node's last update.

Returns
  Last update.

Definition at line 165 of file linkgraph.h.

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 159 of file linkgraph.h.

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

template<typename Tnode, typename Tedge>

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

Get supply of wrapped node.

Returns
  Supply.

Definition at line 147 of file linkgraph.h.

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

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 171 of file linkgraph.h.

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

- src/linkgraph/linkgraph.h