diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-15 11:33:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-21 19:25:06 +0200 |
commit | 6508eb18a20a2f0bc48374f3f0a352f1195cc95b (patch) | |
tree | 0aaf5a65d82b7d58721b0020c17885d16f178b3e /odb/relational/header.hxx | |
parent | b2f0cd834b8f5651985357f8acbe82edd7d11c63 (diff) |
Add support for readonly members
New pragma: readonly. New test: readonly.
Diffstat (limited to 'odb/relational/header.hxx')
-rw-r--r-- | odb/relational/header.hxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/odb/relational/header.hxx b/odb/relational/header.hxx index 4351db9..7190e49 100644 --- a/odb/relational/header.hxx +++ b/odb/relational/header.hxx @@ -538,19 +538,19 @@ namespace relational os << " container_type;"; os << "typedef odb::access::container_traits< container_type > " << - "container_traits;"; + "container_traits_type;"; switch (ck) { case ck_ordered: { - os << "typedef container_traits::index_type index_type;"; + os << "typedef container_traits_type::index_type index_type;"; break; } case ck_map: case ck_multimap: { - os << "typedef container_traits::key_type key_type;"; + os << "typedef container_traits_type::key_type key_type;"; } case ck_set: case ck_multiset: @@ -559,7 +559,7 @@ namespace relational } } - os << "typedef container_traits::value_type value_type;" + os << "typedef container_traits_type::value_type value_type;" << endl; // functions_type @@ -844,7 +844,7 @@ namespace relational // update // - if (!inverse) + if (!(inverse || readonly (member_path_, member_scope_))) os << "static void" << endl << "update (const container_type&," << endl << "const " << db << "::binding& id," << endl @@ -1169,9 +1169,10 @@ namespace relational // update () // - os << "static void" << endl - << "update (database&, const object_type&);" - << endl; + if (!readonly (c)) + os << "static void" << endl + << "update (database&, const object_type&);" + << endl; // erase () // |