summaryrefslogtreecommitdiff
path: root/libodb/odb/callback.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libodb/odb/callback.hxx')
-rw-r--r--libodb/odb/callback.hxx42
1 files changed, 42 insertions, 0 deletions
diff --git a/libodb/odb/callback.hxx b/libodb/odb/callback.hxx
new file mode 100644
index 0000000..aaa066f
--- /dev/null
+++ b/libodb/odb/callback.hxx
@@ -0,0 +1,42 @@
+// file : odb/callback.hxx
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_CALLBACK_HXX
+#define ODB_CALLBACK_HXX
+
+#include <odb/pre.hxx>
+
+#include <odb/forward.hxx> // odb::core
+
+namespace odb
+{
+ struct 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 common
+ {
+ using odb::callback_event;
+ }
+}
+
+#include <odb/post.hxx>
+
+#endif // ODB_CALLBACK_HXX