aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/Schrodinbit.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-18 20:03:31 +0000
committerDavid Robillard <d@drobilla.net>2010-12-18 20:03:31 +0000
commita8eb7f8f5b54b955c6eb23c10f2eaaca7f746ef2 (patch)
tree884130181f8b716fd133ed2d1890f2b196af0208 /src/engine/Schrodinbit.hpp
parent2b5adf2b6c8c5fa44fec0a09c351a8b4954d06d4 (diff)
downloadmachina-a8eb7f8f5b54b955c6eb23c10f2eaaca7f746ef2.tar.gz
machina-a8eb7f8f5b54b955c6eb23c10f2eaaca7f746ef2.tar.bz2
machina-a8eb7f8f5b54b955c6eb23c10f2eaaca7f746ef2.zip
Remove more things from public engine interface.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@2764 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/Schrodinbit.hpp')
-rw-r--r--src/engine/Schrodinbit.hpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/engine/Schrodinbit.hpp b/src/engine/Schrodinbit.hpp
new file mode 100644
index 0000000..7fe1825
--- /dev/null
+++ b/src/engine/Schrodinbit.hpp
@@ -0,0 +1,45 @@
+/* This file is part of Machina.
+ * Copyright (C) 2007-2009 David Robillard <http://drobilla.net>
+ *
+ * Machina is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * Machina is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef SCHRODINBIT_HPP
+#define SCHRODINBIT_HPP
+
+
+/** A flag which becomes false when it's value is observed
+ */
+class Schrodinbit {
+public:
+ Schrodinbit() : _flag(false) {}
+
+ inline operator bool() {
+ const bool ret = _flag;
+ _flag = false;
+ return ret;
+ }
+
+ inline bool operator=(bool flag) {
+ _flag = flag;
+ return flag;
+ }
+
+private:
+ bool _flag;
+};
+
+
+#endif // SCHRODINBIT_HPP
+