diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-08 12:08:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-08 12:08:55 +0200 |
commit | 10be61ad26034a574a013c979549aaedf9aa8382 (patch) | |
tree | a4a0d5385a1a54776a5cafabc4d2f603a1e8a452 /common/view/olv/test7.hxx | |
parent | edb7ba7437aa577d65da942aaf778c16c9a501ed (diff) |
Split view/olv test into multiple headers files
VC++ complains that the object file is too large.
Diffstat (limited to 'common/view/olv/test7.hxx')
-rw-r--r-- | common/view/olv/test7.hxx | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/common/view/olv/test7.hxx b/common/view/olv/test7.hxx new file mode 100644 index 0000000..83bd5e7 --- /dev/null +++ b/common/view/olv/test7.hxx @@ -0,0 +1,52 @@ +// file : common/view/olv/test7.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST7_HXX +#define TEST7_HXX + +#include <string> +#include <memory> // unique_ptr + +#include <odb/core.hxx> + +// Test explicit conversion to smart pointer member. +// +#pragma db namespace table("t7_") pointer(*) session +namespace test7 +{ + using std::unique_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + object1* o1; // Shallow. + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + unique_ptr<object2> o2; + unique_ptr<object1> o1; + }; +} + +#endif // TEST7_HXX |