aboutsummaryrefslogtreecommitdiff
path: root/odb/callback.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
commitc89d2d34e27f674720c3c497bbd18a26a5bf9f38 (patch)
tree069235941e24e1ea9ad8331e0404b90d0b283970 /odb/callback.hxx
parentbf70d160de580c735953cedd023bfea98c7ca920 (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/callback.hxx')
-rw-r--r--odb/callback.hxx44
1 files changed, 44 insertions, 0 deletions
diff --git a/odb/callback.hxx b/odb/callback.hxx
new file mode 100644
index 0000000..16d89ef
--- /dev/null
+++ b/odb/callback.hxx
@@ -0,0 +1,44 @@
+// file : odb/callback.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_CALLBACK_HXX
+#define ODB_CALLBACK_HXX
+
+#include <odb/pre.hxx>
+
+#include <odb/details/export.hxx>
+
+namespace odb
+{
+ struct LIBODB_EXPORT callback_event
+ {
+ enum value
+ {
+ pre_persist,
+ post_persist,
+ pre_load,
+ post_load,
+ pre_update,
+ post_update,
+ pre_erase,
+ post_erase
+ };
+
+ callback_event (value v): v_ (v) {}
+ operator value () const {return v_;}
+
+ private:
+ value v_;
+ };
+
+ namespace core
+ {
+ using odb::callback_event;
+ }
+}
+
+#include <odb/post.hxx>
+
+#endif // ODB_CALLBACK_HXX