summaryrefslogtreecommitdiff
path: root/xsd/cxx/tree/stream-extraction-source.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-01-19 11:44:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-01-19 11:44:48 +0200
commit3bf42ed8ccc93a3ff5fdabb9153b887018075acc (patch)
tree19608b70275324a6e49f7f013ddff912b26128d4 /xsd/cxx/tree/stream-extraction-source.cxx
parent4257e28e3bbb92042f5a1db05eba17d7b2a3b151 (diff)
Add support for selective polymorphic in C++/Tree
New options: --polymorphic-type, --polymorphic-type-all.
Diffstat (limited to 'xsd/cxx/tree/stream-extraction-source.cxx')
-rw-r--r--xsd/cxx/tree/stream-extraction-source.cxx19
1 files changed, 9 insertions, 10 deletions
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.
//