3 This file is part of the MSP Märklin suite
4 Copyright © 2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
8 #ifndef LIBMARKLIN_TIMETABLE_H_
9 #define LIBMARKLIN_TIMETABLE_H_
13 #include <sigc++/trackable.h>
14 #include <msp/datafile/objectloader.h>
15 #include <msp/time/timestamp.h>
22 class Timetable: public sigc::trackable
25 class Loader: public Msp::DataFile::ObjectLoader<Timetable>
30 void go_to(const std::string &);
31 void route(const std::string &);
33 void travel(const std::string &);
53 Row(RowType, const std::string &);
55 std::string str() const;
57 static Row parse(const std::string &);
63 std::vector<Row> rows;
67 Msp::Time::TimeStamp wait_timeout;
72 void set_enabled(bool);
73 bool is_enabled() const { return enabled; }
77 void append(const Row &);
78 void insert(unsigned, const Row &);
79 unsigned get_n_rows() const { return rows.size(); }
80 const Row &get_row(unsigned) const;
82 void tick(const Msp::Time::TimeStamp &);
83 void save(std::list<Msp::DataFile::Statement> &) const;
85 Block &parse_location(const std::string &);
86 void sensor_event(unsigned, bool);
90 } // namespace Marklin