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_
32 Endpoint(Track *, unsigned);
40 std::set<Track *> tracks;
41 std::vector<Endpoint> endpoints;
45 Block(Layout &, Track &);
48 unsigned get_id() const { return id; }
49 unsigned get_sensor_id() const { return sensor_id; }
50 unsigned get_turnout_id() const { return turnout_id; }
51 const std::set<Track *> &get_tracks() const { return tracks; }
52 bool has_track(Track &) const;
53 const std::vector<Endpoint> &get_endpoints() const { return endpoints; }
54 const Endpoint &get_endpoint(unsigned) const;
55 int get_endpoint_by_link(Block &) const;
56 float get_path_length(unsigned, const Route * = 0) const;
57 void check_link(Block &);
58 void break_link(Block &);
59 Block *get_link(unsigned) const;
60 bool reserve(Train *);
61 Train *get_train() const { return train; }
64 void find_paths(TrackIter, unsigned);
68 } // namespace Marklin