OpenTTD Source  20240919-master-gdf0233f4c2
linkgraph_sl.cpp File Reference

Go to the source code of this file.

Data Structures

class  SlLinkgraphEdge
 
class  SlLinkgraphNode
 
class  SlLinkgraphJobProxy
 Proxy to reuse LinkGraph to save/load a LinkGraphJob. More...
 
struct  LGRPChunkHandler
 All link graphs. More...
 
struct  LGRJChunkHandler
 All link graph jobs. More...
 
struct  LGRSChunkHandler
 Link graph schedule. More...
 

Typedefs

typedef LinkGraph::BaseNode Node
 
typedef LinkGraph::BaseEdge Edge
 

Functions

SaveLoadTable GetLinkGraphDesc ()
 Get a SaveLoad array for a link graph. More...
 
SaveLoadTable GetLinkGraphJobDesc ()
 Get a SaveLoad array for a link graph job. More...
 
SaveLoadTable GetLinkGraphScheduleDesc ()
 Get a SaveLoad array for the link graph schedule. More...
 
void AfterLoadLinkGraphs ()
 Spawn the threads for running link graph calculations. More...
 
const ChunkHandlerTable _linkgraph_chunk_handlers (linkgraph_chunk_handlers)
 

Variables

static uint16_t _num_nodes
 
static LinkGraph_linkgraph
 Contains the current linkgraph being saved/loaded.
 
static NodeID _linkgraph_from
 Contains the current "from" node being saved/loaded.
 
static const LGRPChunkHandler LGRP
 
static const LGRJChunkHandler LGRJ
 
static const LGRSChunkHandler LGRS
 
static const ChunkHandlerRef linkgraph_chunk_handlers []
 

Detailed Description

Code handling saving and loading of link graphs

Definition in file linkgraph_sl.cpp.

Function Documentation

◆ AfterLoadLinkGraphs()

◆ GetLinkGraphDesc()

SaveLoadTable GetLinkGraphDesc ( )

Get a SaveLoad array for a link graph.

Returns
SaveLoad array for link graph.

Definition at line 136 of file linkgraph_sl.cpp.

References SLE_VAR.

Referenced by SlLinkgraphJobProxy::GetDescription(), LGRPChunkHandler::Load(), and LGRPChunkHandler::Save().

◆ GetLinkGraphJobDesc()

SaveLoadTable GetLinkGraphJobDesc ( )

Get a SaveLoad array for a link graph job.

The settings struct is derived from the global settings saveload array. The exact entries are calculated when the function is called the first time. It's necessary to keep a copy of the settings for each link graph job so that you can change the settings while in-game and still not mess with current link graph runs. Of course the settings have to be saved and loaded, too, to avoid desyncs.

Returns
Array of SaveLoad structs.

Definition at line 180 of file linkgraph_sl.cpp.

References SLE_VAR.

Referenced by LGRJChunkHandler::Load(), and LGRJChunkHandler::Save().

◆ GetLinkGraphScheduleDesc()

SaveLoadTable GetLinkGraphScheduleDesc ( )

Get a SaveLoad array for the link graph schedule.

Returns
SaveLoad array for the link graph schedule.

Definition at line 219 of file linkgraph_sl.cpp.

References REF_LINK_GRAPH, REF_LINK_GRAPH_JOB, and SLE_REFLIST.

Referenced by LGRSChunkHandler::FixPointers(), LGRSChunkHandler::Load(), and LGRSChunkHandler::Save().

Variable Documentation

◆ linkgraph_chunk_handlers

const ChunkHandlerRef linkgraph_chunk_handlers[]
static
Initial value:
= {
LGRP,
LGRJ,
LGRS,
}

Definition at line 346 of file linkgraph_sl.cpp.