X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Flayout.h;h=a1c37d312b682ed6fabb086018824a0876d54d2e;hb=08dea8dfcf923e9296bcd3910455540895d0439b;hp=887b2d189f453dcc2dab13e59316f0642ce54df5;hpb=81ee4fbd16b472892b67b35ea85956423a2247ed;p=r2c2.git diff --git a/source/libr2c2/layout.h b/source/libr2c2/layout.h index 887b2d1..a1c37d3 100644 --- a/source/libr2c2/layout.h +++ b/source/libr2c2/layout.h @@ -1,6 +1,7 @@ #ifndef LIBR2C2_LAYOUT_H_ #define LIBR2C2_LAYOUT_H_ +#include #include #include #include @@ -40,7 +41,8 @@ public: void terrain(const std::string &); void track(const std::string &); void train(const std::string &, unsigned, const std::string &); - void turnout(unsigned, unsigned); + void turnout(unsigned); + void turnout2(unsigned, unsigned); void zone(); }; @@ -67,6 +69,14 @@ private: void del(); }; + struct BlockReservation + { + Block █ + Train *train; + + BlockReservation(Block &, Train *); + }; + public: typedef std::vector ZoneArray; @@ -91,6 +101,8 @@ private: std::map trains; Msp::Time::TimeStamp last_tick; unsigned next_turnout_addr; + bool emitting_block_reserved; + std::deque block_reserve_queue; public: Layout(Catalogue &, Driver * = 0); @@ -145,6 +157,7 @@ public: void save_dynamic(const std::string &) const; private: void sensor_state_changed(Sensor &, Sensor::State); + void block_reserved(Block &, Train *); }; } // namespace R2C2