X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Ftrafficmanager.h;h=b09c500ff39fabf0ed18d7f0ac2e154ffdd4e5d5;hb=3df8cb5c78fbb0b919bcb79677c6c788b8028482;hp=83b03e2ec8c4684af75ab4adf5ca49d2d80321cd;hpb=06c100aacb559fbbe7380e15981c4772092c269b;p=r2c2.git diff --git a/source/libmarklin/trafficmanager.h b/source/libmarklin/trafficmanager.h index 83b03e2..b09c500 100644 --- a/source/libmarklin/trafficmanager.h +++ b/source/libmarklin/trafficmanager.h @@ -1,3 +1,10 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #ifndef LIBMARKLIN_TRAFFICMANAGER_H_ #define LIBMARKLIN_TRAFFICMANAGER_H_ @@ -12,6 +19,22 @@ class Turnout; class TrafficManager { +public: + class Loader: public Msp::DataFile::BasicLoader + { + public: + Loader(TrafficManager &); + private: + void train(unsigned, unsigned); + }; + +private: + Control &control; + Layout &layout; + std::list blocks; + std::list trains; + Msp::Time::TimeStamp last_tick; + public: sigc::signal signal_block_reserved; @@ -19,15 +42,13 @@ public: ~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 &get_blocks() const { return blocks; } + Block &get_block_by_track(const Track &) const; + const std::list &get_trains() const { return trains; } void add_train(Train *); + void tick(); + void save(const std::string &) const; private: - Control &control; - Layout &layout; - BlockSeq blocks; - TrainSeq trains; - void turnout_route_changed(unsigned, Turnout *); };