diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-17 11:11:43 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-17 11:11:43 +0200 |
commit | 791b94b894f93bc037637907616efc844f3d9414 (patch) | |
tree | 27b8d92cbe5f7918109842d36484fb4b639a020c /odb/header.cxx | |
parent | 565ad74e164abdaaa31de146a1ef76f3d3f6734d (diff) |
Add support for defining composite values inside persistent classes, etc
Diffstat (limited to 'odb/header.cxx')
-rw-r--r-- | odb/header.cxx | 54 |
1 files changed, 41 insertions, 13 deletions
diff --git a/odb/header.cxx b/odb/header.cxx index 4c58774..fad1668 100644 --- a/odb/header.cxx +++ b/odb/header.cxx @@ -13,19 +13,31 @@ namespace header struct class1: traversal::class_, virtual context { class1 () - : query_columns_type_ (false, true, false), - pointer_query_columns_type_ (true, true, false) {} + : typedefs_ (false), + query_columns_type_ (false, true, false), + pointer_query_columns_type_ (true, true, false) + { + *this >> defines_ >> *this; + *this >> typedefs_ >> *this; + } virtual void traverse (type& c) { - if (!options.at_once () && class_file (c) != unit.file ()) + class_kind_type ck (class_kind (c)); + + if (ck == class_other || + (!options.at_once () && class_file (c) != unit.file ())) return; - if (object (c)) - traverse_object (c); - else if (view (c)) - traverse_view (c); + names (c); + + switch (ck) + { + case class_object: traverse_object (c); break; + case class_view: traverse_view (c); break; + default: break; + } } void @@ -35,6 +47,9 @@ namespace header traverse_view (type&); private: + traversal::defines defines_; + typedefs typedefs_; + instance<query_columns_type> query_columns_type_; instance<query_columns_type> pointer_query_columns_type_; }; @@ -645,22 +660,32 @@ namespace header struct class2: traversal::class_, virtual context { class2 () - : query_columns_type_ (false, true, false), + : typedefs_ (false), + query_columns_type_ (false, true, false), query_columns_type_inst_ (false, false, true), view_query_columns_type_ (true) { + *this >> defines_ >> *this; + *this >> typedefs_ >> *this; } virtual void traverse (type& c) { - if (!options.at_once () && class_file (c) != unit.file ()) + class_kind_type ck (class_kind (c)); + + if (ck == class_other || + (!options.at_once () && class_file (c) != unit.file ())) return; - if (object (c)) - traverse_object (c); - else if (view (c)) - traverse_view (c); + names (c); + + switch (ck) + { + case class_object: traverse_object (c); break; + case class_view: traverse_view (c); break; + default: break; + } } void @@ -670,6 +695,9 @@ namespace header traverse_view (type&); private: + traversal::defines defines_; + typedefs typedefs_; + instance<query_columns_type> query_columns_type_; instance<query_columns_type> query_columns_type_inst_; instance<view_query_columns_type> view_query_columns_type_; |