aboutsummaryrefslogtreecommitdiff
path: root/odb/forward.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-11-29 11:32:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-11-29 11:32:43 +0200
commitd5a8a14abbbdb41c753502ea25e2c327ada106f3 (patch)
tree056cc6170f61cf4a4b535f5cc975d872db8601f2 /odb/forward.hxx
parentd5e7059d8741c3a402d76b14209531474421ffac (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.
Diffstat (limited to 'odb/forward.hxx')
-rw-r--r--odb/forward.hxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/odb/forward.hxx b/odb/forward.hxx
index 705acd3..fe23c5f 100644
--- a/odb/forward.hxx
+++ b/odb/forward.hxx
@@ -14,6 +14,19 @@
namespace odb
{
+ // Common and core namespaces. The idea is that you can use the
+ // using directive to get database-independent (common) names or
+ // all core names (core).
+ //
+ namespace common {}
+
+ namespace core
+ {
+ using namespace common;
+ }
+
+ //
+ //
class database;
class connection;
typedef details::shared_ptr<connection> connection_ptr;
@@ -21,6 +34,11 @@ namespace odb
class statement;
class session;
+ namespace common
+ {
+ using odb::session;
+ }
+
namespace core
{
using odb::database;
@@ -28,7 +46,6 @@ namespace odb
using odb::connection_ptr;
using odb::transaction;
using odb::statement;
- using odb::session;
}
// Tracing.
@@ -36,7 +53,7 @@ namespace odb
class tracer; // Not in core.
extern LIBODB_EXPORT tracer& stderr_tracer;
- namespace core
+ namespace common
{
using odb::stderr_tracer;
}