]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/trafficmanager.h
Initial revision
[r2c2.git] / source / libmarklin / trafficmanager.h
1 #ifndef LIBMARKLIN_TRAFFICMANAGER_H_
2 #define LIBMARKLIN_TRAFFICMANAGER_H_
3
4 #include "section.h"
5 #include "train.h"
6
7 namespace Marklin {
8
9 class Control;
10 class Layout;
11 class Turnout;
12
13 class TrafficManager
14 {
15 public:
16         TrafficManager(Control &, Layout &);
17         Control &get_control() const { return control; }
18         Section *get_section_by_track(const Track *) const;
19         void add_train(Train *);
20 private:
21         Control &control;
22         Layout &layout;
23         SectionSeq sections;
24         TrainSeq trains;
25
26         void turnout_route_changed(unsigned, Turnout *);
27 };
28
29 } // namespace Marklin
30
31 #endif