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, unsigned, unsigned, bool> signal_loco_speed;
21 sigc::signal<void, unsigned, unsigned, bool> signal_loco_function;
22 sigc::signal<void, unsigned, bool> signal_turnout;
23 sigc::signal<void, unsigned, bool> signal_sensor;
30 virtual void set_power(bool) = 0;
31 virtual bool get_power() const = 0;
33 virtual void add_loco(unsigned) = 0;
34 virtual void set_loco_speed(unsigned, unsigned) = 0;
35 virtual void set_loco_reverse(unsigned, bool) = 0;
36 virtual void set_loco_function(unsigned, unsigned, bool) = 0;
38 virtual void add_turnout(unsigned) = 0;
39 virtual void set_turnout(unsigned, bool) = 0;
40 virtual bool get_turnout(unsigned) const = 0;
42 virtual void add_sensor(unsigned) = 0;
43 virtual void set_sensor(unsigned, bool) = 0;
44 virtual bool get_sensor(unsigned) const = 0;
46 virtual void tick() = 0;
47 virtual void flush() = 0;
49 static Driver *create(const std::string &);
52 } // namespace Marklin