summaryrefslogtreecommitdiff
path: root/odb/mysql/database.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-03-01 12:34:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-03-01 12:34:41 +0200
commit7c2b5d2cb3eb6df8a8d45c509794ff177f6d4523 (patch)
treeabd3e4fb575f93cf0586367dc05b02adbbd15616 /odb/mysql/database.cxx
parentc073adb85f1f28c0f052530ff58f3ff27d5c5141 (diff)
Add support for using C++11 std::unique_ptr to pass connection factory
Diffstat (limited to 'odb/mysql/database.cxx')
-rw-r--r--odb/mysql/database.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/odb/mysql/database.cxx b/odb/mysql/database.cxx
index 8fb8597..03401d9 100644
--- a/odb/mysql/database.cxx
+++ b/odb/mysql/database.cxx
@@ -17,6 +17,8 @@ namespace odb
{
namespace mysql
{
+ using odb::details::transfer_ptr;
+
database::
~database ()
{
@@ -31,7 +33,7 @@ namespace odb
const char* socket,
const char* charset,
unsigned long client_flags,
- auto_ptr<connection_factory> factory)
+ transfer_ptr<connection_factory> factory)
: user_ (user ? user : ""),
passwd_str_ (passwd ? passwd : ""),
passwd_ (passwd ? passwd_str_.c_str () : 0),
@@ -42,7 +44,7 @@ namespace odb
socket_ (socket ? socket_str_.c_str () : 0),
charset_ (charset == 0 ? "" : charset),
client_flags_ (client_flags),
- factory_ (factory)
+ factory_ (factory.transfer ())
{
if (factory_.get () == 0)
factory_.reset (new connection_pool_factory ());
@@ -59,7 +61,7 @@ namespace odb
const string* socket,
const string& charset,
unsigned long client_flags,
- auto_ptr<connection_factory> factory)
+ transfer_ptr<connection_factory> factory)
: user_ (user),
passwd_str_ (passwd),
passwd_ (passwd_str_.c_str ()),
@@ -70,7 +72,7 @@ namespace odb
socket_ (socket ? socket_str_.c_str () : 0),
charset_ (charset),
client_flags_ (client_flags),
- factory_ (factory)
+ factory_ (factory.transfer ())
{
if (factory_.get () == 0)
factory_.reset (new connection_pool_factory ());
@@ -87,7 +89,7 @@ namespace odb
const string* socket,
const string& charset,
unsigned long client_flags,
- auto_ptr<connection_factory> factory)
+ transfer_ptr<connection_factory> factory)
: user_ (user),
passwd_str_ (passwd ? *passwd : ""),
passwd_ (passwd ? passwd_str_.c_str () : 0),
@@ -98,7 +100,7 @@ namespace odb
socket_ (socket ? socket_str_.c_str () : 0),
charset_ (charset),
client_flags_ (client_flags),
- factory_ (factory)
+ factory_ (factory.transfer ())
{
if (factory_.get () == 0)
factory_.reset (new connection_pool_factory ());
@@ -115,7 +117,7 @@ namespace odb
const string& socket,
const string& charset,
unsigned long client_flags,
- auto_ptr<connection_factory> factory)
+ transfer_ptr<connection_factory> factory)
: user_ (user),
passwd_str_ (passwd),
passwd_ (passwd_str_.c_str ()),
@@ -126,7 +128,7 @@ namespace odb
socket_ (socket_str_.c_str ()),
charset_ (charset),
client_flags_ (client_flags),
- factory_ (factory)
+ factory_ (factory.transfer ())
{
if (factory_.get () == 0)
factory_.reset (new connection_pool_factory ());
@@ -143,7 +145,7 @@ namespace odb
const string& socket,
const string& charset,
unsigned long client_flags,
- auto_ptr<connection_factory> factory)
+ transfer_ptr<connection_factory> factory)
: user_ (user),
passwd_str_ (passwd ? *passwd : ""),
passwd_ (passwd ? passwd_str_.c_str () : 0),
@@ -154,7 +156,7 @@ namespace odb
socket_ (socket_str_.c_str ()),
charset_ (charset),
client_flags_ (client_flags),
- factory_ (factory)
+ factory_ (factory.transfer ())
{
if (factory_.get () == 0)
factory_.reset (new connection_pool_factory ());
@@ -168,12 +170,12 @@ namespace odb
bool erase,
const string& charset,
unsigned long client_flags,
- auto_ptr<connection_factory> factory)
+ transfer_ptr<connection_factory> factory)
: passwd_ (0),
socket_ (0),
charset_ (charset),
client_flags_ (client_flags),
- factory_ (factory)
+ factory_ (factory.transfer ())
{
using namespace details;