]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/dummy.h
Major architecture rework
[r2c2.git] / source / libmarklin / dummy.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2010  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef LIBMARKLIN_DUMMY_H_
9 #define LIBMARKLIN_DUMMY_H_
10
11 #include <map>
12 #include "driver.h"
13
14 namespace Marklin {
15
16 class Dummy: public Driver
17 {
18 private:
19         bool power;
20         std::map<unsigned, bool> turnouts;
21
22 public:
23         Dummy();
24
25         virtual void set_power(bool);
26         virtual bool get_power() const { return power; }
27
28         virtual void add_loco(unsigned) { }
29         virtual void set_loco_speed(unsigned, unsigned) { }
30         virtual void set_loco_reverse(unsigned, bool) { }
31         virtual void set_loco_function(unsigned, unsigned, bool) { }
32
33         virtual void add_turnout(unsigned);
34         virtual void set_turnout(unsigned, bool);
35         virtual bool get_turnout(unsigned) const;
36
37         virtual void add_sensor(unsigned) { }
38         virtual bool get_sensor(unsigned) const { return false; }
39
40         virtual void tick() { }
41         virtual void flush() { }
42 };
43
44 } // namespace Marklin
45
46 #endif