aboutsummaryrefslogtreecommitdiff
path: root/tracer/pragma/test.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-13 10:42:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-13 10:42:46 +0200
commita9d527ffd7e4a2222d5e80c8110f092af0cb5a74 (patch)
treecd190434be960f8bbb8547619b8b97265d844ed9 /tracer/pragma/test.hxx
parentc85f0af82c3abf2e7d2dfa76351a59d9884395c0 (diff)
Change pragma syntax
Change odb pragma namespace to db. Use qualifiers (object, value, and member) to specify type/member name. Add support for mapping C++ types to db types.
Diffstat (limited to 'tracer/pragma/test.hxx')
-rw-r--r--tracer/pragma/test.hxx42
1 files changed, 42 insertions, 0 deletions
diff --git a/tracer/pragma/test.hxx b/tracer/pragma/test.hxx
new file mode 100644
index 0000000..2dc499d
--- /dev/null
+++ b/tracer/pragma/test.hxx
@@ -0,0 +1,42 @@
+// file : tracer/template/test.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef TEST_HXX
+#define TEST_HXX
+
+#include <odb/core.hxx>
+
+#pragma db value(bool) type ("INT")
+
+struct x {};
+#pragma db value (x)
+
+namespace N
+{
+ #pragma db object
+ struct object1
+ {
+ object1 () {}
+
+ #pragma db id
+ unsigned long id_;
+
+ #pragma db member type ("INT")
+ bool b_;
+ };
+
+ struct object2
+ {
+ object2 () {}
+
+ unsigned long id_;
+ };
+
+ #pragma db object (object2)
+}
+
+PRAGMA_DB (member (N::object2::id_) id auto);
+
+#endif // TEST_HXX