]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/blockallocator.h
Use signal_advanced for train speed measurement and vehicle placement
[r2c2.git] / source / libr2c2 / blockallocator.h
index c0c265ae0bdf6bb03f0d8e1aa7c45d58b43007d2..33e9d5511654e41928527a5cc872d2735c7b4a29 100644 (file)
@@ -27,6 +27,8 @@ public:
                void hint(unsigned);
        };
 
+       sigc::signal<void, Block &, Sensor *> signal_advanced;
+
 private:
        struct BlockMatch;
 
@@ -36,6 +38,7 @@ private:
        bool active;
        BlockList blocks;
        BlockList::iterator cur_blocks_end;
+       Sensor *next_sensor;
        Block *pending_block;
        const Block *stop_at_block;
        bool reserving;
@@ -47,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(); }
@@ -64,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 &);
@@ -75,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<Msp::DataFile::Statement> &) const;