+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
#ifndef LIBMARKLIN_TRAFFICMANAGER_H_
#define LIBMARKLIN_TRAFFICMANAGER_H_
class TrafficManager
{
+private:
+ Control &control;
+ Layout &layout;
+ std::list<Block *> blocks;
+ std::list<Train *> trains;
+
public:
sigc::signal<void, const Block &, const Train *> signal_block_reserved;
~TrafficManager();
Control &get_control() const { return control; }
- Block *get_block_by_track(const Track *) const;
- const TrainSeq &get_trains() const { return trains; }
+ const std::list<Block *> &get_blocks() const { return blocks; }
+ Block &get_block_by_track(const Track &) const;
+ const std::list<Train *> &get_trains() const { return trains; }
void add_train(Train *);
+ void tick();
private:
- Control &control;
- Layout &layout;
- BlockSeq blocks;
- TrainSeq trains;
-
void turnout_route_changed(unsigned, Turnout *);
};