diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-03-08 17:23:30 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-03-08 17:23:30 +0200 |
commit | 0bce70a0e483294b83b8bf9d5468838a63405612 (patch) | |
tree | d11afb4998d6980435c15c4df6e40b1979531672 /xsde/cxx/hybrid/tree-forward.cxx | |
parent | 6c63b913179127e09ed7d9da8920493ccceec6ce (diff) |
Add support for binary representations
xsde/cxx/hybrid/insertion-*: insertion operators generator
xsde/cxx/hybrid/extraction-*: extraction operators generator
libxsde/xsde/cxx/hybrid/cdr/: CDR support code
libxsde/xsde/cxx/hybrid/xdr/: XDR support code
tests/cxx/hybrid/binary/: new tests
examples/cxx/hybrid/binary/: new examples
documentation/cxx/hybrid/guide/: new chapter
Diffstat (limited to 'xsde/cxx/hybrid/tree-forward.cxx')
-rw-r--r-- | xsde/cxx/hybrid/tree-forward.cxx | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/xsde/cxx/hybrid/tree-forward.cxx b/xsde/cxx/hybrid/tree-forward.cxx index f1c0dfa..32f1180 100644 --- a/xsde/cxx/hybrid/tree-forward.cxx +++ b/xsde/cxx/hybrid/tree-forward.cxx @@ -415,6 +415,7 @@ namespace CXX virtual Void traverse (SemanticGraph::Fundamental::Base64Binary&) { + gen_using ("::xsde::cxx::buffer"); gen_typedef ("base64_binary", "::xsde::cxx::buffer"); } @@ -431,6 +432,7 @@ namespace CXX virtual Void traverse (SemanticGraph::Fundamental::Date&) { + gen_using ("::xsde::cxx::time_zone"); gen_using ("::xsde::cxx::date"); } @@ -534,6 +536,66 @@ namespace CXX << "using ::xsde::cxx::strndupx;"; } + // sequences + // + os << endl + << "using ::xsde::cxx::hybrid::pod_seq;" + << "using ::xsde::cxx::hybrid::fix_seq;" + << "using ::xsde::cxx::hybrid::var_seq;" + << "using ::xsde::cxx::hybrid::str_seq;" + << "using ::xsde::cxx::hybrid::data_seq;"; + + // Data representation stream types. + // + Boolean icdr (false), ocdr (false); + Boolean ixdr (false), oxdr (false); + + for (Streams::ConstIterator i (istreams.begin ()); + i != istreams.end (); ++i) + { + if (*i == "CDR") + icdr = true; + else if (*i == "XDR") + ixdr = true; + } + + for (Streams::ConstIterator i (ostreams.begin ()); + i != ostreams.end (); ++i) + { + if (*i == "CDR") + ocdr = true; + else if (*i == "XDR") + oxdr = true; + } + + if (icdr || ocdr) + { + os << endl; + + if (exceptions) + os << "using ::xsde::cxx::hybrid::cdr_exception;"; + + if (icdr) + os << "using ::xsde::cxx::hybrid::icdrstream;"; + + if (ocdr) + os << "using ::xsde::cxx::hybrid::ocdrstream;"; + } + + if (ixdr || oxdr) + { + os << endl; + + if (exceptions) + os << "using ::xsde::cxx::hybrid::xdr_exception;"; + + if (ixdr) + os << "using ::xsde::cxx::hybrid::ixdrstream;"; + + if (oxdr) + os << "using ::xsde::cxx::hybrid::oxdrstream;"; + } + post (ns); } }; @@ -561,8 +623,33 @@ namespace CXX ctx.os << "#include <xsde/cxx/strdupx.hxx>" << endl; ctx.os << "#include <xsde/cxx/hybrid/xml-schema.hxx>" << endl + << "#include <xsde/cxx/hybrid/sequence.hxx>" << endl << endl; + // Data representation stream includes. + // + for (Context::Streams::ConstIterator i (ctx.istreams.begin ()); + i != ctx.istreams.end (); ++i) + { + if (*i == "CDR") + ctx.os << "#include <xsde/cxx/hybrid/cdr/istream.hxx>" << endl + << endl; + else if (*i == "XDR") + ctx.os << "#include <xsde/cxx/hybrid/xdr/istream.hxx>" << endl + << endl; + } + + for (Context::Streams::ConstIterator i (ctx.ostreams.begin ()); + i != ctx.ostreams.end (); ++i) + { + if (*i == "CDR") + ctx.os << "#include <xsde/cxx/hybrid/cdr/ostream.hxx>" << endl + << endl; + else if (*i == "XDR") + ctx.os << "#include <xsde/cxx/hybrid/xdr/ostream.hxx>" << endl + << endl; + } + if (generate_xml_schema) { Traversal::Schema schema; |