summaryrefslogtreecommitdiff
path: root/ARMFCaptureD3D/ConfigFile/Triplet.h
diff options
context:
space:
mode:
Diffstat (limited to 'ARMFCaptureD3D/ConfigFile/Triplet.h')
-rw-r--r--ARMFCaptureD3D/ConfigFile/Triplet.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/ARMFCaptureD3D/ConfigFile/Triplet.h b/ARMFCaptureD3D/ConfigFile/Triplet.h
new file mode 100644
index 0000000..e26dc47
--- /dev/null
+++ b/ARMFCaptureD3D/ConfigFile/Triplet.h
@@ -0,0 +1,34 @@
+// Triplet.h
+// A sample user-defined data type for illustrating ConfigFile
+// Operators << and >> are defined to allow writing to and reading from files
+// Richard J. Wagner 24 May 2004
+
+#include <iostream>
+
+struct Triplet
+{
+ int a, b, c;
+
+ Triplet() {}
+ Triplet( int u, int v, int w ) : a(u), b(v), c(w) {}
+ Triplet( const Triplet& orig ) : a(orig.a), b(orig.b), c(orig.c) {}
+
+ Triplet& operator=( const Triplet& orig )
+ { a = orig.a; b = orig.b; c = orig.c; return *this; }
+};
+
+
+std::ostream& operator<<( std::ostream& os, const Triplet& t )
+{
+ // Save a triplet to os
+ os << t.a << " " << t.b << " " << t.c;
+ return os;
+}
+
+
+std::istream& operator>>( std::istream& is, Triplet& t )
+{
+ // Load a triplet from is
+ is >> t.a >> t.b >> t.c;
+ return is;
+}