1 #ifndef LIBR2C2_TIMETABLE_H_
2 #define LIBR2C2_TIMETABLE_H_
4 #include <msp/datafile/objectloader.h>
12 class Timetable: public TrainAI
15 class Loader: public Msp::DataFile::ObjectLoader<Timetable>
21 Loader(Timetable &, Layout &);
35 class Loader: public Msp::DataFile::ObjectLoader<Row>
41 Loader(Row &, Layout &);
45 void time(Msp::Time::RawTime);
46 void zone(const std::string &, unsigned);
51 Msp::Time::TimeDelta time;
55 void save(std::list<Msp::DataFile::Statement> &) const;
58 sigc::signal<void, unsigned, const Row &> signal_row_added;
59 sigc::signal<void, unsigned, const Row &> signal_row_modified;
60 sigc::signal<void, unsigned> signal_row_removed;
64 std::list<Row>::iterator current_row;
70 void append_row(const Row &);
71 void insert_row(unsigned, const Row &);
72 void modify_row(unsigned, const Row &);
73 void remove_row(unsigned);
75 unsigned get_length() const { return rows.size(); }
76 const Row &get_row(unsigned) const;
78 virtual void tick(const Msp::Time::TimeDelta &);
80 void save(std::list<Msp::DataFile::Statement> &) const;
83 void check_update(std::list<Row>::const_iterator);
85 void event(TrainAI &, const Message &);