aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-10 12:41:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-21 15:40:00 +0200
commit63403a8a095ceba0ad9a17e46013a46918726181 (patch)
tree4ea1b907bf94124cf7b4dc831b631c91a98993be
parentfa1fa57d5fe1cb901520f03e7f802a156aae1034 (diff)
Set context::object in all common traversers
-rw-r--r--odb/common.cxx14
-rw-r--r--odb/common.hxx8
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 ();
}