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 travel_to(unsigned);
33 void travel_past(unsigned);
35 void wait_train(unsigned, unsigned);
36 void wait_until(unsigned, unsigned);
57 std::vector<Msp::Variant> params;
62 Row(RowType, const T &);
65 const T &get_param(unsigned) const;
67 std::string str() const;
69 Msp::DataFile::Statement save() const;
71 static Row parse(const std::string &);
76 std::vector<Row> rows;
81 Msp::Time::TimeStamp wait_timeout;
87 void set_enabled(bool);
88 bool is_enabled() const { return enabled; }
92 void append(const Row &);
93 void insert(unsigned, const Row &);
94 unsigned get_n_rows() const { return rows.size(); }
95 const Row &get_row(unsigned) const;
97 void tick(const Msp::Time::TimeStamp &, const Msp::Time::TimeDelta &);
98 void save(std::list<Msp::DataFile::Statement> &) const;
100 Track &get_sensor(unsigned);
101 Track &get_turnout(unsigned);
102 Zone &get_zone(const std::string &);
103 void block_state_changed(Block &, Block::State);
104 void block_reserved(Block &, Train *);
105 void train_advanced(Block &);
106 void event(TrainAI &, const Message &);