]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/train.h
Use RAII for setting the anti-recursion flags
[r2c2.git] / source / libmarklin / train.h
index e4458be82d7bfb47bf7a853b57e1ef6f8cb73298..3e7a56b7e423da7e9d4157d88138fc7e4e4ede85 100644 (file)
@@ -12,15 +12,14 @@ Distributed under the GPL
 #include <sigc++/trackable.h>
 #include <msp/time/timestamp.h>
 #include "block.h"
+#include "controller.h"
 
 namespace Marklin {
 
-class Controller;
 class Route;
 class Timetable;
 class Vehicle;
 class VehicleType;
-struct TrainControl;
 
 class Train: public sigc::trackable
 {
@@ -79,6 +78,8 @@ private:
        std::list<BlockRef> cur_blocks;
        std::list<BlockRef> rsv_blocks;
        Block *pending_block;
+       bool reserving;
+       bool advancing;
        Controller *controller;
        Timetable *timetable;
        bool active;
@@ -145,7 +146,7 @@ public:
 
        void save(std::list<Msp::DataFile::Statement> &) const;
 private:
-       void control_changed(const TrainControl &);
+       void control_changed(const Controller::Control &);
        void loco_speed_event(unsigned, unsigned, bool);
        void loco_func_event(unsigned, unsigned, bool);
        void sensor_event(unsigned, bool);