diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-26 12:13:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-28 14:15:45 +0200 |
commit | 64d0ceffaaf5f57a3d24a5210bf0ad2a8474a618 (patch) | |
tree | 98115a01b0bd2e9ddfdc6ff3a0f7470915de483a /odb/relational/mysql/common.hxx | |
parent | 061a16256eef2c2df53e2e145d16f17270c2de82 (diff) |
Add wrapper support for composite values
NULL semantics for composite values is not yet supported.
Diffstat (limited to 'odb/relational/mysql/common.hxx')
-rw-r--r-- | odb/relational/mysql/common.hxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/odb/relational/mysql/common.hxx b/odb/relational/mysql/common.hxx index dae7774..69ee515 100644 --- a/odb/relational/mysql/common.hxx +++ b/odb/relational/mysql/common.hxx @@ -30,14 +30,21 @@ namespace relational { semantics::data_member& m; // Member. semantics::type& t; // Member C++ type (m.type () may != t). + semantics::type* wrapper; // Wrapper type if member is a wrapper. + // In this case t is the wrapped type. sql_type const* st; // Member SQL type (only simple values). string& var; // Member variable name with trailing '_'. // C++ type fq-name. // string - fq_type () const + fq_type (bool unwrap = true) const { + // At the moment a wrapped type can only be a composite value. + // + if (wrapper != 0 && unwrap) + return t.fq_name (); + // Use the original type from 'm' instead of 't' since the hint // may be invalid for a different type. Plus, if a type is // overriden, then the fq_type must be as well. @@ -51,9 +58,15 @@ namespace relational member_info (semantics::data_member& m_, semantics::type& t_, + semantics::type* wrapper_, string& var_, string const& fq_type) - : m (m_), t (t_), st (0), var (var_), fq_type_ (fq_type) + : m (m_), + t (t_), + wrapper (wrapper_), + st (0), + var (var_), + fq_type_ (fq_type) { } }; |