From 683eccc6887a7fa34d58e873e19b48405ebf420a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Jul 2011 17:53:47 +0200 Subject: Implement support for database operations callbacks New object pragma: callback. New test: common/callback. New manual section: 10.1.4, "callback". --- common/callback/test.hxx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 common/callback/test.hxx (limited to 'common/callback/test.hxx') diff --git a/common/callback/test.hxx b/common/callback/test.hxx new file mode 100644 index 0000000..274e2b5 --- /dev/null +++ b/common/callback/test.hxx @@ -0,0 +1,32 @@ +// file : common/callback/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object callback(db_callback) +struct object +{ + object (unsigned long id, unsigned long d): id_ (id), data (d), pobj (0) {} + object (): id_ (0) {}; + + #pragma db id + unsigned long id_; + + unsigned long data; + + object* pobj; + + void + db_callback (odb::callback_event, odb::database&); + + void + db_callback (odb::callback_event, odb::database&) const; +}; + +#endif // TEST_HXX -- cgit v1.1