1 #ifndef LIBR2C2_ROUTE_H_
2 #define LIBR2C2_ROUTE_H_
7 #include <sigc++/trackable.h>
8 #include <msp/datafile/objectloader.h>
9 #include "trackchain.h"
20 class Route: public TrackChain
23 typedef std::map<unsigned, int> TurnoutMap;
25 class Loader: public Msp::DataFile::ObjectLoader<Route>
33 virtual void finish();
34 void turnout(unsigned, unsigned);
37 sigc::signal<void, const std::string &> signal_name_changed;
48 void set_name(const std::string &);
49 const std::string &get_name() const { return name; }
50 void set_temporary(bool);
51 bool is_temporary() const { return temporary; }
52 void update_turnouts();
54 void update_turnout(Track &);
56 int get_turnout(unsigned) const;
57 unsigned get_path(Track &) const;
58 const std::map<unsigned, int> &get_turnouts() const { return turnouts; }
60 void add_turnout(Track &, unsigned);
61 virtual void on_track_added(Track &);
64 void save(std::list<Msp::DataFile::Statement> &) const;
66 static Route *find(const TrackIter &, Track &);
67 static Route *find(const TrackIter &, const Route &);
68 static Route *find(const TrackIter &, const Zone &);
69 static Route *find(const TrackIter &, const std::set<Track *> &);