]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/trafficmanager.h
Initial revision
[r2c2.git] / source / libmarklin / trafficmanager.h
diff --git a/source/libmarklin/trafficmanager.h b/source/libmarklin/trafficmanager.h
new file mode 100644 (file)
index 0000000..11ecc95
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef LIBMARKLIN_TRAFFICMANAGER_H_
+#define LIBMARKLIN_TRAFFICMANAGER_H_
+
+#include "section.h"
+#include "train.h"
+
+namespace Marklin {
+
+class Control;
+class Layout;
+class Turnout;
+
+class TrafficManager
+{
+public:
+       TrafficManager(Control &, Layout &);
+       Control &get_control() const { return control; }
+       Section *get_section_by_track(const Track *) const;
+       void add_train(Train *);
+private:
+       Control &control;
+       Layout &layout;
+       SectionSeq sections;
+       TrainSeq trains;
+
+       void turnout_route_changed(unsigned, Turnout *);
+};
+
+} // namespace Marklin
+
+#endif