diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-06-04 16:45:36 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-06-04 16:45:36 +0200 |
commit | fcfe083c7a6d12eb4b6b88eea4a5ebbfc4d36995 (patch) | |
tree | ba60af2863d425e8be78749558c73910ab2f921d /odb/mysql/transaction.hxx | |
parent | 073918a2f4bff3a6f12cfd722db50e3fb0a6db0d (diff) |
Initial implementation
Diffstat (limited to 'odb/mysql/transaction.hxx')
-rw-r--r-- | odb/mysql/transaction.hxx | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/odb/mysql/transaction.hxx b/odb/mysql/transaction.hxx new file mode 100644 index 0000000..ebb62b3 --- /dev/null +++ b/odb/mysql/transaction.hxx @@ -0,0 +1,53 @@ +// file : odb/mysql/transaction.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_MYSQL_TRANSACTION_HXX +#define ODB_MYSQL_TRANSACTION_HXX + +#include <odb/transaction.hxx> + +#include <odb/mysql/forward.hxx> + +namespace odb +{ + namespace mysql + { + class transaction_impl; + + class transaction: public odb::transaction + { + public: + typedef mysql::database database_type; + typedef mysql::connection connection_type; + + explicit + transaction (transaction_impl*); + + // Return the database this transaction is on. + // + database_type& + database (); + + // Return the underlying database connection for this transaction. + // + connection_type& + connection (); + + // Return current transaction or throw if there is no transaction + // in effect. + // + static transaction& + current (); + + public: + transaction_impl& + implementation (); + }; + } +} + +#include <odb/mysql/transaction.ixx> + +#endif // ODB_MYSQL_TRANSACTION_HXX |