summaryrefslogtreecommitdiff
path: root/odb/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-04-22 14:07:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-04-22 14:07:32 +0200
commit587db8c7ca28d5cd1722307073aa31aed5b89d0a (patch)
treeb5295accedf2cd946d5df22ed5fbfa78290e89dc /odb/context.hxx
parent584f3602038919957f62848a03deb5b5bd9cc9ba (diff)
Initial support for non-polymorphic inheritance
Every class gets a separate table. New test: common/inheritance.
Diffstat (limited to 'odb/context.hxx')
-rw-r--r--odb/context.hxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/odb/context.hxx b/odb/context.hxx
index f08878d..a09d040 100644
--- a/odb/context.hxx
+++ b/odb/context.hxx
@@ -102,6 +102,12 @@ public:
return t.get<semantics::class_*> ("element-type", 0);
}
+ static bool
+ abstract (semantics::class_& c)
+ {
+ return c.count ("abstract");
+ }
+
// Database names and types.
//
public:
@@ -112,7 +118,7 @@ public:
//
struct table_prefix
{
- table_prefix () {}
+ table_prefix (): level (0) {}
table_prefix (string const& p, size_t l): prefix (p), level (l) {}
string prefix;
@@ -174,7 +180,12 @@ public:
out_column_count (semantics::class_&);
static semantics::data_member&
- id_member (semantics::class_&);
+ id_member (semantics::class_& c)
+ {
+ // Set by the validator.
+ //
+ return *c.get<semantics::data_member*> ("id-member");
+ }
// Object pointer information.
//