summaryrefslogtreecommitdiff
path: root/odb/relational/source.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-04-25 11:29:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-04-25 11:29:06 +0200
commit82d1a3918899958cb26ed77119fbf908beb94dbc (patch)
tree9b58aaff1435f8142dfa8685c8b3e84922492016 /odb/relational/source.hxx
parentbbd0aa5d1f6e58dbbe900d2f15692fa2b24ed1f1 (diff)
Reuse container traits from base objects
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r--odb/relational/source.hxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx
index dbb3d4a..844dc11 100644
--- a/odb/relational/source.hxx
+++ b/odb/relational/source.hxx
@@ -582,6 +582,10 @@ namespace relational
{
using semantics::type;
+ // Figure out if this member is from a base object.
+ //
+ bool base (context::object != &object_);
+
type& t (m.type ());
container_kind_type ck (container_kind (t));
@@ -828,6 +832,9 @@ namespace relational
<< endl;
}
+ if (base)
+ return;
+
//
// Functions.
//
@@ -1213,8 +1220,7 @@ namespace relational
{
os << "using namespace " << db << ";"
<< endl
- << "typedef container_statements< " << name << " > statements;"
- << "statements& sts (*static_cast< statements* > (d));"
+ << "statements_type& sts (*static_cast< statements_type* > (d));"
<< "binding& b (sts.data_image_binding ());"
<< "data_image_type& di (sts.data_image ());"
<< endl;
@@ -1284,8 +1290,7 @@ namespace relational
os << "{"
<< "using namespace " << db << ";"
<< endl
- << "typedef container_statements< " << name << " > statements;"
- << "statements& sts (*static_cast< statements* > (d));"
+ << "statements_type& sts (*static_cast< statements_type* > (d));"
<< "data_image_type& di (sts.data_image ());";
// Extract current element.
@@ -1372,8 +1377,7 @@ namespace relational
if (!inverse)
os << "using namespace " << db << ";"
<< endl
- << "typedef container_statements< " << name << " > statements;"
- << "statements& sts (*static_cast< statements* > (d));"
+ << "statements_type& sts (*static_cast< statements_type* > (d));"
<< "sts.delete_all_statement ().execute ();";
os << "}";
@@ -1562,7 +1566,7 @@ namespace relational
container (semantics::data_member& m)
{
string traits (prefix_ + public_name (m) + "_traits");
- os << db << "::container_statements< " << traits << " > " <<
+ os << db << "::container_statements_impl< " << traits << " > " <<
prefix_ << m.name () << ";";
}
};