aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-11-15 17:46:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-11-15 17:46:28 +0200
commit89a3b6133ade1ccb3a8e9ab9c86eac6aaef5db69 (patch)
tree394eb90c5acc9b55460bc7e4961cf791a60e397d /odb/mysql
parent61acf05c698a8b611c5ccf6aed8d3e654d5acf8e (diff)
Add support for custom object pointers
New option: --default-pointer. New object pragma specifier: pointer.
Diffstat (limited to 'odb/mysql')
-rw-r--r--odb/mysql/header.cxx9
-rw-r--r--odb/mysql/source.cxx4
2 files changed, 6 insertions, 7 deletions
diff --git a/odb/mysql/header.cxx b/odb/mysql/header.cxx
index 195263c..79b8d67 100644
--- a/odb/mysql/header.cxx
+++ b/odb/mysql/header.cxx
@@ -675,15 +675,14 @@ namespace mysql
<< "//" << endl;
os << "template <>" << endl
- << "class access::object_traits< " << type << " >: " << endl
- << " public access::object_memory< " << type << " >," << endl
- << " public access::object_factory< " << type << " >"
+ << "class access::object_traits< " << type << " >"
<< "{"
<< "public:" << endl;
- // object_type
+ // object_type & pointer_type
//
- os << "typedef " << type << " object_type;";
+ os << "typedef " << type << " object_type;"
+ << "typedef " << c.get<string> ("object-pointer") << " pointer_type;";
// id_type
//
diff --git a/odb/mysql/source.cxx b/odb/mysql/source.cxx
index 29495df..2e54a04 100644
--- a/odb/mysql/source.cxx
+++ b/odb/mysql/source.cxx
@@ -2174,8 +2174,8 @@ namespace mysql
<< "bool grew (false);"
<< "if (find (sts, id, grew))"
<< "{"
- << "pointer_type p (access::object_factory< " << type <<
- " >::create ());"
+ << "pointer_type p (access::object_factory< object_type, " <<
+ "pointer_type >::create ());"
<< "pointer_traits< pointer_type >::guard g (p);"
<< "object_type& obj (pointer_traits< pointer_type >::get_ref (p));"
<< "init (obj, sts.image ());";