]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/blockallocator.h
Use std::find to locate block iterators in BlockAllocator
[r2c2.git] / source / libr2c2 / blockallocator.h
index 39a327b9fa95810030267952a174cbd2073ffb02..3c974f21975b06933317eb4c068ae408ae4fce80 100644 (file)
@@ -3,8 +3,8 @@
 
 #include <list>
 #include <msp/datafile/objectloader.h>
-#include "block.h"
 #include "blockiter.h"
+#include "sensor.h"
 
 namespace R2C2 {
 
@@ -28,6 +28,8 @@ public:
        };
 
 private:
+       struct BlockMatch;
+
        typedef std::list<BlockIter> BlockList;
 
        Train &train;
@@ -52,10 +54,7 @@ public:
 
        bool has_block(const Block &) const;
        bool is_block_current(const Block &) const;
-private:
-       BlockList::const_iterator find_block(const BlockList::const_iterator &, const BlockList::const_iterator &, const Block &) const;
 
-public:
        void reserve_more();
 private:
        bool reserve_block(const BlockIter &);
@@ -72,7 +71,7 @@ public:
 private:
        void turnout_path_changed(Track &);
        void block_reserved(Block &, const Train *);
-       void block_state_changed(Block &, Block::State);
+       void sensor_state_changed(Sensor &, Sensor::State);
 
 public:
        void save(std::list<Msp::DataFile::Statement> &) const;