1 #ifndef LIBR2C2_BLOCKALLOCATOR_H_
2 #define LIBR2C2_BLOCKALLOCATOR_H_
5 #include <msp/datafile/objectloader.h>
16 class Loader: public Msp::DataFile::ObjectLoader<BlockAllocator>
23 Loader(BlockAllocator &);
31 typedef std::list<BlockIter> BlockList;
35 BlockList::iterator cur_blocks_end;
37 const Block *stop_at_block;
41 BlockAllocator(Train &);
43 void start_from(const BlockIter &);
45 bool empty() const { return blocks.empty(); }
46 void stop_at(const Block *);
48 const BlockIter &first() const;
49 const BlockIter &last() const;
50 const BlockIter &last_current() const;
52 int get_entry_to_block(const Block &) const;
55 void release_until(const Block &);
56 bool release_from(const Block &);
57 void release_noncurrent();
59 void release_blocks(const BlockList::iterator &, const BlockList::iterator &);
64 void turnout_path_changed(Track &);
65 void block_reserved(Block &, const Train *);
66 void block_state_changed(Block &, Block::State);
69 void save(std::list<Msp::DataFile::Statement> &) const;