3 This file is part of the MSP Märklin suite
4 Copyright © 2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
8 #ifndef LIBMARKLIN_DRIVER_H_
9 #define LIBMARKLIN_DRIVER_H_
12 #include <sigc++/signal.h>
19 sigc::signal<void, bool> signal_power;
20 sigc::signal<void, bool> signal_halt;
21 sigc::signal<void, unsigned, unsigned, bool> signal_loco_speed;
22 sigc::signal<void, unsigned, unsigned, bool> signal_loco_function;
23 sigc::signal<void, unsigned, bool> signal_turnout;
24 sigc::signal<void, unsigned, bool> signal_sensor;
31 virtual void set_power(bool) = 0;
32 virtual bool get_power() const = 0;
33 virtual void halt(bool) = 0;
34 virtual bool is_halted() const = 0;
36 virtual const char *enumerate_protocols(unsigned) const = 0;
37 virtual unsigned get_protocol_speed_steps(const std::string &) const = 0;
38 virtual void add_loco(unsigned, const std::string &) = 0;
39 virtual void set_loco_speed(unsigned, unsigned) = 0;
40 virtual void set_loco_reverse(unsigned, bool) = 0;
41 virtual void set_loco_function(unsigned, unsigned, bool) = 0;
43 virtual void add_turnout(unsigned) = 0;
44 virtual void set_turnout(unsigned, bool) = 0;
45 virtual bool get_turnout(unsigned) const = 0;
47 virtual void add_sensor(unsigned) = 0;
48 virtual void set_sensor(unsigned, bool) = 0;
49 virtual bool get_sensor(unsigned) const = 0;
51 virtual void tick() = 0;
52 virtual void flush() = 0;
54 static Driver *create(const std::string &);
57 } // namespace Marklin