From 2658e8e14e24a2d9bb57bf82c96421eb4d7a9d71 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 29 Nov 2012 11:32:44 +0200 Subject: Namespace management for static multi-database support Now in libodb the odb::core namespace is split into odb::common (database- independent stuff) and odb::core proper, which imports odb::common. Each database runtime now defines odb::::core namespace which also imports odb::common and adds the database-specific bits. The overall idea is that one can do using namespace odb::::core just like for odb::core. --- odb/oracle/connection.hxx | 1 - odb/oracle/exceptions.hxx | 9 +++++++++ odb/oracle/forward.hxx | 16 ++++++++++++++++ odb/oracle/query.hxx | 5 +++++ odb/oracle/statement.hxx | 3 +-- 5 files changed, 31 insertions(+), 3 deletions(-) (limited to 'odb') diff --git a/odb/oracle/connection.hxx b/odb/oracle/connection.hxx index 5293b66..d6fb443 100644 --- a/odb/oracle/connection.hxx +++ b/odb/oracle/connection.hxx @@ -7,7 +7,6 @@ #include -#include #include #include diff --git a/odb/oracle/exceptions.hxx b/odb/oracle/exceptions.hxx index 73fb4c5..0173014 100644 --- a/odb/oracle/exceptions.hxx +++ b/odb/oracle/exceptions.hxx @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -106,6 +107,14 @@ namespace odb virtual const char* what () const throw (); }; + + namespace core + { + using oracle::database_exception; + using oracle::lob_comparison; + using oracle::cli_exception; + using oracle::invalid_oci_handle; + } } } diff --git a/odb/oracle/forward.hxx b/odb/oracle/forward.hxx index 24dbf44..e6b73e1 100644 --- a/odb/oracle/forward.hxx +++ b/odb/oracle/forward.hxx @@ -13,6 +13,13 @@ namespace odb { namespace oracle { + namespace core + { + using namespace odb::common; + } + + // + // class database; class connection; typedef details::shared_ptr connection_ptr; @@ -21,6 +28,15 @@ namespace odb class transaction; class tracer; + namespace core + { + using oracle::database; + using oracle::connection; + using oracle::connection_ptr; + using oracle::transaction; + using oracle::statement; + } + // Implementation details. // enum statement_kind diff --git a/odb/oracle/query.hxx b/odb/oracle/query.hxx index 1bf6853..cf35559 100644 --- a/odb/oracle/query.hxx +++ b/odb/oracle/query.hxx @@ -1937,6 +1937,11 @@ namespace odb { } }; + + namespace core + { + using oracle::query; + } } // Derive odb::query from odb::oracle::query so that it can be diff --git a/odb/oracle/statement.hxx b/odb/oracle/statement.hxx index ea08ac0..7b62b86 100644 --- a/odb/oracle/statement.hxx +++ b/odb/oracle/statement.hxx @@ -10,12 +10,11 @@ #include #include // std::size_t -#include #include #include -#include #include +#include #include #include #include -- cgit v1.1