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 &);
36 class Loader: public Msp::DataFile::ObjectLoader<Row>
42 Loader(Row &, Layout &);
46 void time(Msp::Time::RawTime);
47 void zone(const std::string &, unsigned);
52 Msp::Time::TimeDelta time;
56 void save(std::list<Msp::DataFile::Statement> &) const;
59 sigc::signal<void, unsigned, const Row &> signal_row_added;
60 sigc::signal<void, unsigned, const Row &> signal_row_modified;
61 sigc::signal<void, unsigned> signal_row_removed;
65 std::list<Row>::iterator current_row;
71 void append_row(const Row &);
72 void insert_row(unsigned, const Row &);
73 void modify_row(unsigned, const Row &);
74 void remove_row(unsigned);
76 unsigned get_length() const { return rows.size(); }
77 const Row &get_row(unsigned) const;
79 virtual void tick(const Msp::Time::TimeDelta &);
81 void save(std::list<Msp::DataFile::Statement> &) const;
84 void check_update(std::list<Row>::const_iterator);
86 void event(TrainAI &, const Message &);