OpenTTD

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

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
LinkGraph::Edge Class Reference

An updatable edge class. More...

`#include <linkgraph.h>`

Inheritance diagram for LinkGraph::Edge:

## Public Member Functions
| Edge (BaseEdge &edge)
| Constructor.
void | Update (uint capacity, uint usage, EdgeUpdateMode mode)
| Update an edge.
void | Restrict ()
void | Release ()
Public Member Functions inherited from LinkGraph::EdgeWrapper< BaseEdge >
| EdgeWrapper (BaseEdge &edge)
| Wrap a an edge.
uint | Capacity () const
| Get edge's capacity.
uint | Usage () const
| Get edge's usage.
Date | LastUnrestrictedUpdate () const
| Get the date of the last update to the edge's unrestricted capacity.
Date | LastRestrictedUpdate () const
| Get the date of the last update to the edge's restricted capacity.
Date | LastUpdate () const
| Get the date of the last update to any part of the edge's capacity.

## Additional Inherited Members
Protected Attributes inherited from LinkGraph::EdgeWrapper< BaseEdge >
BaseEdge & | edge
| Actual edge to be used.

## Detailed Description

An updatable edge class.

Definition at line 293 of file linkgraph.h.

## Constructor & Destructor Documentation

LinkGraph::Edge::Edge | ( | BaseEdge & | edge | ) |
| inline

Constructor.

Parameters

  edge | Edge to be wrapped.

Definition at line 299 of file linkgraph.h.

## Member Function Documentation

void LinkGraph::Edge::Update | ( | uint | capacity,
|  | uint | usage,
|  | EdgeUpdateMode | mode
| ) |  |

Update an edge.

If mode contains UM_REFRESH refresh the edge to have at least the given capacity and usage, otherwise add the capacity and usage. In any case set the respective update timestamp(s), according to the given mode.

Parameters

  from | Start node of the edge.
  to | End node of the edge.
  capacity | Capacity to be added/updated.
  usage | Usage to be added.
  mode | Update mode to be applied.

Definition at line 261 of file linkgraph.cpp.

References _date, EUM_INCREASE, EUM_REFRESH, EUM_RESTRICTED, EUM_UNRESTRICTED, and max().

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

- src/linkgraph/linkgraph.h
- src/linkgraph/linkgraph.cpp