From 79e1e744a2f306f9c04b0cda3058e9ed40d8421c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Feb 2011 10:42:41 +0200 Subject: Add odb::core namespace to be used in using-directives Port all the examples and tests. --- odb/exception.hxx | 5 +++++ odb/exceptions.hxx | 19 +++++++++++++++++++ odb/forward.hxx | 8 ++++++++ odb/lazy-ptr.hxx | 6 ++++++ odb/query.hxx | 5 +++++ odb/result.hxx | 5 +++++ 6 files changed, 48 insertions(+) (limited to 'odb') diff --git a/odb/exception.hxx b/odb/exception.hxx index 9ffceed..b2bae3d 100644 --- a/odb/exception.hxx +++ b/odb/exception.hxx @@ -19,6 +19,11 @@ namespace odb virtual const char* what () const throw () = 0; }; + + namespace core + { + using odb::exception; + } } #include diff --git a/odb/exceptions.hxx b/odb/exceptions.hxx index d17ebb7..84ec133 100644 --- a/odb/exceptions.hxx +++ b/odb/exceptions.hxx @@ -89,6 +89,25 @@ namespace odb struct LIBODB_EXPORT database_exception: odb::exception { }; + + namespace core + { + using odb::null_pointer; + + using odb::already_in_transaction; + using odb::not_in_transaction; + using odb::transaction_already_finalized; + + using odb::already_in_session; + using odb::not_in_session; + using odb::const_object; + + using odb::deadlock; + using odb::object_not_persistent; + using odb::object_already_persistent; + using odb::result_not_cached; + using odb::database_exception; + } } #include diff --git a/odb/forward.hxx b/odb/forward.hxx index 566b3f0..ec502d2 100644 --- a/odb/forward.hxx +++ b/odb/forward.hxx @@ -12,6 +12,14 @@ namespace odb { class database; class transaction; + class session; + + namespace core + { + using odb::database; + using odb::transaction; + using odb::session; + } // Implementation details. // diff --git a/odb/lazy-ptr.hxx b/odb/lazy-ptr.hxx index 6514d53..9eb8af8 100644 --- a/odb/lazy-ptr.hxx +++ b/odb/lazy-ptr.hxx @@ -186,6 +186,12 @@ namespace odb mutable std::auto_ptr p_; mutable lazy_ptr_impl i_; }; + + namespace core + { + using odb::lazy_ptr; + using odb::lazy_auto_ptr; + } } #include diff --git a/odb/query.hxx b/odb/query.hxx index 5734ba5..5cdeb6f 100644 --- a/odb/query.hxx +++ b/odb/query.hxx @@ -15,6 +15,11 @@ namespace odb template ::query_base_type> class query; + + namespace core + { + using odb::query; + } } #include diff --git a/odb/result.hxx b/odb/result.hxx index ae33cdd..17406e7 100644 --- a/odb/result.hxx +++ b/odb/result.hxx @@ -326,6 +326,11 @@ namespace odb private: details::shared_ptr > impl_; }; + + namespace core + { + using odb::result; + } } #include -- cgit v1.1