summaryrefslogtreecommitdiff
path: root/odb/relational/source.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-07-04 17:53:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-07-04 17:53:47 +0200
commit932cd7a53b3996468fee5cfa63c2b2998dbe971a (patch)
tree55424fe09a95310bc2b8e6d1473108b64107e06c /odb/relational/source.hxx
parent1ac1ae65e6cbf42c002acb27615127bbc0b20d9e (diff)
Implement support for database operations callbacks
New object pragma: callback. New test: common/callback. New manual section: 10.1.4, "callback".
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r--odb/relational/source.hxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx
index 4d2f10a..42d0f9b 100644
--- a/odb/relational/source.hxx
+++ b/odb/relational/source.hxx
@@ -2331,9 +2331,11 @@ namespace relational
<< endl
<< "if (l.locked ())"
<< "{"
+ << "callback (db, obj, callback_event::pre_load);"
<< "init (obj, sts.image (), db);"
<< "load_ (sts, obj);"
<< "sts.load_delayed ();"
+ << "callback (db, obj, callback_event::post_load);"
<< "l.unlock ();"
<< "}"
<< "else" << endl
@@ -2367,9 +2369,11 @@ namespace relational
<< endl
<< "if (l.locked ())"
<< "{"
+ << "callback (db, obj, callback_event::pre_load);"
<< "init (obj, sts.image (), db);"
<< "load_ (sts, obj);"
<< "sts.load_delayed ();"
+ << "callback (db, obj, callback_event::post_load);"
<< "l.unlock ();"
<< "}"
<< "else" << endl
@@ -2689,8 +2693,6 @@ namespace relational
if (embedded_schema)
os << "#include <odb/schema-catalog-impl.hxx>" << endl;
- os << "#include <odb/details/unused.hxx>" << endl;
-
if (options.generate_query ())
os << "#include <odb/details/shared-ptr.hxx>" << endl;