OpenTTD Source: LinkGraph::ConstNode Class Reference

OpenTTD Source 12.0-beta1

Public Member Functions
LinkGraph::ConstNode Class Reference

Constant node class. More...

`#include <linkgraph.h>`

Inheritance diagram for LinkGraph::ConstNode:

## Public Member Functions
| ConstNode (const LinkGraph *lg, NodeID node)
| Constructor. More...
ConstEdge | operator[] (NodeID to) const
| Get a ConstEdge. More...
ConstEdgeIterator | Begin () const
| Get an iterator pointing to the start of the edges array. More...
ConstEdgeIterator | End () const
| Get an iterator pointing beyond the end of the edges array. More...
Public Member Functions inherited from LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >
| NodeWrapper (const BaseNode &node, const BaseEdge *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...

## Additional Inherited Members
Protected Attributes inherited from LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >
const BaseNode & | node
| Node being wrapped.
const BaseEdge * | edges
| Outgoing edges for wrapped node.
NodeID | index
| ID of wrapped node.

## Detailed Description

Constant node class.

Only retrieval operations are allowed on both the node itself and its edges.

Definition at line 338 of file linkgraph.h.

## Constructor & Destructor Documentation

## ◆ ConstNode()

LinkGraph::ConstNode::ConstNode | ( | const LinkGraph * | lg,
|  | NodeID | node
| ) |  |
| inline

Constructor.

Parameters

  lg | LinkGraph to get the node from.
  node | ID of the node.

Definition at line 345 of file linkgraph.h.

## Member Function Documentation

## ◆ Begin()

ConstEdgeIterator LinkGraph::ConstNode::Begin | ( |  | ) | const
| inline

Get an iterator pointing to the start of the edges array.

Returns
  Constant edge iterator.

Definition at line 361 of file linkgraph.h.

## ◆ End()

ConstEdgeIterator LinkGraph::ConstNode::End | ( |  | ) | const
| inline

Get an iterator pointing beyond the end of the edges array.

Returns
  Constant edge iterator.

Definition at line 367 of file linkgraph.h.

## ◆ operator[]()

ConstEdge LinkGraph::ConstNode::operator[] | ( | NodeID | to | ) | const
| inline

Get a ConstEdge.

This is not a reference as the wrapper objects are not actually persistent.

Parameters

  to | ID of end node of edge.

Returns
  Constant edge wrapper.

Definition at line 355 of file linkgraph.h.

References LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >::edges.

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

- src/linkgraph/linkgraph.h