diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-24 16:37:09 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-24 16:37:09 +0200 |
commit | e7892161b62d0f7f2ccf984d163a91025a3ddf78 (patch) | |
tree | 53b4ed2934df81071e5cf6b4fb44568bcf487522 /odb/context.cxx | |
parent | 19ba163feb74def218861b4b3981e713b358d1c8 (diff) |
Implement support for many-to-{one,many} inverse relationships
Diffstat (limited to 'odb/context.cxx')
-rw-r--r-- | odb/context.cxx | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/odb/context.cxx b/odb/context.cxx index d0784c2..5585ab1 100644 --- a/odb/context.cxx +++ b/odb/context.cxx @@ -432,6 +432,20 @@ namespace r_ = r_ || context::is_a (m, flags_); } + virtual void + container (semantics::data_member& m) + { + // We don't cross the container boundaries (separate table). + // + r_ = r_ || context::is_a ( + m, + flags_ & (context::test_container | + context::test_straight_container | + context::test_inverse_container), + context::container_vt (m.type ()), + "value"); + } + private: bool r_; unsigned short flags_; @@ -446,11 +460,31 @@ is_a (semantics::data_member& m, { bool r (false); - if (f & eager_pointer) + if (f & test_pointer) { r = r || object_pointer (m, kp); } + if (f & test_eager_pointer) + { + r = r || object_pointer (m, kp); + } + + if (f & test_container) + { + r = r || container (m.type ()); + } + + if (f & test_straight_container) + { + r = r || (container (m.type ()) && !inverse (m, kp)); + } + + if (f & test_inverse_container) + { + r = r || (container (m.type ()) && inverse (m, kp)); + } + return r; } |