From 587db8c7ca28d5cd1722307073aa31aed5b89d0a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Apr 2011 14:07:32 +0200 Subject: Initial support for non-polymorphic inheritance Every class gets a separate table. New test: common/inheritance. --- odb/common.hxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'odb/common.hxx') 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 () -- cgit v1.1