summaryrefslogtreecommitdiff
path: root/odb/common.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-04-25 15:02:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-04-25 15:02:43 +0200
commit1a6a0652a6ef5b319cfc8ad05a0acee6910f7560 (patch)
tree40605db91ed90c342a9074308bd7406008b4f10b /odb/common.cxx
parent9c5b2f928699a6752d7c3d1a062bac7efc247c64 (diff)
Add support for abstract object types
Diffstat (limited to 'odb/common.cxx')
-rw-r--r--odb/common.cxx16
1 files changed, 16 insertions, 0 deletions
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 ();