]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/except.h
Allow intercepting and denying turnout route and locomotive speed changes
[r2c2.git] / source / libmarklin / except.h
diff --git a/source/libmarklin/except.h b/source/libmarklin/except.h
new file mode 100644 (file)
index 0000000..85fe431
--- /dev/null
@@ -0,0 +1,31 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2009  Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
+#ifndef LIBMARKLIN_EXCEPT_H_
+#define LIBMARKLIN_EXCEPT_H_
+
+#include <msp/core/except.h>
+
+namespace Marklin {
+
+class Train;
+
+class TurnoutBusy: public Msp::Exception
+{
+private:
+       Train *train;
+
+public:
+       TurnoutBusy(Train *t): Exception("Turnout is busy"), train(t) { }
+       virtual ~TurnoutBusy() throw() { }
+
+       Train *get_train() const throw() { return train; }
+};
+
+}
+
+#endif