]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/dummy.h
Major architecture rework
[r2c2.git] / source / libmarklin / dummy.h
diff --git a/source/libmarklin/dummy.h b/source/libmarklin/dummy.h
new file mode 100644 (file)
index 0000000..96b62a8
--- /dev/null
@@ -0,0 +1,46 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2010  Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
+#ifndef LIBMARKLIN_DUMMY_H_
+#define LIBMARKLIN_DUMMY_H_
+
+#include <map>
+#include "driver.h"
+
+namespace Marklin {
+
+class Dummy: public Driver
+{
+private:
+       bool power;
+       std::map<unsigned, bool> turnouts;
+
+public:
+       Dummy();
+
+       virtual void set_power(bool);
+       virtual bool get_power() const { return power; }
+
+       virtual void add_loco(unsigned) { }
+       virtual void set_loco_speed(unsigned, unsigned) { }
+       virtual void set_loco_reverse(unsigned, bool) { }
+       virtual void set_loco_function(unsigned, unsigned, bool) { }
+
+       virtual void add_turnout(unsigned);
+       virtual void set_turnout(unsigned, bool);
+       virtual bool get_turnout(unsigned) const;
+
+       virtual void add_sensor(unsigned) { }
+       virtual bool get_sensor(unsigned) const { return false; }
+
+       virtual void tick() { }
+       virtual void flush() { }
+};
+
+} // namespace Marklin
+
+#endif