diff options
Diffstat (limited to 'xsde/cxx/hybrid/parser-aggregate-header.cxx')
-rw-r--r-- | xsde/cxx/hybrid/parser-aggregate-header.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/xsde/cxx/hybrid/parser-aggregate-header.cxx b/xsde/cxx/hybrid/parser-aggregate-header.cxx index ce9a786..370cf07 100644 --- a/xsde/cxx/hybrid/parser-aggregate-header.cxx +++ b/xsde/cxx/hybrid/parser-aggregate-header.cxx @@ -580,6 +580,7 @@ namespace CXX String root_parser (unclash (name, "root_parser")); String root_map; String error, reset; + String poly_name; String parser_map, parser_map_entries; InstanceSet set; @@ -606,6 +607,12 @@ namespace CXX set.insert (reset); } + if (poly_runtime) + { + poly_name = unclash (name, "polymorphic"); + set.insert (poly_name); + } + if (poly_code) { parser_map = unclash (name, "parser_map_"); @@ -712,6 +719,17 @@ namespace CXX os << "}"; } + // polymorphic () + // + if (poly_runtime) + { + os << "static bool" << endl + << poly_name << " ()" + << "{" + << "return " << (tid_map.size () > 0 ? "true" : "false") << ";" + << "}"; + } + os << "public:" << endl; for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); @@ -755,6 +773,7 @@ namespace CXX String root_name (unclash (name, "root_name")); String root_namespace (unclash (name, "root_namespace")); String error, reset; + String poly_name; String parser_map, parser_map_entries; InstanceSet set; @@ -784,6 +803,12 @@ namespace CXX set.insert (reset); } + if (poly_runtime) + { + poly_name = unclash (name, "polymorphic"); + set.insert (poly_name); + } + if (poly_code) { parser_map = unclash (name, "parser_map_"); @@ -902,6 +927,17 @@ namespace CXX os << "}"; } + // polymorphic () + // + if (poly_runtime) + { + os << "static bool" << endl + << poly_name << " ()" + << "{" + << "return " << (tid_map.size () > 0 ? "true" : "false") << ";" + << "}"; + } + os << "public:" << endl; for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); |