1 #ifndef LIBR2C2_TIMETABLE_H_
2 #define LIBR2C2_TIMETABLE_H_
6 #include <sigc++/trackable.h>
7 #include <msp/datafile/objectloader.h>
17 class Timetable: public TrainAI, public sigc::trackable
20 class Loader: public Msp::DataFile::ObjectLoader<Timetable>
26 void goto_sensor(unsigned);
27 void goto_sensor_str(const std::string &);
28 void goto_zone(const std::string &);
29 void route(const std::string &);
32 void tag(const std::string &);
33 void travel_to(unsigned);
34 void travel_past(unsigned);
36 void wait_train(unsigned, unsigned);
37 void wait_until(unsigned, unsigned);
58 std::vector<Msp::Variant> params;
63 Row(RowType, const T &);
66 const T &get_param(unsigned) const;
68 std::string str() const;
70 Msp::DataFile::Statement save() const;
72 static Row parse(const std::string &);
77 std::vector<Row> rows;
82 Msp::Time::TimeStamp wait_timeout;
88 void set_enabled(bool);
89 bool is_enabled() const { return enabled; }
93 void append(const Row &);
94 void insert(unsigned, const Row &);
95 unsigned get_n_rows() const { return rows.size(); }
96 const Row &get_row(unsigned) const;
98 void tick(const Msp::Time::TimeStamp &, const Msp::Time::TimeDelta &);
99 void save(std::list<Msp::DataFile::Statement> &) const;
101 Track &get_sensor(unsigned);
102 Track &get_turnout(unsigned);
103 Zone &get_zone(const std::string &);
104 void block_state_changed(Block &, Block::State);
105 void block_reserved(Block &, Train *);
106 void train_advanced(Block &);
107 void event(TrainAI &, const Message &);