X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Ftrain.h;h=5f852564074f37b5247c29f0e04a8974e569341f;hb=8e3009751ee81e0e5312cae53ee844bdd9e49628;hp=4c4d1c353cb3145d566d7a5917d605c73cc02b74;hpb=e13742268b7030f8d6152858d39f1c6b43f94c88;p=r2c2.git diff --git a/source/libmarklin/train.h b/source/libmarklin/train.h index 4c4d1c3..5f85256 100644 --- a/source/libmarklin/train.h +++ b/source/libmarklin/train.h @@ -17,6 +17,7 @@ Distributed under the GPL namespace Marklin { +class ArticleNumber; class Route; class Timetable; class Vehicle; @@ -41,7 +42,7 @@ public: void real_speed(unsigned, float, float); void route(const std::string &); void timetable(); - void vehicle(unsigned); + void vehicle(ArticleNumber); }; sigc::signal signal_name_changed; @@ -78,8 +79,9 @@ private: int priority; const Train *yielding_to; std::vector vehicles; - BlockList cur_blocks; - BlockList rsv_blocks; + BlockList blocks; + BlockList::iterator cur_blocks_end; + BlockList::iterator clear_blocks_end; Block *pending_block; bool reserving; bool advancing; @@ -140,7 +142,7 @@ public: const Route *get_route() const; void place(Block &, unsigned); void unplace(); - bool is_placed() const { return !cur_blocks.empty(); } + bool is_placed() const { return !blocks.empty(); } bool free_block(Block &); void free_noncritical_blocks(); int get_entry_to_block(Block &) const; @@ -156,21 +158,22 @@ private: void loco_speed_event(unsigned, unsigned, bool); void loco_func_event(unsigned, unsigned, bool); void sensor_event(unsigned, bool); - void turnout_event(unsigned, bool); + void turnout_path_changed(Track &); void halt_event(bool); void block_reserved(const Block &, const Train *); - unsigned reserve_more(); + void reserve_more(); + void check_turnout_paths(bool); float get_reserved_distance_until(const Block *, bool) const; float get_real_speed(unsigned) const; unsigned find_speed(float) const; float get_travel_speed() const; void set_status(const std::string &); - void release_blocks(BlockList &); - void release_blocks(BlockList &, BlockList::iterator, BlockList::iterator); + void release_blocks(); + void release_blocks(BlockList::iterator, BlockList::iterator); void reverse_blocks(BlockList &) const; bool advance_route(std::list::iterator &, Track &); Route *create_lead_route(Route *, const Route *); - bool is_valid_diversion(const Route &, Track &, unsigned); + bool is_valid_diversion(const Route &, const TrackIter &); }; } // namespace Marklin