diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-06 18:00:43 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-06 18:00:43 +0200 |
commit | 5daaa1a6d9c8f5d3a4ad3d7009df564bc6506424 (patch) | |
tree | b96d205208587208a4e443be192fe264d2f53d57 /odb/mysql/connection.hxx | |
parent | 6fd2fb44263eb6704905cddcc607462c21c5e687 (diff) |
Add support for container persistence
Generalize statements that were used for persisting objects to work for
both objects and containers. Implement a cache for container statements.
Diffstat (limited to 'odb/mysql/connection.hxx')
-rw-r--r-- | odb/mysql/connection.hxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/odb/mysql/connection.hxx b/odb/mysql/connection.hxx index 7bbc335..7696909 100644 --- a/odb/mysql/connection.hxx +++ b/odb/mysql/connection.hxx @@ -9,12 +9,12 @@ #include <odb/pre.hxx> #include <vector> +#include <memory> // std::auto_ptr #include <odb/forward.hxx> #include <odb/mysql/mysql.hxx> #include <odb/mysql/version.hxx> -#include <odb/mysql/statement.hxx> #include <odb/details/shared-ptr.hxx> @@ -24,6 +24,9 @@ namespace odb { namespace mysql { + class statement; + class statement_cache; + class LIBODB_MYSQL_EXPORT connection: public details::shared_base { public: @@ -44,7 +47,7 @@ namespace odb statement_cache_type& statement_cache () { - return statement_cache_; + return *statement_cache_; } public: @@ -82,7 +85,7 @@ namespace odb MYSQL mysql_; MYSQL* handle_; statement* active_; - statement_cache_type statement_cache_; + std::auto_ptr<statement_cache_type> statement_cache_; typedef std::vector<MYSQL_STMT*> stmt_handles; stmt_handles stmt_handles_; |