diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-25 09:46:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-25 09:46:59 +0200 |
commit | bbd0aa5d1f6e58dbbe900d2f15692fa2b24ed1f1 (patch) | |
tree | d547233f98595565037e2ab6dbe36220c4fc9877 /odb/relational/header.hxx | |
parent | 698d170bb92d30feeb67b8ba23c8a8a134c3cf16 (diff) |
Pass id binding instead of id image in container traits
This will allow us to reuse things more.
Diffstat (limited to 'odb/relational/header.hxx')
-rw-r--r-- | odb/relational/header.hxx | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/odb/relational/header.hxx b/odb/relational/header.hxx index c0661fb..944a997 100644 --- a/odb/relational/header.hxx +++ b/odb/relational/header.hxx @@ -181,11 +181,7 @@ namespace relational { typedef container_traits base; - container_traits (semantics::class_& obj) //@@ context::object - : object_members_base (true, false) - { - scope_ = "object_traits< " + obj.fq_name () + " >"; - } + container_traits (): object_members_base (true, false) {} virtual void container (semantics::data_member& m) @@ -371,11 +367,6 @@ namespace relational data_columns << "UL;" << endl; - // id_image_type - // - os << "typedef " << scope_ << "::id_image_type id_image_type;" - << endl; - // cond_image_type (object id is taken from the object image) // os << "struct cond_image_type" @@ -469,13 +460,19 @@ namespace relational // bind (cond_image) // os << "static void" << endl - << "bind (" << bind_vector << ", id_image_type*, cond_image_type&);" + << "bind (" << bind_vector << "," << endl + << "const " << bind_vector << " id," << endl + << "std::size_t id_size," << endl + << "cond_image_type&);" << endl; // bind (data_image) // os << "static void" << endl - << "bind (" << bind_vector << ", id_image_type*, data_image_type&);" + << "bind (" << bind_vector << "," << endl + << "const " << bind_vector << " id," << endl + << "std::size_t id_size," << endl + << "data_image_type&);" << endl; // grow () @@ -613,7 +610,7 @@ namespace relational if (!inverse) os << "static void" << endl << "persist (const container_type&," << endl - << "id_image_type&," << endl + << "const " << db << "::binding& id," << endl << "statements_type&);" << endl; @@ -621,7 +618,7 @@ namespace relational // os << "static void" << endl << "load (container_type&," << endl - << "id_image_type&," << endl + << "const " << db << "::binding& id," << endl << "statements_type&);" << endl; @@ -630,7 +627,7 @@ namespace relational if (!inverse) os << "static void" << endl << "update (const container_type&," << endl - << "id_image_type&," << endl + << "const " << db << "::binding& id," << endl << "statements_type&);" << endl; @@ -638,14 +635,11 @@ namespace relational // if (!inverse) os << "static void" << endl - << "erase (id_image_type&, statements_type&);" + << "erase (const " << db << "::binding& id, statements_type&);" << endl; os << "};"; } - - private: - string scope_; }; // @@ -778,7 +772,7 @@ namespace relational // Traits types. // { - instance<container_traits> t (c); + instance<container_traits> t; t->traverse (c); } |