1 #ifndef LIBR2C2_DUMMY_H_
2 #define LIBR2C2_DUMMY_H_
5 #include <msp/time/timedelta.h>
6 #include <msp/time/timestamp.h>
11 class Dummy: public Driver
18 Msp::Time::TimeStamp timeout;
29 std::map<unsigned, TurnoutState> turnouts;
30 std::map<unsigned, LocoState> locos;
31 std::map<unsigned, bool> sensors;
32 Msp::Time::TimeDelta turnout_delay;
35 Dummy(const Options &);
37 virtual void set_power(bool);
38 virtual bool get_power() const { return power; }
39 virtual void halt(bool);
40 virtual bool is_halted() const { return halted; }
42 virtual const char *enumerate_protocols(unsigned) const;
43 virtual unsigned get_protocol_speed_steps(const std::string &) const;
44 virtual DetectedLocomotive *enumerate_detected_locos(unsigned) const { return 0; }
45 virtual unsigned add_loco(unsigned a, const std::string &, const VehicleType &) { return a; }
46 virtual void remove_loco(unsigned) { }
47 virtual void set_loco_speed(unsigned, unsigned);
48 virtual void set_loco_reverse(unsigned, bool);
49 virtual void set_loco_function(unsigned, unsigned, bool);
51 virtual unsigned add_turnout(unsigned, const TrackType &);
52 virtual void remove_turnout(unsigned) { }
53 virtual void set_turnout(unsigned, unsigned);
54 virtual unsigned get_turnout(unsigned) const;
56 virtual unsigned add_signal(unsigned a, const SignalType &) { return a; }
57 virtual void remove_signal(unsigned) { }
58 virtual void set_signal(unsigned, unsigned) { }
59 virtual unsigned get_signal(unsigned) const { return 0; }
61 virtual unsigned add_sensor(unsigned a) { return a; }
62 virtual void remove_sensor(unsigned) { }
63 virtual void set_sensor(unsigned, bool);
64 virtual bool get_sensor(unsigned) const;
67 virtual void flush() { }