aboutsummaryrefslogtreecommitdiff
path: root/odb/common.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/common.hxx
parent584f3602038919957f62848a03deb5b5bd9cc9ba (diff)
Initial support for non-polymorphic inheritance
Every class gets a separate table. New test: common/inheritance.
Diffstat (limited to 'odb/common.hxx')
-rw-r--r--odb/common.hxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/odb/common.hxx b/odb/common.hxx
index f0c2d5a..2d220b8 100644
--- a/odb/common.hxx
+++ b/odb/common.hxx
@@ -93,7 +93,8 @@ private:
traversal::inherits inherits_;
};
-// Traverse object columns recursively by going into composite members.
+// Traverse object columns recursively by going into composite members
+// and bases.
//
struct object_columns_base: traversal::class_, virtual context
{
@@ -103,12 +104,20 @@ struct object_columns_base: traversal::class_, virtual context
virtual bool
column (semantics::data_member&, std::string const& name, bool first) = 0;
- // If you override this function, always call the base. The second argument
- // is the actual composite type, which is not necessarily the same as
- // m.type ().
+ // If you override this function, you can call the base to traverse
+ // bases and members. The first argument is the data member and can
+ // be NULL if we are traversing the root type or a base. The second
+ // argument is the actual composite type, which is not necessarily
+ // the same as m.type ().
//
virtual void
- composite (semantics::data_member&, semantics::class_&);
+ composite (semantics::data_member*, semantics::class_&);
+
+ // If you override this function, you can call the base to traverse
+ // bases and members.
+ //
+ virtual void
+ object (semantics::class_&);
// Called after the last column, provided at least one column hasn't
// been ignored.
@@ -139,7 +148,6 @@ public:
semantics::class_&,
std::string const& key_prefix,
std::string const& default_name);
-
private:
void
init ()