1 #ifndef LIBMARKLIN_TRAIN_H_
2 #define LIBMARKLIN_TRAIN_H_
4 #include <sigc++/trackable.h>
12 class Train: public sigc::trackable
15 Train(TrafficManager &, Locomotive &);
16 const std::string &get_name() const { return name; }
17 void set_speed(unsigned);
18 void place(Block *, const Block::Endpoint *);
19 bool free_block(Block *);
25 const Block::Endpoint *entry;
27 BlockRef(Block *s, const Block::Endpoint *e): block(s), entry(e) { }
29 typedef std::list<BlockRef> BlockRefSeq;
31 TrafficManager &trfc_mgr;
34 BlockRefSeq cur_blocks;
35 BlockRefSeq rsv_blocks;
36 unsigned target_speed;
38 void sensor_event(unsigned, bool);
41 typedef std::list<Train *> TrainSeq;
43 } // namespace Marklin