aboutsummaryrefslogtreecommitdiff
path: root/common/auto/test.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-08-19 11:25:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-08-19 11:25:20 +0200
commitb59214c08549043cb5812c025159c49d6f9efe01 (patch)
tree3d586457497b96391c292af33ffcfe9a25a33701 /common/auto/test.hxx
parentbc95a07e6ecd388b4ef485f218aa1211d36e0e53 (diff)
Test automatic id assignment
Diffstat (limited to 'common/auto/test.hxx')
-rw-r--r--common/auto/test.hxx33
1 files changed, 33 insertions, 0 deletions
diff --git a/common/auto/test.hxx b/common/auto/test.hxx
new file mode 100644
index 0000000..c23027e
--- /dev/null
+++ b/common/auto/test.hxx
@@ -0,0 +1,33 @@
+// file : common/auto/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 <string>
+
+#include <odb/core.hxx>
+
+#pragma odb object
+struct object
+{
+ object (const std::string& str)
+ : id_ (1), str_ (str)
+ {
+ }
+
+ #pragma odb auto id
+ unsigned long id_;
+ std::string str_;
+
+private:
+ object ()
+ {
+ }
+
+ friend class odb::access;
+};
+
+#endif // TEST_HXX