diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-11-29 11:32:43 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-11-29 11:32:43 +0200 |
commit | 9f0b648c14bbb6dbb1a36c9bd4d88c5773c72ca0 (patch) | |
tree | 1f831fefcf6a5bc6e4a5bfb4113977b61f01bb7f | |
parent | e04895dcc4008a8c0cf53f34ef787a9c686ebcde (diff) |
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::<db>::core namespace which also imports
odb::common and adds the database-specific bits. The overall idea is that
one can do using namespace odb::<db>::core just like for odb::core.
-rw-r--r-- | odb/mssql/connection.hxx | 3 | ||||
-rw-r--r-- | odb/mssql/exceptions.hxx | 10 | ||||
-rw-r--r-- | odb/mssql/forward.hxx | 16 | ||||
-rw-r--r-- | odb/mssql/query.hxx | 5 | ||||
-rw-r--r-- | odb/mssql/statement.hxx | 4 |
5 files changed, 33 insertions, 5 deletions
diff --git a/odb/mssql/connection.hxx b/odb/mssql/connection.hxx index 0451f9b..a1b4541 100644 --- a/odb/mssql/connection.hxx +++ b/odb/mssql/connection.hxx @@ -7,16 +7,15 @@ #include <odb/pre.hxx> -#include <odb/forward.hxx> #include <odb/connection.hxx> #include <odb/details/buffer.hxx> #include <odb/details/shared-ptr.hxx> #include <odb/details/unique-ptr.hxx> -#include <odb/mssql/mssql-fwd.hxx> #include <odb/mssql/version.hxx> #include <odb/mssql/forward.hxx> +#include <odb/mssql/mssql-fwd.hxx> #include <odb/mssql/query.hxx> #include <odb/mssql/tracer.hxx> #include <odb/mssql/transaction-impl.hxx> diff --git a/odb/mssql/exceptions.hxx b/odb/mssql/exceptions.hxx index 1f13948..8e01f4f 100644 --- a/odb/mssql/exceptions.hxx +++ b/odb/mssql/exceptions.hxx @@ -12,8 +12,9 @@ #include <odb/exceptions.hxx> -#include <odb/mssql/mssql-fwd.hxx> #include <odb/mssql/version.hxx> +#include <odb/mssql/forward.hxx> +#include <odb/mssql/mssql-fwd.hxx> #include <odb/mssql/details/export.hxx> namespace odb @@ -113,6 +114,13 @@ namespace odb virtual const char* what () const throw (); }; + + namespace core + { + using mssql::database_exception; + using mssql::cli_exception; + using mssql::long_data_reload; + } } } diff --git a/odb/mssql/forward.hxx b/odb/mssql/forward.hxx index 2a91c62..2bb21e3 100644 --- a/odb/mssql/forward.hxx +++ b/odb/mssql/forward.hxx @@ -13,6 +13,13 @@ namespace odb { namespace mssql { + namespace core + { + using namespace odb::common; + } + + // + // class database; class connection; typedef details::shared_ptr<connection> connection_ptr; @@ -21,6 +28,15 @@ namespace odb class transaction; class tracer; + namespace core + { + using mssql::database; + using mssql::connection; + using mssql::connection_ptr; + using mssql::transaction; + using mssql::statement; + } + // Implementation details. // enum statement_kind diff --git a/odb/mssql/query.hxx b/odb/mssql/query.hxx index 356ed58..d9a84e4 100644 --- a/odb/mssql/query.hxx +++ b/odb/mssql/query.hxx @@ -2376,6 +2376,11 @@ namespace odb { } }; + + namespace core + { + using mssql::query; + } } // Derive odb::query from odb::mssql::query so that it can be diff --git a/odb/mssql/statement.hxx b/odb/mssql/statement.hxx index 53e7c97..4b54097 100644 --- a/odb/mssql/statement.hxx +++ b/odb/mssql/statement.hxx @@ -10,11 +10,11 @@ #include <string> #include <cstddef> // std::size_t -#include <odb/forward.hxx> #include <odb/statement.hxx> -#include <odb/mssql/mssql-fwd.hxx> #include <odb/mssql/version.hxx> +#include <odb/mssql/forward.hxx> +#include <odb/mssql/mssql-fwd.hxx> #include <odb/mssql/binding.hxx> #include <odb/mssql/connection.hxx> #include <odb/mssql/auto-handle.hxx> |