From 6b76715e63d2c265a4c51c73f9019bc578f874cb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Oct 2012 14:47:57 +0200 Subject: Fix bug in transient inheritance handling Also test that we can handle it for objects, composite values, and views. --- common/polymorphism/test2.hxx | 106 ------------------------------------------ 1 file changed, 106 deletions(-) delete mode 100644 common/polymorphism/test2.hxx (limited to 'common/polymorphism/test2.hxx') diff --git a/common/polymorphism/test2.hxx b/common/polymorphism/test2.hxx deleted file mode 100644 index 1b81f41..0000000 --- a/common/polymorphism/test2.hxx +++ /dev/null @@ -1,106 +0,0 @@ -// file : common/polymorphism/test2.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#include -#include - -#include -#include - -// Test inverse object pointers in polymorhic bases. -// -#pragma db namespace table("t2_") -namespace test2 -{ - struct root; - - #pragma db object - struct root_pointer - { - root_pointer (root* r = 0): p (r) {} - - #pragma db id auto - unsigned long id; - - root* p; - }; - - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - #pragma db inverse(p) - odb::lazy_ptr rp; - }; - - struct base; - - #pragma db object - struct base_pointer - { - base_pointer (base* b = 0) {if (b != 0) vp.push_back (b);} - - #pragma db id auto - unsigned long id; - - std::vector vp; - }; - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, const std::string& s): root (i), str (s) {} - - std::string str; - - #pragma db inverse(vp) - odb::lazy_ptr bp; - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, const std::string& s, unsigned long n) - : base (i, s), num (n) {} - - unsigned long num; - }; - - // Views. - // - #pragma db view object(root_pointer = rp) object(root) - struct root_view - { - #pragma db column(rp::id) - unsigned long rp_id; - - #pragma db column(root::id) - unsigned long r_id; - }; - - #pragma db view object(base_pointer) object(base = b) - struct base_view - { - #pragma db column(base_pointer::id) - unsigned long bp_id; - - #pragma db column(b::id) - unsigned long b_id; - - std::string str; - }; -} - -#endif // TEST2_HXX -- cgit v1.1