aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/serializer/generator.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-10-14 12:21:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-10-14 12:21:35 +0200
commitb7197929af1cca15e490703ba3632ae52a348b60 (patch)
treee4ed9dc7cf2021d6ad398fade7fc8148ff982b16 /xsde/cxx/serializer/generator.cxx
parent6f395f9f769866a04f6949cb7ed14f93d90cf728 (diff)
New mapping for anyType with support for polymorphism
Diffstat (limited to 'xsde/cxx/serializer/generator.cxx')
-rw-r--r--xsde/cxx/serializer/generator.cxx392
1 files changed, 196 insertions, 196 deletions
diff --git a/xsde/cxx/serializer/generator.cxx b/xsde/cxx/serializer/generator.cxx
index 36539f4..3366ff4 100644
--- a/xsde/cxx/serializer/generator.cxx
+++ b/xsde/cxx/serializer/generator.cxx
@@ -1201,222 +1201,222 @@ namespace CXX
<< "#define " << guard << endl
<< endl;
- // Copy prologue.
+ // Version check.
//
- hxx << "// Begin prologue." << endl
- << "//" << endl;
+ hxx << "#include <xsde/cxx/version.hxx>" << endl
+ << endl
+ << "#if (XSDE_INT_VERSION != " << XSDE_INT_VERSION << "L)" << endl
+ << "#error XSD/e runtime version mismatch" << endl
+ << "#endif" << endl
+ << endl;
- append (
- hxx, ops.value<CLI::hxx_prologue> (), ops.value<CLI::prologue> ());
- append (hxx, ops.value<CLI::hxx_prologue_file> (), prologue);
+ // Runtime/generated code compatibility checks.
+ //
- hxx << "//" << endl
- << "// End prologue." << endl
+ hxx << "#include <xsde/cxx/config.hxx>" << endl
<< endl;
+ if (ops.value<CLI::char_encoding> () == "iso8859-1")
{
- // Version check.
- //
- hxx << "#include <xsde/cxx/version.hxx>" << endl
- << endl
- << "#if (XSDE_INT_VERSION != " << XSDE_INT_VERSION << "L)" << endl
- << "#error XSD/e runtime version mismatch" << endl
+ hxx << "#ifndef XSDE_ENCODING_ISO8859_1" << endl
+ << "#error the generated code uses the ISO-8859-1 encoding" <<
+ "while the XSD/e runtime does not (reconfigure the runtime " <<
+ "or change the --char-encoding value)" << endl
<< "#endif" << endl
<< endl;
+ }
+ else
+ {
+ hxx << "#ifndef XSDE_ENCODING_UTF8" << endl
+ << "#error the generated code uses the UTF-8 encoding" <<
+ "while the XSD/e runtime does not (reconfigure the runtime " <<
+ "or change the --char-encoding value)" << endl
+ << "#endif" << endl
+ << endl;
+ }
- // Runtime/generated code compatibility checks.
- //
+ if (ops.value<CLI::no_stl> ())
+ {
+ hxx << "#ifdef XSDE_STL" << endl
+ << "#error the XSD/e runtime uses STL while the " <<
+ "generated code does not (reconfigure the runtime or " <<
+ "remove --no-stl)" << endl
+ << "#endif" << endl
+ << endl;
+ }
+ else
+ {
+ hxx << "#ifndef XSDE_STL" << endl
+ << "#error the generated code uses STL while the " <<
+ "XSD/e runtime does not (reconfigure the runtime or " <<
+ "add --no-stl)" << endl
+ << "#endif" << endl
+ << endl;
+ }
- hxx << "#include <xsde/cxx/config.hxx>" << endl
+ if (ops.value<CLI::no_iostream> ())
+ {
+ hxx << "#ifdef XSDE_IOSTREAM" << endl
+ << "#error the XSD/e runtime uses iostream while the " <<
+ "generated code does not (reconfigure the runtime or " <<
+ "remove --no-iostream)" << endl
+ << "#endif" << endl
+ << endl;
+ }
+ else
+ {
+ hxx << "#ifndef XSDE_IOSTREAM" << endl
+ << "#error the generated code uses iostream while the " <<
+ "XSD/e runtime does not (reconfigure the runtime or " <<
+ "add --no-iostream)" << endl
+ << "#endif" << endl
<< endl;
+ }
- if (ops.value<CLI::char_encoding> () == "iso8859-1")
- {
- hxx << "#ifndef XSDE_ENCODING_ISO8859_1" << endl
- << "#error the generated code uses the ISO-8859-1 encoding" <<
- "while the XSD/e runtime does not (reconfigure the runtime " <<
- "or change the --char-encoding value)" << endl
- << "#endif" << endl
- << endl;
- }
- else
- {
- hxx << "#ifndef XSDE_ENCODING_UTF8" << endl
- << "#error the generated code uses the UTF-8 encoding" <<
- "while the XSD/e runtime does not (reconfigure the runtime " <<
- "or change the --char-encoding value)" << endl
- << "#endif" << endl
- << endl;
- }
+ if (ops.value<CLI::no_exceptions> ())
+ {
+ hxx << "#ifdef XSDE_EXCEPTIONS" << endl
+ << "#error the XSD/e runtime uses exceptions while the " <<
+ "generated code does not (reconfigure the runtime or " <<
+ "remove --no-exceptions)" << endl
+ << "#endif" << endl
+ << endl;
+ }
+ else
+ {
+ hxx << "#ifndef XSDE_EXCEPTIONS" << endl
+ << "#error the generated code uses exceptions while the " <<
+ "XSD/e runtime does not (reconfigure the runtime or " <<
+ "add --no-exceptions)" << endl
+ << "#endif" << endl
+ << endl;
+ }
- if (ops.value<CLI::no_stl> ())
- {
- hxx << "#ifdef XSDE_STL" << endl
- << "#error the XSD/e runtime uses STL while the " <<
- "generated code does not (reconfigure the runtime or " <<
- "remove --no-stl)" << endl
- << "#endif" << endl
- << endl;
- }
- else
- {
- hxx << "#ifndef XSDE_STL" << endl
- << "#error the generated code uses STL while the " <<
- "XSD/e runtime does not (reconfigure the runtime or " <<
- "add --no-stl)" << endl
- << "#endif" << endl
- << endl;
- }
+ if (ops.value<CLI::no_long_long> ())
+ {
+ hxx << "#ifdef XSDE_LONGLONG" << endl
+ << "#error the XSD/e runtime uses long long while the " <<
+ "generated code does not (reconfigure the runtime or " <<
+ "remove --no-long-long)" << endl
+ << "#endif" << endl
+ << endl;
+ }
+ else
+ {
+ hxx << "#ifndef XSDE_LONGLONG" << endl
+ << "#error the generated code uses long long while the " <<
+ "XSD/e runtime does not (reconfigure the runtime or " <<
+ "add --no-long-long)" << endl
+ << "#endif" << endl
+ << endl;
+ }
- if (ops.value<CLI::no_iostream> ())
- {
- hxx << "#ifdef XSDE_IOSTREAM" << endl
- << "#error the XSD/e runtime uses iostream while the " <<
- "generated code does not (reconfigure the runtime or " <<
- "remove --no-iostream)" << endl
- << "#endif" << endl
- << endl;
- }
- else
- {
- hxx << "#ifndef XSDE_IOSTREAM" << endl
- << "#error the generated code uses iostream while the " <<
- "XSD/e runtime does not (reconfigure the runtime or " <<
- "add --no-iostream)" << endl
- << "#endif" << endl
- << endl;
- }
+ if (ops.value<CLI::suppress_validation> ())
+ {
+ hxx << "#ifdef XSDE_SERIALIZER_VALIDATION" << endl
+ << "#error the XSD/e runtime uses validation while the " <<
+ "generated code does not (reconfigure the runtime or " <<
+ "remove --suppress-validation)" << endl
+ << "#endif" << endl
+ << endl;
+ }
+ else
+ {
+ hxx << "#ifndef XSDE_SERIALIZER_VALIDATION" << endl
+ << "#error the generated code uses validation while the " <<
+ "XSD/e runtime does not (reconfigure the runtime or " <<
+ "add --suppress-validation)" << endl
+ << "#endif" << endl
+ << endl;
+ }
- if (ops.value<CLI::no_exceptions> ())
- {
- hxx << "#ifdef XSDE_EXCEPTIONS" << endl
- << "#error the XSD/e runtime uses exceptions while the " <<
- "generated code does not (reconfigure the runtime or " <<
- "remove --no-exceptions)" << endl
- << "#endif" << endl
- << endl;
- }
- else
- {
- hxx << "#ifndef XSDE_EXCEPTIONS" << endl
- << "#error the generated code uses exceptions while the " <<
- "XSD/e runtime does not (reconfigure the runtime or " <<
- "add --no-exceptions)" << endl
- << "#endif" << endl
- << endl;
- }
+ if (ops.value<CLI::generate_polymorphic> () ||
+ ops.value<CLI::runtime_polymorphic> ())
+ {
+ hxx << "#ifndef XSDE_POLYMORPHIC" << endl
+ << "#error the generated code expects XSD/e runtime with " <<
+ "polymorphism support (reconfigure the runtime or remove " <<
+ "--generate-polymorphic/--runtime-polymorphic)" << endl
+ << "#endif" << endl
+ << endl;
+ }
+ else
+ {
+ hxx << "#ifdef XSDE_POLYMORPHIC" << endl
+ << "#error the generated code expects XSD/e runtime " <<
+ "without polymorphism support (reconfigure the runtime or " <<
+ "add --generate-polymorphic/--runtime-polymorphic)" << endl
+ << "#endif" << endl
+ << endl;
+ }
- if (ops.value<CLI::no_long_long> ())
- {
- hxx << "#ifdef XSDE_LONGLONG" << endl
- << "#error the XSD/e runtime uses long long while the " <<
- "generated code does not (reconfigure the runtime or " <<
- "remove --no-long-long)" << endl
- << "#endif" << endl
- << endl;
- }
- else
- {
- hxx << "#ifndef XSDE_LONGLONG" << endl
- << "#error the generated code uses long long while the " <<
- "XSD/e runtime does not (reconfigure the runtime or " <<
- "add --no-long-long)" << endl
- << "#endif" << endl
- << endl;
- }
+ if (ops.value<CLI::reuse_style_mixin> ())
+ {
+ hxx << "#ifndef XSDE_REUSE_STYLE_MIXIN" << endl
+ << "#error the generated code uses the mixin reuse style " <<
+ "while the XSD/e runtime does not (reconfigure the runtime " <<
+ "or remove --reuse-style-mixin)" << endl
+ << "#endif" << endl
+ << endl;
+ }
+ else if (ops.value<CLI::reuse_style_none> ())
+ {
+ hxx << "#ifndef XSDE_REUSE_STYLE_NONE" << endl
+ << "#error the generated code does not provide support " <<
+ "for serializer reuse while the XSD/e runtime does (" <<
+ "reconfigure the runtime or remove --reuse-style-none)" << endl
+ << "#endif" << endl
+ << endl;
+ }
+ else
+ {
+ hxx << "#ifndef XSDE_REUSE_STYLE_TIEIN" << endl
+ << "#error the generated code uses the tiein reuse style " <<
+ "while the XSD/e runtime does not (reconfigure the runtime " <<
+ "or add --reuse-style-mixin or --reuse-style-none)" << endl
+ << "#endif" << endl
+ << endl;
+ }
- if (ops.value<CLI::suppress_validation> ())
- {
- hxx << "#ifdef XSDE_SERIALIZER_VALIDATION" << endl
- << "#error the XSD/e runtime uses validation while the " <<
- "generated code does not (reconfigure the runtime or " <<
- "remove --suppress-validation)" << endl
- << "#endif" << endl
- << endl;
- }
- else
- {
- hxx << "#ifndef XSDE_SERIALIZER_VALIDATION" << endl
- << "#error the generated code uses validation while the " <<
- "XSD/e runtime does not (reconfigure the runtime or " <<
- "add --suppress-validation)" << endl
- << "#endif" << endl
- << endl;
- }
+ if (ops.value<CLI::custom_allocator> ())
+ {
+ hxx << "#ifndef XSDE_CUSTOM_ALLOCATOR" << endl
+ << "#error the generated code uses custom allocator while " <<
+ "the XSD/e runtime does not (reconfigure the runtime or " <<
+ "remove --custom-allocator)" << endl
+ << "#endif" << endl
+ << endl;
+ }
+ else
+ {
+ hxx << "#ifdef XSDE_CUSTOM_ALLOCATOR" << endl
+ << "#error the XSD/e runtime uses custom allocator while " <<
+ "the generated code does not (reconfigure the runtime or " <<
+ "add --custom-allocator)" << endl
+ << "#endif" << endl
+ << endl;
+ }
- if (ops.value<CLI::generate_polymorphic> () ||
- ops.value<CLI::runtime_polymorphic> ())
- {
- hxx << "#ifndef XSDE_POLYMORPHIC" << endl
- << "#error the generated code expects XSD/e runtime with " <<
- "polymorphism support (reconfigure the runtime or remove " <<
- "--generate-polymorphic/--runtime-polymorphic)" << endl
- << "#endif" << endl
- << endl;
- }
- else
- {
- hxx << "#ifdef XSDE_POLYMORPHIC" << endl
- << "#error the generated code expects XSD/e runtime " <<
- "without polymorphism support (reconfigure the runtime or " <<
- "add --generate-polymorphic/--runtime-polymorphic)" << endl
- << "#endif" << endl
- << endl;
- }
+ //
+ //
- if (ops.value<CLI::reuse_style_mixin> ())
- {
- hxx << "#ifndef XSDE_REUSE_STYLE_MIXIN" << endl
- << "#error the generated code uses the mixin reuse style " <<
- "while the XSD/e runtime does not (reconfigure the runtime " <<
- "or remove --reuse-style-mixin)" << endl
- << "#endif" << endl
- << endl;
- }
- else if (ops.value<CLI::reuse_style_none> ())
- {
- hxx << "#ifndef XSDE_REUSE_STYLE_NONE" << endl
- << "#error the generated code does not provide support " <<
- "for serializer reuse while the XSD/e runtime does (" <<
- "reconfigure the runtime or remove --reuse-style-none)" << endl
- << "#endif" << endl
- << endl;
- }
- else
- {
- hxx << "#ifndef XSDE_REUSE_STYLE_TIEIN" << endl
- << "#error the generated code uses the tiein reuse style " <<
- "while the XSD/e runtime does not (reconfigure the runtime " <<
- "or add --reuse-style-mixin or --reuse-style-none)" << endl
- << "#endif" << endl
- << endl;
- }
+ hxx << "#include <xsde/cxx/pre.hxx>" << endl
+ << endl;
- if (ops.value<CLI::custom_allocator> ())
- {
- hxx << "#ifndef XSDE_CUSTOM_ALLOCATOR" << endl
- << "#error the generated code uses custom allocator while " <<
- "the XSD/e runtime does not (reconfigure the runtime or " <<
- "remove --custom-allocator)" << endl
- << "#endif" << endl
- << endl;
- }
- else
- {
- hxx << "#ifdef XSDE_CUSTOM_ALLOCATOR" << endl
- << "#error the XSD/e runtime uses custom allocator while " <<
- "the generated code does not (reconfigure the runtime or " <<
- "add --custom-allocator)" << endl
- << "#endif" << endl
- << endl;
- }
+ // Copy prologue.
+ //
+ hxx << "// Begin prologue." << endl
+ << "//" << endl;
- //
- //
+ append (
+ hxx, ops.value<CLI::hxx_prologue> (), ops.value<CLI::prologue> ());
+ append (hxx, ops.value<CLI::hxx_prologue_file> (), prologue);
- hxx << "#include <xsde/cxx/pre.hxx>" << endl
- << endl;
+ hxx << "//" << endl
+ << "// End prologue." << endl
+ << endl;
+ {
// Set auto-indentation.
//
Indentation::Clip<Indentation::CXX, WideChar> hxx_clip (hxx);
@@ -1432,9 +1432,6 @@ namespace CXX
if (inline_)
hxx << "#include " << ctx.process_include_path (ixx_name) << endl
<< endl;
-
- hxx << "#include <xsde/cxx/post.hxx>" << endl
- << endl;
}
// Copy epilogue.
@@ -1450,6 +1447,9 @@ namespace CXX
<< "// End epilogue." << endl
<< endl;
+ hxx << "#include <xsde/cxx/post.hxx>" << endl
+ << endl;
+
hxx << "#endif // " << guard << endl;
if (show_sloc)