From 1a6a0652a6ef5b319cfc8ad05a0acee6910f7560 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Apr 2011 15:02:43 +0200 Subject: Add support for abstract object types --- odb/common.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'odb/common.cxx') diff --git a/odb/common.cxx b/odb/common.cxx index 20fd354..2c23e76 100644 --- a/odb/common.cxx +++ b/odb/common.cxx @@ -56,6 +56,9 @@ traverse (semantics::class_& c) { prev = context::object; context::object = &c; + + if (context::top_object == 0) + context::top_object = &c; } if (obj && build_table_prefix_) @@ -89,7 +92,12 @@ traverse (semantics::class_& c) } if (obj) + { + if (prev == 0) + context::top_object = 0; + context::object = prev; + } } void object_members_base::member:: @@ -234,6 +242,9 @@ traverse (semantics::class_& c) { prev = context::object; context::object = &c; + + if (context::top_object == 0) + context::top_object = &c; } if (obj) @@ -242,7 +253,12 @@ traverse (semantics::class_& c) composite (0, c); if (obj) + { + if (prev == 0) + context::top_object = 0; + context::object = prev; + } if (f && !member_.first_) flush (); -- cgit v1.1