summaryrefslogtreecommitdiff
path: root/src/linkgraph
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-31 22:26:44 +0200
committerGitHub <noreply@github.com>2021-05-31 22:26:44 +0200
commit9fff00ba205260ee5e11b50f87a3edee9b7e76a3 (patch)
tree2c6ee1eb6f0df2539c9ed17a2ae05541518a7dc9 /src/linkgraph
parent956d761e3ef1968c6470a9e78597c5531ed7c332 (diff)
downloadopenttd-9fff00ba205260ee5e11b50f87a3edee9b7e76a3.tar.xz
Codechange: C++-ify lists for SaveLoad (#9323)
Basically, this changes "SaveLoad *" to either: 1) "SaveLoadTable" if a list of SaveLoads was meant 2) "SaveLoad &" if a single entry was meant As added bonus, this removes SL_END / SLE_END / SLEG_END. This also adds core/span.hpp, a "std::span"-lite.
Diffstat (limited to 'src/linkgraph')
-rw-r--r--src/linkgraph/linkgraph.h6
-rw-r--r--src/linkgraph/linkgraphjob.h2
-rw-r--r--src/linkgraph/linkgraphschedule.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/linkgraph/linkgraph.h b/src/linkgraph/linkgraph.h
index 32f94a3c8..5eb85e4c3 100644
--- a/src/linkgraph/linkgraph.h
+++ b/src/linkgraph/linkgraph.h
@@ -16,10 +16,10 @@
#include "../station_base.h"
#include "../cargotype.h"
#include "../date_func.h"
+#include "../saveload/saveload.h"
#include "linkgraph_type.h"
#include <utility>
-struct SaveLoad;
class LinkGraph;
/**
@@ -525,8 +525,8 @@ public:
protected:
friend class LinkGraph::ConstNode;
friend class LinkGraph::Node;
- friend const SaveLoad *GetLinkGraphDesc();
- friend const SaveLoad *GetLinkGraphJobDesc();
+ friend SaveLoadTable GetLinkGraphDesc();
+ friend SaveLoadTable GetLinkGraphJobDesc();
friend void SaveLoad_LinkGraph(LinkGraph &lg);
CargoID cargo; ///< Cargo of this component's link graph.
diff --git a/src/linkgraph/linkgraphjob.h b/src/linkgraph/linkgraphjob.h
index f434fa809..812afd1f7 100644
--- a/src/linkgraph/linkgraphjob.h
+++ b/src/linkgraph/linkgraphjob.h
@@ -52,7 +52,7 @@ private:
typedef std::vector<NodeAnnotation> NodeAnnotationVector;
typedef SmallMatrix<EdgeAnnotation> EdgeAnnotationMatrix;
- friend const SaveLoad *GetLinkGraphJobDesc();
+ friend SaveLoadTable GetLinkGraphJobDesc();
friend class LinkGraphSchedule;
protected:
diff --git a/src/linkgraph/linkgraphschedule.h b/src/linkgraph/linkgraphschedule.h
index 6a6dff697..fef49e98f 100644
--- a/src/linkgraph/linkgraphschedule.h
+++ b/src/linkgraph/linkgraphschedule.h
@@ -39,7 +39,7 @@ private:
~LinkGraphSchedule();
typedef std::list<LinkGraph *> GraphList;
typedef std::list<LinkGraphJob *> JobList;
- friend const SaveLoad *GetLinkGraphScheduleDesc();
+ friend SaveLoadTable GetLinkGraphScheduleDesc();
protected:
ComponentHandler *handlers[6]; ///< Handlers to be run for each job.