X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Ftimetable.h;h=b4f9cc1b2fd2972ed097926e54c31a45824101f5;hb=8e3009751ee81e0e5312cae53ee844bdd9e49628;hp=6631f3822c734f2ff99c8a9b28b8e70fd01bc4b5;hpb=cf52013784607dc4d307bd1244c5346ee88336a4;p=r2c2.git diff --git a/source/libmarklin/timetable.h b/source/libmarklin/timetable.h index 6631f38..b4f9cc1 100644 --- a/source/libmarklin/timetable.h +++ b/source/libmarklin/timetable.h @@ -27,33 +27,45 @@ public: public: Loader(Timetable &); private: + void arrive(); void go_to(const std::string &); void route(const std::string &); - void speed(int); + void reverse(); + void speed(unsigned); void travel(const std::string &); void wait(unsigned); + void wait_train(unsigned, const std::string &); }; enum RowType { GOTO, TRAVEL, - WAIT, + WAIT_TIME, + WAIT_TRAIN, + ARRIVE, SPEED, + REVERSE, ROUTE }; struct Row { RowType type; - int intparam; - std::string strparam; + std::vector params; - Row(RowType, int); - Row(RowType, const std::string &); + Row(RowType); + + template + Row(RowType, const T &); + + template + const T &get_param(unsigned) const; std::string str() const; + Msp::DataFile::Statement save() const; + static Row parse(const std::string &); }; @@ -64,6 +76,7 @@ private: unsigned current_row; bool executing; Block *pending_block; + Train *pending_train; Msp::Time::TimeStamp wait_timeout; public: @@ -71,6 +84,7 @@ public: void set_enabled(bool); bool is_enabled() const { return enabled; } + void reset(); void clear(); void append(const Row &);