From 3bf42ed8ccc93a3ff5fdabb9153b887018075acc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 Jan 2010 11:44:48 +0200 Subject: Add support for selective polymorphic in C++/Tree New options: --polymorphic-type, --polymorphic-type-all. --- xsd/cxx/tree/stream-extraction-source.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'xsd/cxx/tree/stream-extraction-source.cxx') diff --git a/xsd/cxx/tree/stream-extraction-source.cxx b/xsd/cxx/tree/stream-extraction-source.cxx index c777f30..fe9e31f 100644 --- a/xsd/cxx/tree/stream-extraction-source.cxx +++ b/xsd/cxx/tree/stream-extraction-source.cxx @@ -61,7 +61,7 @@ namespace CXX // Register with type map. // - if (polymorphic && !l.context ().count ("anonymous")) + if (polymorphic && polymorphic_p (l) && !anonymous_p (l)) { // Note that we are using the original type name. // @@ -129,7 +129,7 @@ namespace CXX // Register with type map. // - if (polymorphic && !u.context ().count ("anonymous")) + if (polymorphic && polymorphic_p (u) && !anonymous_p (u)) { // Note that we are using the original type name. // @@ -198,7 +198,7 @@ namespace CXX // Register with type map. // - if (polymorphic && !e.context ().count ("anonymous")) + if (polymorphic && polymorphic_p (e) && !anonymous_p (e)) { // Note that we are using the original type name. // @@ -299,13 +299,12 @@ namespace CXX } // Figure out if we need to generate polymorphic code. If this - // elemen's type is anonymous or mapped to a fundamental C++ - // type then we don't need to do anything. Note that if the type - // is anonymous then it can't be derived from which makes it - // impossible to substitute or dynamically-type with xsi:type. + // elemen's type is anonymous then we don't need to do anything. + // Note that if the type is anonymous then it can't be derived + // from which makes it impossible to substitute or dynamically- + // type with xsi:type. // - Boolean poly (!fund && polymorphic && - !t.context ().count ("anonymous")); + Boolean poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); if (max (e) != 1) { @@ -632,7 +631,7 @@ namespace CXX // Register with type map. // - if (polymorphic && !c.context ().count ("anonymous")) + if (polymorphic && polymorphic_p (c) && !anonymous_p (c)) { // Note that we are using the original type name. // -- cgit v1.1