]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/timetable.h
Add a UI for editing train timetables
[r2c2.git] / source / libmarklin / timetable.h
index 3c76055e712e6d54d82d29bff77b3511da4e0248..6631f3822c734f2ff99c8a9b28b8e70fd01bc4b5 100644 (file)
@@ -51,10 +51,15 @@ public:
 
                Row(RowType, int);
                Row(RowType, const std::string &);
+
+               std::string str() const;
+
+               static Row parse(const std::string &);
        };
 
 private:
        Train &train;
+       bool enabled;
        std::vector<Row> rows;
        unsigned current_row;
        bool executing;
@@ -64,6 +69,15 @@ private:
 public:
        Timetable(Train &);
 
+       void set_enabled(bool);
+       bool is_enabled() const { return enabled; }
+
+       void clear();
+       void append(const Row &);
+       void insert(unsigned, const Row &);
+       unsigned get_n_rows() const { return rows.size(); }
+       const Row &get_row(unsigned) const;
+
        void tick(const Msp::Time::TimeStamp &);
        void save(std::list<Msp::DataFile::Statement> &) const;
 private: