3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
8 #ifndef LIBMARKLIN_BLOCK_H_
9 #define LIBMARKLIN_BLOCK_H_
31 Endpoint(Track *, unsigned);
39 std::set<Track *> tracks;
40 std::vector<Endpoint> endpoints;
44 Block(Layout &, Track &);
47 unsigned get_id() const { return id; }
48 unsigned get_sensor_id() const { return sensor_id; }
49 unsigned get_turnout_id() const { return turnout_id; }
50 const std::set<Track *> &get_tracks() const { return tracks; }
51 bool has_track(Track &) const;
52 const std::vector<Endpoint> &get_endpoints() const { return endpoints; }
53 int get_endpoint_by_link(Block &) const;
54 float get_path_length(unsigned, const Route * = 0) const;
55 void check_link(Block &);
56 void break_link(Block &);
57 Block *get_link(unsigned) const;
58 bool reserve(Train *);
59 Train *get_train() const { return train; }
62 void find_paths(Track &, unsigned, unsigned, std::set<Track *> &);
66 } // namespace Marklin