Layout::Layout(Catalogue &c, Driver *d):
catalogue(c),
driver(d),
- next_turnout_addr(0x800),
- emitting_block_reserved(false)
+ next_turnout_addr(0x800)
{
clock.set_rate(60);
}
{
if(track_chains.insert(b))
{
- sigc::connection conn = b.signal_reserved.connect(sigc::bind<0>(sigc::mem_fun(this, &Layout::block_reserved), sigc::ref(b)));
+ sigc::connection conn = b.signal_reserved.connect(sigc::bind<0>(signal_block_reserved, sigc::ref(b)));
try
{
signal_track_chain_added.emit(b);
}
}
-void Layout::block_reserved(Block &block, Train *train)
-{
- if(emitting_block_reserved)
- block_reserve_queue.push_back(BlockReservation(block, train));
- else
- {
- SetFlag setf(emitting_block_reserved);
- signal_block_reserved.emit(block, train);
- while(!block_reserve_queue.empty())
- {
- BlockReservation br = block_reserve_queue.front();
- block_reserve_queue.pop_front();
- signal_block_reserved.emit(br.block, br.train);
- }
- }
-}
-
template<typename B>
Layout::Storage<B>::~Storage()
}
-Layout::BlockReservation::BlockReservation(Block &b, Train *t):
- block(b),
- train(t)
-{ }
-
-
Layout::Loader::Loader(Layout &l):
DataFile::ObjectLoader<Layout>(l)
{