X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fblockallocator.h;h=6ba3cfbb7559ca7e718b2471cd9fca952fec44ce;hb=4acf89b0ec739c0bef8b11d3a52a4c551efa881e;hp=6ad3891bc4e68fc91b84ba0cb695ffc5aecd239b;hpb=57e0944ee8ed442e2d0aa7c9964cac00450af5e7;p=r2c2.git diff --git a/source/libr2c2/blockallocator.h b/source/libr2c2/blockallocator.h index 6ad3891..6ba3cfb 100644 --- a/source/libr2c2/blockallocator.h +++ b/source/libr2c2/blockallocator.h @@ -27,6 +27,8 @@ public: void hint(unsigned); }; + sigc::signal signal_advanced; + private: struct BlockMatch; @@ -36,9 +38,11 @@ private: bool active; BlockList blocks; BlockList::iterator cur_blocks_end; + Sensor *next_sensor; Block *pending_block; const Block *stop_at_block; bool reserving; + bool advancing; public: BlockAllocator(Train &); @@ -46,7 +50,7 @@ public: void set_active(bool); bool is_active() const { return active; } - void start_from(const BlockIter &); + bool start_from(const BlockIter &); void rewind_to(const Block &); void clear(); bool empty() const { return blocks.empty(); } @@ -63,6 +67,9 @@ public: private: void reserve_more(); bool reserve_block(const BlockIter &); + void advance_front(const Block *, bool); + void advance_front(const Sensor *); + void advance_back(); void release_blocks_begin(const BlockList::iterator &); void release_blocks_end(const BlockList::iterator &); void release_block(const BlockList::iterator &); @@ -74,6 +81,7 @@ private: void turnout_path_changed(Track &); void block_reserved(Block &, const Train *); void sensor_state_changed(Sensor &, Sensor::State); + void update_next_sensor(Sensor *); public: void save(std::list &) const;