aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-11-29 11:32:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-11-29 11:32:44 +0200
commit2658e8e14e24a2d9bb57bf82c96421eb4d7a9d71 (patch)
tree043c38a404680bc593dee8f55b7a532f8a38b05a
parentb3826d5ff054deeb7ba22aecb242cec2dca2f93a (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/oracle/connection.hxx1
-rw-r--r--odb/oracle/exceptions.hxx9
-rw-r--r--odb/oracle/forward.hxx16
-rw-r--r--odb/oracle/query.hxx5
-rw-r--r--odb/oracle/statement.hxx3
5 files changed, 31 insertions, 3 deletions
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 <odb/pre.hxx>
-#include <odb/forward.hxx>
#include <odb/connection.hxx>
#include <odb/details/buffer.hxx>
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 <odb/exceptions.hxx>
#include <odb/oracle/version.hxx>
+#include <odb/oracle/forward.hxx>
#include <odb/oracle/oracle-fwd.hxx>
#include <odb/oracle/details/export.hxx>
@@ -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> 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 <string>
#include <cstddef> // std::size_t
-#include <odb/forward.hxx>
#include <odb/statement.hxx>
#include <odb/oracle/version.hxx>
-#include <odb/oracle/binding.hxx>
#include <odb/oracle/forward.hxx>
+#include <odb/oracle/binding.hxx>
#include <odb/oracle/connection.hxx>
#include <odb/oracle/oracle-fwd.hxx>
#include <odb/oracle/auto-handle.hxx>