From 63403a8a095ceba0ad9a17e46013a46918726181 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Mar 2011 12:41:33 +0200 Subject: Set context::object in all common traversers --- odb/common.cxx | 14 +++++++++++++- odb/common.hxx | 8 +++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/odb/common.cxx b/odb/common.cxx index 342f28b..1115565 100644 --- a/odb/common.cxx +++ b/odb/common.cxx @@ -183,13 +183,25 @@ traverse_composite (semantics::data_member& m, void object_columns_base:: traverse (semantics::class_& c) { + bool obj (c.count ("object")); + // Ignore transient bases. // - if (!(c.count ("object") || context::comp_value (c))) + if (!(obj || context::comp_value (c))) return; + semantics::class_* prev; + if (obj) + { + prev = object; + object = &c; + } + inherits (c); names (c); + + if (obj) + object = prev; } void object_columns_base::member:: diff --git a/odb/common.hxx b/odb/common.hxx index 99741b2..8bf7b8e 100644 --- a/odb/common.hxx +++ b/odb/common.hxx @@ -43,7 +43,8 @@ public: } object_members_base (object_members_base const& x) - : context (), member_ (*this) + : context (), //@@ -Wextra + member_ (*this) { init (x.build_prefix_, x.build_table_prefix_); } @@ -94,7 +95,7 @@ private: // Traverse object columns recursively by going into composite members. // -struct object_columns_base: traversal::class_ +struct object_columns_base: traversal::class_, virtual context { // Returning false means that the column has been ignored and the // first flag should not be changed. @@ -117,7 +118,8 @@ public: } object_columns_base (object_columns_base const&) - : member_ (*this) + : context (), //@@ -Wextra + member_ (*this) { init (); } -- cgit v1.1