aboutsummaryrefslogtreecommitdiff
path: root/odb/forward.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-08-21 16:27:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-08-21 16:27:34 +0200
commit5b6649e6f7dd256147b48197a007c23001cef647 (patch)
treedebffbb24e00bc485f9675cbc5be08ec1cc8eea9 /odb/forward.hxx
parent1e63b60696f2e3012221e3bf6430a0d66ce1ba34 (diff)
Add odb::connection class
This abstract class represents a connection to the database. One can use it to start a transaction or to execute a native statement out of a transaction. Before we had concrete connection classes in the database runtime libraries (e.g., odb::mysql::connection). Now these classes derive from odb::connection.
Diffstat (limited to 'odb/forward.hxx')
-rw-r--r--odb/forward.hxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/odb/forward.hxx b/odb/forward.hxx
index d51240a..830193c 100644
--- a/odb/forward.hxx
+++ b/odb/forward.hxx
@@ -13,6 +13,8 @@
namespace odb
{
class database;
+ class connection;
+ typedef details::shared_ptr<connection> connection_ptr;
class transaction;
class session;
@@ -22,6 +24,8 @@ namespace odb
namespace core
{
using odb::database;
+ using odb::connection;
+ using odb::connection_ptr;
using odb::transaction;
using odb::session;
using odb::result;
@@ -51,6 +55,15 @@ namespace odb
template <typename T>
struct object_traits;
+
+ namespace details
+ {
+ template <>
+ struct counter_type<connection>
+ {
+ typedef shared_base counter;
+ };
+ }
}
#include <odb/post.hxx>