// Copyright (C) 2005-2010 Code Synthesis Tools CC // // This program was generated by CodeSynthesis XSD, an XML Schema to // C++ data binding compiler. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // // In addition, as a special exception, Code Synthesis Tools CC gives // permission to link this program with the Xerces-C++ library (or with // modified versions of Xerces-C++ that use the same license as Xerces-C++), // and distribute linked combinations including the two. You must obey // the GNU General Public License version 2 in all respects for all of // the code used other than Xerces-C++. If you modify this copy of the // program, you may extend this exception to your version of the program, // but you are not obligated to do so. If you do not wish to do so, delete // this exception statement from your version. // // Furthermore, Code Synthesis Tools CC makes a special exception for // the Free/Libre and Open Source Software (FLOSS) which is described // in the accompanying FLOSSE file. // // Begin prologue. // // // End prologue. #include #include "gw1-packet-schema.hxx" #include // CommunicationDirection // CommunicationDirection:: CommunicationDirection () : ::xml_schema::type (), Packet_ (::xml_schema::flags (), this), name_ (::xml_schema::flags (), this), abbr_ (::xml_schema::flags (), this) { } CommunicationDirection:: CommunicationDirection (const name_type& name, const abbr_type& abbr) : ::xml_schema::type (), Packet_ (::xml_schema::flags (), this), name_ (name, ::xml_schema::flags (), this), abbr_ (abbr, ::xml_schema::flags (), this) { } CommunicationDirection:: CommunicationDirection (const CommunicationDirection& x, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (x, f, c), Packet_ (x.Packet_, f, this), name_ (x.name_, f, this), abbr_ (x.abbr_, f, this) { } CommunicationDirection:: CommunicationDirection (const ::xercesc::DOMElement& e, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (e, f | ::xml_schema::flags::base, c), Packet_ (f, this), name_ (f, this), abbr_ (f, this) { if ((f & ::xml_schema::flags::base) == 0) { ::xsd::cxx::xml::dom::parser< char > p (e, true, true); this->parse (p, f); } } void CommunicationDirection:: parse (::xsd::cxx::xml::dom::parser< char >& p, ::xml_schema::flags f) { for (; p.more_elements (); p.next_element ()) { const ::xercesc::DOMElement& i (p.cur_element ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (i)); // Packet // if (n.name () == "Packet" && n.namespace_ ().empty ()) { ::std::auto_ptr< Packet_type > r ( Packet_traits::create (i, f, this)); this->Packet_.push_back (r); continue; } break; } while (p.more_attributes ()) { const ::xercesc::DOMAttr& i (p.next_attribute ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (i)); if (n.name () == "name" && n.namespace_ ().empty ()) { ::std::auto_ptr< name_type > r ( name_traits::create (i, f, this)); this->name_.set (r); continue; } if (n.name () == "abbr" && n.namespace_ ().empty ()) { ::std::auto_ptr< abbr_type > r ( abbr_traits::create (i, f, this)); this->abbr_.set (r); continue; } } if (!name_.present ()) { throw ::xsd::cxx::tree::expected_attribute< char > ( "name", ""); } if (!abbr_.present ()) { throw ::xsd::cxx::tree::expected_attribute< char > ( "abbr", ""); } } CommunicationDirection* CommunicationDirection:: _clone (::xml_schema::flags f, ::xml_schema::container* c) const { return new class CommunicationDirection (*this, f, c); } CommunicationDirection:: ~CommunicationDirection () { } // PacketType // PacketType:: PacketType () : ::xml_schema::type (), Info_ (::xml_schema::flags (), this), Field_ (::xml_schema::flags (), this), header_ (::xml_schema::flags (), this) { } PacketType:: PacketType (const header_type& header) : ::xml_schema::type (), Info_ (::xml_schema::flags (), this), Field_ (::xml_schema::flags (), this), header_ (header, ::xml_schema::flags (), this) { } PacketType:: PacketType (const PacketType& x, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (x, f, c), Info_ (x.Info_, f, this), Field_ (x.Field_, f, this), header_ (x.header_, f, this) { } PacketType:: PacketType (const ::xercesc::DOMElement& e, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (e, f | ::xml_schema::flags::base, c), Info_ (f, this), Field_ (f, this), header_ (f, this) { if ((f & ::xml_schema::flags::base) == 0) { ::xsd::cxx::xml::dom::parser< char > p (e, true, true); this->parse (p, f); } } void PacketType:: parse (::xsd::cxx::xml::dom::parser< char >& p, ::xml_schema::flags f) { for (; p.more_elements (); p.next_element ()) { const ::xercesc::DOMElement& i (p.cur_element ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (i)); // Info // if (n.name () == "Info" && n.namespace_ ().empty ()) { ::std::auto_ptr< Info_type > r ( Info_traits::create (i, f, this)); if (!this->Info_) { this->Info_.set (r); continue; } } // Field // if (n.name () == "Field" && n.namespace_ ().empty ()) { ::std::auto_ptr< Field_type > r ( Field_traits::create (i, f, this)); this->Field_.push_back (r); continue; } break; } while (p.more_attributes ()) { const ::xercesc::DOMAttr& i (p.next_attribute ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (i)); if (n.name () == "header" && n.namespace_ ().empty ()) { this->header_.set (header_traits::create (i, f, this)); continue; } } if (!header_.present ()) { throw ::xsd::cxx::tree::expected_attribute< char > ( "header", ""); } } PacketType* PacketType:: _clone (::xml_schema::flags f, ::xml_schema::container* c) const { return new class PacketType (*this, f, c); } PacketType:: ~PacketType () { } // MetaInfo // MetaInfo:: MetaInfo () : ::xml_schema::type (), Name_ (::xml_schema::flags (), this), Description_ (::xml_schema::flags (), this), Author_ (::xml_schema::flags (), this) { } MetaInfo:: MetaInfo (const MetaInfo& x, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (x, f, c), Name_ (x.Name_, f, this), Description_ (x.Description_, f, this), Author_ (x.Author_, f, this) { } MetaInfo:: MetaInfo (const ::xercesc::DOMElement& e, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (e, f | ::xml_schema::flags::base, c), Name_ (f, this), Description_ (f, this), Author_ (f, this) { if ((f & ::xml_schema::flags::base) == 0) { ::xsd::cxx::xml::dom::parser< char > p (e, true, false); this->parse (p, f); } } void MetaInfo:: parse (::xsd::cxx::xml::dom::parser< char >& p, ::xml_schema::flags f) { for (; p.more_elements (); p.next_element ()) { const ::xercesc::DOMElement& i (p.cur_element ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (i)); // Name // if (n.name () == "Name" && n.namespace_ ().empty ()) { ::std::auto_ptr< Name_type > r ( Name_traits::create (i, f, this)); if (!this->Name_) { this->Name_.set (r); continue; } } // Description // if (n.name () == "Description" && n.namespace_ ().empty ()) { ::std::auto_ptr< Description_type > r ( Description_traits::create (i, f, this)); if (!this->Description_) { this->Description_.set (r); continue; } } // Author // if (n.name () == "Author" && n.namespace_ ().empty ()) { ::std::auto_ptr< Author_type > r ( Author_traits::create (i, f, this)); if (!this->Author_) { this->Author_.set (r); continue; } } break; } } MetaInfo* MetaInfo:: _clone (::xml_schema::flags f, ::xml_schema::container* c) const { return new class MetaInfo (*this, f, c); } MetaInfo:: ~MetaInfo () { } // PacketFieldType // PacketFieldType:: PacketFieldType () : ::xml_schema::type (), Info_ (::xml_schema::flags (), this), Field_ (::xml_schema::flags (), this), type_ (::xml_schema::flags (), this), prefixType_ (::xml_schema::flags (), this), static__ (::xml_schema::flags (), this), occurs_ (::xml_schema::flags (), this) { } PacketFieldType:: PacketFieldType (const type_type& type) : ::xml_schema::type (), Info_ (::xml_schema::flags (), this), Field_ (::xml_schema::flags (), this), type_ (type, ::xml_schema::flags (), this), prefixType_ (::xml_schema::flags (), this), static__ (::xml_schema::flags (), this), occurs_ (::xml_schema::flags (), this) { } PacketFieldType:: PacketFieldType (const PacketFieldType& x, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (x, f, c), Info_ (x.Info_, f, this), Field_ (x.Field_, f, this), type_ (x.type_, f, this), prefixType_ (x.prefixType_, f, this), static__ (x.static__, f, this), occurs_ (x.occurs_, f, this) { } PacketFieldType:: PacketFieldType (const ::xercesc::DOMElement& e, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (e, f | ::xml_schema::flags::base, c), Info_ (f, this), Field_ (f, this), type_ (f, this), prefixType_ (f, this), static__ (f, this), occurs_ (f, this) { if ((f & ::xml_schema::flags::base) == 0) { ::xsd::cxx::xml::dom::parser< char > p (e, true, true); this->parse (p, f); } } void PacketFieldType:: parse (::xsd::cxx::xml::dom::parser< char >& p, ::xml_schema::flags f) { for (; p.more_elements (); p.next_element ()) { const ::xercesc::DOMElement& i (p.cur_element ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (i)); // Info // if (n.name () == "Info" && n.namespace_ ().empty ()) { ::std::auto_ptr< Info_type > r ( Info_traits::create (i, f, this)); if (!this->Info_) { this->Info_.set (r); continue; } } // Field // if (n.name () == "Field" && n.namespace_ ().empty ()) { ::std::auto_ptr< Field_type > r ( Field_traits::create (i, f, this)); this->Field_.push_back (r); continue; } break; } while (p.more_attributes ()) { const ::xercesc::DOMAttr& i (p.next_attribute ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (i)); if (n.name () == "type" && n.namespace_ ().empty ()) { ::std::auto_ptr< type_type > r ( type_traits::create (i, f, this)); this->type_.set (r); continue; } if (n.name () == "prefixType" && n.namespace_ ().empty ()) { ::std::auto_ptr< prefixType_type > r ( prefixType_traits::create (i, f, this)); this->prefixType_.set (r); continue; } if (n.name () == "static" && n.namespace_ ().empty ()) { this->static__.set (static_traits::create (i, f, this)); continue; } if (n.name () == "occurs" && n.namespace_ ().empty ()) { this->occurs_.set (occurs_traits::create (i, f, this)); continue; } } if (!type_.present ()) { throw ::xsd::cxx::tree::expected_attribute< char > ( "type", ""); } } PacketFieldType* PacketFieldType:: _clone (::xml_schema::flags f, ::xml_schema::container* c) const { return new class PacketFieldType (*this, f, c); } PacketFieldType:: ~PacketFieldType () { } // PacketSimpleTypes // PacketSimpleTypes:: PacketSimpleTypes (const ::xercesc::DOMElement& e, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::string (e, f, c) { _xsd_PacketSimpleTypes_convert (); } PacketSimpleTypes:: PacketSimpleTypes (const ::xercesc::DOMAttr& a, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::string (a, f, c) { _xsd_PacketSimpleTypes_convert (); } PacketSimpleTypes:: PacketSimpleTypes (const ::std::string& s, const ::xercesc::DOMElement* e, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::string (s, e, f, c) { _xsd_PacketSimpleTypes_convert (); } PacketSimpleTypes* PacketSimpleTypes:: _clone (::xml_schema::flags f, ::xml_schema::container* c) const { return new class PacketSimpleTypes (*this, f, c); } PacketSimpleTypes::value PacketSimpleTypes:: _xsd_PacketSimpleTypes_convert () const { ::xsd::cxx::tree::enum_comparator< char > c (_xsd_PacketSimpleTypes_literals_); const value* i (::std::lower_bound ( _xsd_PacketSimpleTypes_indexes_, _xsd_PacketSimpleTypes_indexes_ + 15, *this, c)); if (i == _xsd_PacketSimpleTypes_indexes_ + 15 || _xsd_PacketSimpleTypes_literals_[*i] != *this) { throw ::xsd::cxx::tree::unexpected_enumerator < char > (*this); } return *i; } const char* const PacketSimpleTypes:: _xsd_PacketSimpleTypes_literals_[15] = { "int8", "int16", "int32", "int64", "packed", "float", "vec2", "vec3", "vec4", "uuid16", "uuid28", "agentid", "ascii", "utf16", "nested" }; const PacketSimpleTypes::value PacketSimpleTypes:: _xsd_PacketSimpleTypes_indexes_[15] = { ::PacketSimpleTypes::agentid, ::PacketSimpleTypes::ascii, ::PacketSimpleTypes::float_, ::PacketSimpleTypes::int16, ::PacketSimpleTypes::int32, ::PacketSimpleTypes::int64, ::PacketSimpleTypes::int8, ::PacketSimpleTypes::nested, ::PacketSimpleTypes::packed, ::PacketSimpleTypes::utf16, ::PacketSimpleTypes::uuid16, ::PacketSimpleTypes::uuid28, ::PacketSimpleTypes::vec2, ::PacketSimpleTypes::vec3, ::PacketSimpleTypes::vec4 }; // Packets // Packets:: Packets () : ::xml_schema::type (), Direction_ (::xml_schema::flags (), this) { } Packets:: Packets (const Packets& x, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (x, f, c), Direction_ (x.Direction_, f, this) { } Packets:: Packets (const ::xercesc::DOMElement& e, ::xml_schema::flags f, ::xml_schema::container* c) : ::xml_schema::type (e, f | ::xml_schema::flags::base, c), Direction_ (f, this) { if ((f & ::xml_schema::flags::base) == 0) { ::xsd::cxx::xml::dom::parser< char > p (e, true, false); this->parse (p, f); } } void Packets:: parse (::xsd::cxx::xml::dom::parser< char >& p, ::xml_schema::flags f) { for (; p.more_elements (); p.next_element ()) { const ::xercesc::DOMElement& i (p.cur_element ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (i)); // Direction // if (n.name () == "Direction" && n.namespace_ ().empty ()) { ::std::auto_ptr< Direction_type > r ( Direction_traits::create (i, f, this)); this->Direction_.push_back (r); continue; } break; } } Packets* Packets:: _clone (::xml_schema::flags f, ::xml_schema::container* c) const { return new class Packets (*this, f, c); } Packets:: ~Packets () { } #include ::std::ostream& operator<< (::std::ostream& o, const CommunicationDirection& i) { for (CommunicationDirection::Packet_const_iterator b (i.Packet ().begin ()), e (i.Packet ().end ()); b != e; ++b) { o << ::std::endl << "Packet: " << *b; } o << ::std::endl << "name: " << i.name (); o << ::std::endl << "abbr: " << i.abbr (); return o; } ::std::ostream& operator<< (::std::ostream& o, const PacketType& i) { if (i.Info ()) { o << ::std::endl << "Info: " << *i.Info (); } for (PacketType::Field_const_iterator b (i.Field ().begin ()), e (i.Field ().end ()); b != e; ++b) { o << ::std::endl << "Field: " << *b; } o << ::std::endl << "header: " << i.header (); return o; } ::std::ostream& operator<< (::std::ostream& o, const MetaInfo& i) { if (i.Name ()) { o << ::std::endl << "Name: " << *i.Name (); } if (i.Description ()) { o << ::std::endl << "Description: " << *i.Description (); } if (i.Author ()) { o << ::std::endl << "Author: " << *i.Author (); } return o; } ::std::ostream& operator<< (::std::ostream& o, const PacketFieldType& i) { if (i.Info ()) { o << ::std::endl << "Info: " << *i.Info (); } for (PacketFieldType::Field_const_iterator b (i.Field ().begin ()), e (i.Field ().end ()); b != e; ++b) { o << ::std::endl << "Field: " << *b; } o << ::std::endl << "type: " << i.type (); if (i.prefixType ()) { o << ::std::endl << "prefixType: " << *i.prefixType (); } if (i.static_ ()) { o << ::std::endl << "static: " << *i.static_ (); } if (i.occurs ()) { o << ::std::endl << "occurs: " << *i.occurs (); } return o; } ::std::ostream& operator<< (::std::ostream& o, PacketSimpleTypes::value i) { return o << PacketSimpleTypes::_xsd_PacketSimpleTypes_literals_[i]; } ::std::ostream& operator<< (::std::ostream& o, const PacketSimpleTypes& i) { return o << static_cast< const ::xml_schema::string& > (i); } ::std::ostream& operator<< (::std::ostream& o, const Packets& i) { for (Packets::Direction_const_iterator b (i.Direction ().begin ()), e (i.Direction ().end ()); b != e; ++b) { o << ::std::endl << "Direction: " << *b; } return o; } #include #include #include ::std::auto_ptr< ::Packets > Packets_ (const ::std::string& u, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xsd::cxx::xml::auto_initializer i ( (f & ::xml_schema::flags::dont_initialize) == 0, (f & ::xml_schema::flags::keep_dom) == 0); ::xsd::cxx::tree::error_handler< char > h; ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::xsd::cxx::xml::dom::parse< char > ( u, h, p, f)); h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > (); ::std::auto_ptr< ::Packets > r ( ::Packets_ ( d, f | ::xml_schema::flags::own_dom, p)); return r; } ::std::auto_ptr< ::Packets > Packets_ (const ::std::string& u, ::xml_schema::error_handler& h, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xsd::cxx::xml::auto_initializer i ( (f & ::xml_schema::flags::dont_initialize) == 0, (f & ::xml_schema::flags::keep_dom) == 0); ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::xsd::cxx::xml::dom::parse< char > ( u, h, p, f)); if (!d.get ()) throw ::xsd::cxx::tree::parsing< char > (); ::std::auto_ptr< ::Packets > r ( ::Packets_ ( d, f | ::xml_schema::flags::own_dom, p)); return r; } ::std::auto_ptr< ::Packets > Packets_ (const ::std::string& u, ::xercesc::DOMErrorHandler& h, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::xsd::cxx::xml::dom::parse< char > ( u, h, p, f)); if (!d.get ()) throw ::xsd::cxx::tree::parsing< char > (); ::std::auto_ptr< ::Packets > r ( ::Packets_ ( d, f | ::xml_schema::flags::own_dom, p)); return r; } ::std::auto_ptr< ::Packets > Packets_ (::std::istream& is, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xsd::cxx::xml::auto_initializer i ( (f & ::xml_schema::flags::dont_initialize) == 0, (f & ::xml_schema::flags::keep_dom) == 0); ::xsd::cxx::xml::sax::std_input_source isrc (is); return ::Packets_ (isrc, f, p); } ::std::auto_ptr< ::Packets > Packets_ (::std::istream& is, ::xml_schema::error_handler& h, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xsd::cxx::xml::auto_initializer i ( (f & ::xml_schema::flags::dont_initialize) == 0, (f & ::xml_schema::flags::keep_dom) == 0); ::xsd::cxx::xml::sax::std_input_source isrc (is); return ::Packets_ (isrc, h, f, p); } ::std::auto_ptr< ::Packets > Packets_ (::std::istream& is, ::xercesc::DOMErrorHandler& h, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xsd::cxx::xml::sax::std_input_source isrc (is); return ::Packets_ (isrc, h, f, p); } ::std::auto_ptr< ::Packets > Packets_ (::std::istream& is, const ::std::string& sid, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xsd::cxx::xml::auto_initializer i ( (f & ::xml_schema::flags::dont_initialize) == 0, (f & ::xml_schema::flags::keep_dom) == 0); ::xsd::cxx::xml::sax::std_input_source isrc (is, sid); return ::Packets_ (isrc, f, p); } ::std::auto_ptr< ::Packets > Packets_ (::std::istream& is, const ::std::string& sid, ::xml_schema::error_handler& h, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xsd::cxx::xml::auto_initializer i ( (f & ::xml_schema::flags::dont_initialize) == 0, (f & ::xml_schema::flags::keep_dom) == 0); ::xsd::cxx::xml::sax::std_input_source isrc (is, sid); return ::Packets_ (isrc, h, f, p); } ::std::auto_ptr< ::Packets > Packets_ (::std::istream& is, const ::std::string& sid, ::xercesc::DOMErrorHandler& h, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xsd::cxx::xml::sax::std_input_source isrc (is, sid); return ::Packets_ (isrc, h, f, p); } ::std::auto_ptr< ::Packets > Packets_ (::xercesc::InputSource& i, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xsd::cxx::tree::error_handler< char > h; ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::xsd::cxx::xml::dom::parse< char > ( i, h, p, f)); h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > (); ::std::auto_ptr< ::Packets > r ( ::Packets_ ( d, f | ::xml_schema::flags::own_dom, p)); return r; } ::std::auto_ptr< ::Packets > Packets_ (::xercesc::InputSource& i, ::xml_schema::error_handler& h, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::xsd::cxx::xml::dom::parse< char > ( i, h, p, f)); if (!d.get ()) throw ::xsd::cxx::tree::parsing< char > (); ::std::auto_ptr< ::Packets > r ( ::Packets_ ( d, f | ::xml_schema::flags::own_dom, p)); return r; } ::std::auto_ptr< ::Packets > Packets_ (::xercesc::InputSource& i, ::xercesc::DOMErrorHandler& h, ::xml_schema::flags f, const ::xml_schema::properties& p) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::xsd::cxx::xml::dom::parse< char > ( i, h, p, f)); if (!d.get ()) throw ::xsd::cxx::tree::parsing< char > (); ::std::auto_ptr< ::Packets > r ( ::Packets_ ( d, f | ::xml_schema::flags::own_dom, p)); return r; } ::std::auto_ptr< ::Packets > Packets_ (const ::xercesc::DOMDocument& d, ::xml_schema::flags f, const ::xml_schema::properties& p) { if (f & ::xml_schema::flags::keep_dom) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > c ( static_cast< ::xercesc::DOMDocument* > (d.cloneNode (true))); ::std::auto_ptr< ::Packets > r ( ::Packets_ ( c, f | ::xml_schema::flags::own_dom, p)); return r; } const ::xercesc::DOMElement& e (*d.getDocumentElement ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (e)); if (n.name () == "Packets" && n.namespace_ () == "") { ::std::auto_ptr< ::Packets > r ( ::xsd::cxx::tree::traits< ::Packets, char >::create ( e, f, 0)); return r; } throw ::xsd::cxx::tree::unexpected_element < char > ( n.name (), n.namespace_ (), "Packets", ""); } ::std::auto_ptr< ::Packets > Packets_ (::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument >& d, ::xml_schema::flags f, const ::xml_schema::properties&) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > c ( ((f & ::xml_schema::flags::keep_dom) && !(f & ::xml_schema::flags::own_dom)) ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (true)) : 0); ::xercesc::DOMDocument& doc (c.get () ? *c : *d); const ::xercesc::DOMElement& e (*doc.getDocumentElement ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (e)); if (f & ::xml_schema::flags::keep_dom) doc.setUserData (::xml_schema::dom::tree_node_key, (c.get () ? &c : &d), 0); if (n.name () == "Packets" && n.namespace_ () == "") { ::std::auto_ptr< ::Packets > r ( ::xsd::cxx::tree::traits< ::Packets, char >::create ( e, f, 0)); return r; } throw ::xsd::cxx::tree::unexpected_element < char > ( n.name (), n.namespace_ (), "Packets", ""); } #include #include #include void Packets_ (::std::ostream& o, const ::Packets& s, const ::xml_schema::namespace_infomap& m, const ::std::string& e, ::xml_schema::flags f) { ::xsd::cxx::xml::auto_initializer i ( (f & ::xml_schema::flags::dont_initialize) == 0); ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::Packets_ (s, m, f)); ::xsd::cxx::tree::error_handler< char > h; ::xsd::cxx::xml::dom::ostream_format_target t (o); if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f)) { h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > (); } } void Packets_ (::std::ostream& o, const ::Packets& s, ::xml_schema::error_handler& h, const ::xml_schema::namespace_infomap& m, const ::std::string& e, ::xml_schema::flags f) { ::xsd::cxx::xml::auto_initializer i ( (f & ::xml_schema::flags::dont_initialize) == 0); ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::Packets_ (s, m, f)); ::xsd::cxx::xml::dom::ostream_format_target t (o); if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f)) { throw ::xsd::cxx::tree::serialization< char > (); } } void Packets_ (::std::ostream& o, const ::Packets& s, ::xercesc::DOMErrorHandler& h, const ::xml_schema::namespace_infomap& m, const ::std::string& e, ::xml_schema::flags f) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::Packets_ (s, m, f)); ::xsd::cxx::xml::dom::ostream_format_target t (o); if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f)) { throw ::xsd::cxx::tree::serialization< char > (); } } void Packets_ (::xercesc::XMLFormatTarget& t, const ::Packets& s, const ::xml_schema::namespace_infomap& m, const ::std::string& e, ::xml_schema::flags f) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::Packets_ (s, m, f)); ::xsd::cxx::tree::error_handler< char > h; if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f)) { h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > (); } } void Packets_ (::xercesc::XMLFormatTarget& t, const ::Packets& s, ::xml_schema::error_handler& h, const ::xml_schema::namespace_infomap& m, const ::std::string& e, ::xml_schema::flags f) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::Packets_ (s, m, f)); if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f)) { throw ::xsd::cxx::tree::serialization< char > (); } } void Packets_ (::xercesc::XMLFormatTarget& t, const ::Packets& s, ::xercesc::DOMErrorHandler& h, const ::xml_schema::namespace_infomap& m, const ::std::string& e, ::xml_schema::flags f) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::Packets_ (s, m, f)); if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f)) { throw ::xsd::cxx::tree::serialization< char > (); } } void Packets_ (::xercesc::DOMDocument& d, const ::Packets& s, ::xml_schema::flags) { ::xercesc::DOMElement& e (*d.getDocumentElement ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (e)); if (n.name () == "Packets" && n.namespace_ () == "") { e << s; } else { throw ::xsd::cxx::tree::unexpected_element < char > ( n.name (), n.namespace_ (), "Packets", ""); } } ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > Packets_ (const ::Packets& s, const ::xml_schema::namespace_infomap& m, ::xml_schema::flags f) { ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d ( ::xsd::cxx::xml::dom::serialize< char > ( "Packets", "", m, f)); ::Packets_ (*d, s, f); return d; } void operator<< (::xercesc::DOMElement& e, const CommunicationDirection& i) { e << static_cast< const ::xml_schema::type& > (i); // Packet // for (CommunicationDirection::Packet_const_iterator b (i.Packet ().begin ()), n (i.Packet ().end ()); b != n; ++b) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "Packet", e)); s << *b; } // name // { ::xercesc::DOMAttr& a ( ::xsd::cxx::xml::dom::create_attribute ( "name", e)); a << i.name (); } // abbr // { ::xercesc::DOMAttr& a ( ::xsd::cxx::xml::dom::create_attribute ( "abbr", e)); a << i.abbr (); } } void operator<< (::xercesc::DOMElement& e, const PacketType& i) { e << static_cast< const ::xml_schema::type& > (i); // Info // if (i.Info ()) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "Info", e)); s << *i.Info (); } // Field // for (PacketType::Field_const_iterator b (i.Field ().begin ()), n (i.Field ().end ()); b != n; ++b) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "Field", e)); s << *b; } // header // { ::xercesc::DOMAttr& a ( ::xsd::cxx::xml::dom::create_attribute ( "header", e)); a << i.header (); } } void operator<< (::xercesc::DOMElement& e, const MetaInfo& i) { e << static_cast< const ::xml_schema::type& > (i); // Name // if (i.Name ()) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "Name", e)); s << *i.Name (); } // Description // if (i.Description ()) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "Description", e)); s << *i.Description (); } // Author // if (i.Author ()) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "Author", e)); s << *i.Author (); } } void operator<< (::xercesc::DOMElement& e, const PacketFieldType& i) { e << static_cast< const ::xml_schema::type& > (i); // Info // if (i.Info ()) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "Info", e)); s << *i.Info (); } // Field // for (PacketFieldType::Field_const_iterator b (i.Field ().begin ()), n (i.Field ().end ()); b != n; ++b) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "Field", e)); s << *b; } // type // { ::xercesc::DOMAttr& a ( ::xsd::cxx::xml::dom::create_attribute ( "type", e)); a << i.type (); } // prefixType // if (i.prefixType ()) { ::xercesc::DOMAttr& a ( ::xsd::cxx::xml::dom::create_attribute ( "prefixType", e)); a << *i.prefixType (); } // static // if (i.static_ ()) { ::xercesc::DOMAttr& a ( ::xsd::cxx::xml::dom::create_attribute ( "static", e)); a << *i.static_ (); } // occurs // if (i.occurs ()) { ::xercesc::DOMAttr& a ( ::xsd::cxx::xml::dom::create_attribute ( "occurs", e)); a << *i.occurs (); } } void operator<< (::xercesc::DOMElement& e, const PacketSimpleTypes& i) { e << static_cast< const ::xml_schema::string& > (i); } void operator<< (::xercesc::DOMAttr& a, const PacketSimpleTypes& i) { a << static_cast< const ::xml_schema::string& > (i); } void operator<< (::xml_schema::list_stream& l, const PacketSimpleTypes& i) { l << static_cast< const ::xml_schema::string& > (i); } void operator<< (::xercesc::DOMElement& e, const Packets& i) { e << static_cast< const ::xml_schema::type& > (i); // Direction // for (Packets::Direction_const_iterator b (i.Direction ().begin ()), n (i.Direction ().end ()); b != n; ++b) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "Direction", e)); s << *b; } } #include // Begin epilogue. // // // End epilogue.