diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-08-15 11:46:00 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-08-15 11:46:00 +0200 |
commit | eacf52a9a4f3832274fdefc909ab23c13413e128 (patch) | |
tree | f1f754b6149797315f91d6f872363555201d5a65 /odb/relational/mssql/source.cxx | |
parent | 396cad633b6f0559a39e5111827f9b1125c67506 (diff) |
Add support for member accessors/modifiers
New pragmas: get, set, access. New test: common/access.
Diffstat (limited to 'odb/relational/mssql/source.cxx')
-rw-r--r-- | odb/relational/mssql/source.cxx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/odb/relational/mssql/source.cxx b/odb/relational/mssql/source.cxx index 1201c87..7fce155 100644 --- a/odb/relational/mssql/source.cxx +++ b/odb/relational/mssql/source.cxx @@ -307,6 +307,24 @@ namespace relational } virtual void + check_accessor (member_info& mi, member_access& ma) + { + // We cannot use accessors that return by-value for long data + // members. + // + if (long_data (*mi.st) && ma.by_value) + { + error (ma.loc) << "accessor returning a value cannot be used " + << "for a data member of SQL Server long data " + << "type" << endl; + info (ma.loc) << "accessor returning a const reference is required" + << endl; + info (mi.m.location ()) << "data member is defined here" << endl; + throw operation_failed (); + } + } + + virtual void traverse_integer (member_info& mi) { os << traits << "::set_image (" << endl @@ -541,6 +559,23 @@ namespace relational } virtual void + check_modifier (member_info& mi, member_access& ma) + { + // We cannot use by-value modifier for long data members. + // + if (long_data (*mi.st) && ma.placeholder ()) + { + error (ma.loc) << "modifier accepting a value cannot be used " + << "for a data member of SQL Server long data " + << "type" << endl; + info (ma.loc) << "modifier returning a non-const reference is " + << "required" << endl; + info (mi.m.location ()) << "data member is defined here" << endl; + throw operation_failed (); + } + } + + virtual void traverse_integer (member_info& mi) { os << traits << "::set_value (" << endl |