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 name(const std::string &);
35 void turnout(unsigned, unsigned);
46 void set_temporary(bool);
47 bool is_temporary() const { return temporary; }
48 void update_turnouts();
50 void update_turnout(Track &);
52 int get_turnout(unsigned) const;
53 unsigned get_path(Track &) const;
54 const std::map<unsigned, int> &get_turnouts() const { return turnouts; }
56 void add_turnout(Track &, unsigned);
57 virtual void on_track_added(Track &);
60 void save(std::list<Msp::DataFile::Statement> &) const;
62 static Route *find(const TrackIter &, Track &);
63 static Route *find(const TrackIter &, const Route &);
64 static Route *find(const TrackIter &, const Zone &);
65 static Route *find(const TrackIter &, const std::set<Track *> &);