diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-19 08:02:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-19 08:02:03 +0200 |
commit | 986f9dabf1f4cb8a6227658dd7a2a1d9b5365c42 (patch) | |
tree | aa2cf3b198fa051bb8ac2dbbe86629c0adc00e03 /xsde/cxx | |
parent | 8e6bde581d4fb817c7b10d3b2dbaf2b5e0f5dd48 (diff) |
Assign types to the whole inheritance hierarchy in case of tiein
Diffstat (limited to 'xsde/cxx')
-rw-r--r-- | xsde/cxx/serializer/type-processor.cxx | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/xsde/cxx/serializer/type-processor.cxx b/xsde/cxx/serializer/type-processor.cxx index e4efca8..0c2f34e 100644 --- a/xsde/cxx/serializer/type-processor.cxx +++ b/xsde/cxx/serializer/type-processor.cxx @@ -210,6 +210,28 @@ namespace CXX // // + struct BaseHierarchy: Traversal::Complex + { + BaseHierarchy (Serializer::Type& type) + : type_ (type) + { + *this >> inherits_ >> *this; + } + + virtual Void + traverse (SemanticGraph::Complex& c) + { + type_.dispatch (c); + Complex::inherits (c); + } + + private: + Serializer::Type& type_; + Traversal::Inherits inherits_; + }; + + // + // struct GlobalType: Traversal::Type, Traversal::List, Traversal::Complex, @@ -219,7 +241,7 @@ namespace CXX TypeMap::Namespaces& type_map, Boolean add_includes, Boolean tiein) - : type_ (schema, type_map, add_includes) + : type_ (schema, type_map, add_includes), base_hierarchy_ (type_) { inherits_ >> type_; names_ >> instance_ >> belongs_ >> type_; @@ -231,6 +253,11 @@ namespace CXX // members to assign ret/arg types. // inherits_base_ >> base_type_ >> names_; + + // As well as assign ret/arg types to each type in the + // inheritance hierarchy. + // + inherits_base_ >> base_hierarchy_; } } @@ -266,6 +293,7 @@ namespace CXX private: Serializer::Type type_; BaseType base_type_; + BaseHierarchy base_hierarchy_; Traversal::Names names_; Traversal::Instance instance_; Traversal::Inherits inherits_; |