From 791b94b894f93bc037637907616efc844f3d9414 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Sep 2013 11:11:43 +0200 Subject: Add support for defining composite values inside persistent classes, etc --- odb/include.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'odb/include.cxx') diff --git a/odb/include.cxx b/odb/include.cxx index a6e8c53..cabef1e 100644 --- a/odb/include.cxx +++ b/odb/include.cxx @@ -70,16 +70,28 @@ namespace struct class_: traversal::class_, context { - class_ (include_map& map): main_file_loc_ (0), map_ (map) {} + class_ (include_map& map) + : typedefs_ (true), main_file_loc_ (0), map_ (map) + { + *this >> defines_ >> *this; + *this >> typedefs_ >> *this; + } virtual void traverse (type& c) { + class_kind_type ck (class_kind (c)); + + if (ck == class_other) + return; + + names (c); // Check nested classes. + // We only generate things for objects and composite value types. In // particular, we don't care about views since they cannot be used in // definitions of other views, objects, or composite values. // - if (!(object (c) || composite (c))) + if (ck != class_object && ck != class_composite) return; // Not interested in classes that we are generating. @@ -153,6 +165,9 @@ namespace } private: + traversal::defines defines_; + typedefs typedefs_; + location_t main_file_loc_; include_map& map_; }; -- cgit v1.1