aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-08-18 20:03:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-08-18 20:03:19 +0200
commit4c8de7a0e8fa65d60b4b54d525c0b5ba43ac265a (patch)
tree84de015adcdd750fe7a3cf417ac856329a623ec1
parent35d912d70bc7073f173f22bb5948a00b3c4be3f8 (diff)
Move shared_ptr to the details namespace
-rw-r--r--odb/mysql/connection-factory.hxx11
-rw-r--r--odb/mysql/connection.hxx5
-rw-r--r--odb/mysql/database.hxx5
-rw-r--r--odb/mysql/database.ixx2
-rw-r--r--odb/mysql/query.cxx2
-rw-r--r--odb/mysql/query.hxx8
-rw-r--r--odb/mysql/query.ixx8
-rw-r--r--odb/mysql/result.hxx7
-rw-r--r--odb/mysql/result.txx2
-rw-r--r--odb/mysql/statement.hxx29
-rw-r--r--odb/mysql/transaction-impl.hxx5
11 files changed, 44 insertions, 40 deletions
diff --git a/odb/mysql/connection-factory.hxx b/odb/mysql/connection-factory.hxx
index 50072b2..4d57d75 100644
--- a/odb/mysql/connection-factory.hxx
+++ b/odb/mysql/connection-factory.hxx
@@ -9,14 +9,13 @@
#include <vector>
#include <cstddef> // std::size_t
-#include <odb/shared-ptr.hxx>
-
#include <odb/mysql/version.hxx>
#include <odb/mysql/forward.hxx>
#include <odb/mysql/connection.hxx>
#include <odb/details/mutex.hxx>
#include <odb/details/condition.hxx>
+#include <odb/details/shared-ptr.hxx>
namespace odb
{
@@ -25,7 +24,7 @@ namespace odb
class connection_factory
{
public:
- virtual shared_ptr<connection>
+ virtual details::shared_ptr<connection>
connect () = 0;
public:
@@ -46,7 +45,7 @@ namespace odb
{
}
- virtual shared_ptr<connection>
+ virtual details::shared_ptr<connection>
connect ();
virtual void
@@ -88,7 +87,7 @@ namespace odb
// @@ check min_ <= max_
}
- virtual shared_ptr<connection>
+ virtual details::shared_ptr<connection>
connect ();
virtual void
@@ -121,7 +120,7 @@ namespace odb
};
friend class pooled_connection;
- typedef std::vector<shared_ptr<pooled_connection> > connections;
+ typedef std::vector<details::shared_ptr<pooled_connection> > connections;
private:
void
diff --git a/odb/mysql/connection.hxx b/odb/mysql/connection.hxx
index 8509790..cc5e5f0 100644
--- a/odb/mysql/connection.hxx
+++ b/odb/mysql/connection.hxx
@@ -11,16 +11,17 @@
#include <vector>
#include <odb/forward.hxx>
-#include <odb/shared-ptr.hxx>
#include <odb/mysql/version.hxx>
#include <odb/mysql/statement.hxx>
+#include <odb/details/shared-ptr.hxx>
+
namespace odb
{
namespace mysql
{
- class connection: public shared_base
+ class connection: public details::shared_base
{
public:
typedef mysql::statement_cache statement_cache_type;
diff --git a/odb/mysql/database.hxx b/odb/mysql/database.hxx
index fe9ed05..3272eda 100644
--- a/odb/mysql/database.hxx
+++ b/odb/mysql/database.hxx
@@ -11,7 +11,6 @@
#include <string>
#include <memory> // std::auto_ptr
-#include <odb/shared-ptr.hxx>
#include <odb/database.hxx>
#include <odb/mysql/version.hxx>
@@ -20,6 +19,8 @@
#include <odb/mysql/connection-factory.hxx>
#include <odb/mysql/transaction-impl.hxx>
+#include <odb/details/shared-ptr.hxx>
+
namespace odb
{
namespace mysql
@@ -131,7 +132,7 @@ namespace odb
begin_transaction ();
public:
- shared_ptr<connection_type>
+ details::shared_ptr<connection_type>
connection ();
public:
diff --git a/odb/mysql/database.ixx b/odb/mysql/database.ixx
index 8d927b5..654b8f9 100644
--- a/odb/mysql/database.ixx
+++ b/odb/mysql/database.ixx
@@ -7,7 +7,7 @@ namespace odb
{
namespace mysql
{
- inline shared_ptr<database::connection_type> database::
+ inline details::shared_ptr<database::connection_type> database::
connection ()
{
return factory_->connect ();
diff --git a/odb/mysql/query.cxx b/odb/mysql/query.cxx
index 0caa214..3d7fb68 100644
--- a/odb/mysql/query.cxx
+++ b/odb/mysql/query.cxx
@@ -61,7 +61,7 @@ namespace odb
}
void query::
- add (shared_ptr<query_param> p)
+ add (details::shared_ptr<query_param> p)
{
size_t n (clause_.size ());
diff --git a/odb/mysql/query.hxx b/odb/mysql/query.hxx
index dd7e0cb..b09442c 100644
--- a/odb/mysql/query.hxx
+++ b/odb/mysql/query.hxx
@@ -13,13 +13,13 @@
#include <cstddef> // std::size_t
#include <odb/query.hxx>
-#include <odb/shared-ptr.hxx>
#include <odb/mysql/version.hxx>
#include <odb/mysql/forward.hxx>
#include <odb/mysql/traits.hxx>
#include <odb/details/buffer.hxx>
+#include <odb/details/shared-ptr.hxx>
namespace odb
{
@@ -45,7 +45,7 @@ namespace odb
const T& ref;
};
- struct query_param: shared_base
+ struct query_param: details::shared_base
{
virtual
~query_param ();
@@ -177,10 +177,10 @@ namespace odb
private:
void
- add (shared_ptr<query_param>);
+ add (details::shared_ptr<query_param>);
private:
- typedef std::vector<shared_ptr<query_param> > parameters_type;
+ typedef std::vector<details::shared_ptr<query_param> > parameters_type;
std::string clause_;
parameters_type parameters_;
diff --git a/odb/mysql/query.ixx b/odb/mysql/query.ixx
index 9562bd1..ca4c60c 100644
--- a/odb/mysql/query.ixx
+++ b/odb/mysql/query.ixx
@@ -12,8 +12,8 @@ namespace odb
append (val_bind<T> v)
{
add (
- shared_ptr<query_param> (
- new (shared) query_param_impl<T, ID> (v)));
+ details::shared_ptr<query_param> (
+ new (details::shared) query_param_impl<T, ID> (v)));
}
template <typename T, image_id_type ID>
@@ -21,8 +21,8 @@ namespace odb
append (ref_bind<T> r)
{
add (
- shared_ptr<query_param> (
- new (shared) query_param_impl<T, ID> (r)));
+ details::shared_ptr<query_param> (
+ new (details::shared) query_param_impl<T, ID> (r)));
}
}
}
diff --git a/odb/mysql/result.hxx b/odb/mysql/result.hxx
index 6153f59..f800f15 100644
--- a/odb/mysql/result.hxx
+++ b/odb/mysql/result.hxx
@@ -7,12 +7,13 @@
#define ODB_MYSQL_RESULT_HXX
#include <odb/result.hxx>
-#include <odb/shared-ptr.hxx>
#include <odb/mysql/version.hxx>
#include <odb/mysql/forward.hxx>
#include <odb/mysql/statement.hxx>
+#include <odb/details/shared-ptr.hxx>
+
namespace odb
{
namespace mysql
@@ -28,7 +29,7 @@ namespace odb
virtual
~result_impl ();
- result_impl (shared_ptr<query_statement> statement,
+ result_impl (details::shared_ptr<query_statement> statement,
object_statements<T>& statements);
virtual void
@@ -43,7 +44,7 @@ namespace odb
using odb::result_impl<T>::current;
private:
- shared_ptr<query_statement> statement_;
+ details::shared_ptr<query_statement> statement_;
object_statements<T>& statements_;
};
}
diff --git a/odb/mysql/result.txx b/odb/mysql/result.txx
index d81f058..9bbdf26 100644
--- a/odb/mysql/result.txx
+++ b/odb/mysql/result.txx
@@ -15,7 +15,7 @@ namespace odb
template <typename T>
result_impl<T>::
- result_impl (shared_ptr<query_statement> statement,
+ result_impl (details::shared_ptr<query_statement> statement,
object_statements<T>& statements)
: statement_ (statement), statements_ (statements)
{
diff --git a/odb/mysql/statement.hxx b/odb/mysql/statement.hxx
index 3dd4c28..342897c 100644
--- a/odb/mysql/statement.hxx
+++ b/odb/mysql/statement.hxx
@@ -15,10 +15,11 @@
#include <odb/forward.hxx>
#include <odb/traits.hxx>
-#include <odb/shared-ptr.hxx>
#include <odb/mysql/version.hxx>
+#include <odb/details/shared-ptr.hxx>
+
namespace odb
{
namespace mysql
@@ -42,7 +43,7 @@ namespace odb
binding& operator= (const binding&);
};
- class statement: public shared_base
+ class statement: public details::shared_base
{
public:
virtual
@@ -221,7 +222,7 @@ namespace odb
// Statement cache.
//
- class object_statements_base: public shared_base
+ class object_statements_base: public details::shared_base
{
public:
virtual
@@ -287,7 +288,7 @@ namespace odb
{
if (persist_ == 0)
persist_.reset (
- new (shared) persist_statement_type (
+ new (details::shared) persist_statement_type (
conn_, object_traits::persist_statement, image_binding_));
return *persist_;
@@ -298,7 +299,7 @@ namespace odb
{
if (find_ == 0)
find_.reset (
- new (shared) find_statement_type (
+ new (details::shared) find_statement_type (
conn_,
object_traits::find_statement,
id_image_binding_,
@@ -312,7 +313,7 @@ namespace odb
{
if (store_ == 0)
store_.reset (
- new (shared) store_statement_type (
+ new (details::shared) store_statement_type (
conn_,
object_traits::store_statement,
id_image_binding_,
@@ -326,7 +327,7 @@ namespace odb
{
if (erase_ == 0)
erase_.reset (
- new (shared) erase_statement_type (
+ new (details::shared) erase_statement_type (
conn_,
object_traits::erase_statement,
id_image_binding_));
@@ -351,10 +352,10 @@ namespace odb
id_image_type id_image_;
binding id_image_binding_;
- odb::shared_ptr<persist_statement_type> persist_;
- odb::shared_ptr<find_statement_type> find_;
- odb::shared_ptr<store_statement_type> store_;
- odb::shared_ptr<erase_statement_type> erase_;
+ details::shared_ptr<persist_statement_type> persist_;
+ details::shared_ptr<find_statement_type> find_;
+ details::shared_ptr<store_statement_type> store_;
+ details::shared_ptr<erase_statement_type> erase_;
};
struct type_info_comparator
@@ -391,8 +392,8 @@ namespace odb
if (i != map_.end ())
return static_cast<object_statements<T>&> (*i->second);
- shared_ptr<object_statements<T> > p (
- new (shared) object_statements<T> (conn_));
+ details::shared_ptr<object_statements<T> > p (
+ new (details::shared) object_statements<T> (conn_));
map_.insert (map::value_type (&typeid (T), p));
return *p;
@@ -400,7 +401,7 @@ namespace odb
private:
typedef std::map<const std::type_info*,
- shared_ptr<object_statements_base>,
+ details::shared_ptr<object_statements_base>,
type_info_comparator> map;
connection& conn_;
diff --git a/odb/mysql/transaction-impl.hxx b/odb/mysql/transaction-impl.hxx
index 626ea11..b9df516 100644
--- a/odb/mysql/transaction-impl.hxx
+++ b/odb/mysql/transaction-impl.hxx
@@ -6,12 +6,13 @@
#ifndef ODB_MYSQL_TRANSACTION_IMPL_HXX
#define ODB_MYSQL_TRANSACTION_IMPL_HXX
-#include <odb/shared-ptr.hxx>
#include <odb/transaction.hxx>
#include <odb/mysql/version.hxx>
#include <odb/mysql/forward.hxx>
+#include <odb/details/shared-ptr.hxx>
+
namespace odb
{
namespace mysql
@@ -40,7 +41,7 @@ namespace odb
connection ();
private:
- shared_ptr<connection_type> connection_;
+ details::shared_ptr<connection_type> connection_;
};
}
}