Hermes2D  3.0
mesh_h1d_xml.cpp
1 // Copyright (C) 2005-2010 Code Synthesis Tools CC
2 //
3 // This program was generated by CodeSynthesis XSD, an XML Schema to
4 // C++ data binding compiler.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License version 2 as
8 // published by the Free Software Foundation.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 //
19 // In addition, as a special exception, Code Synthesis Tools CC gives
20 // permission to link this program with the Xerces-C++ library (or with
21 // modified versions of Xerces-C++ that use the same license as Xerces-C++),
22 // and distribute linked combinations including the two. You must obey
23 // the GNU General Public License version 2 in all respects for all of
24 // the code used other than Xerces-C++. If you modify this copy of the
25 // program, you may extend this exception to your version of the program,
26 // but you are not obligated to do so. If you do not wish to do so, delete
27 // this exception statement from your version.
28 //
29 // Furthermore, Code Synthesis Tools CC makes a special exception for
30 // the Free/Libre and Open Source Software (FLOSS) which is described
31 // in the accompanying FLOSSE file.
32 //
33 
34 // Begin prologue.
35 //
36 //
37 // End prologue.
38 
39 #include <xsd/cxx/pre.hxx>
40 
41 #include "mesh_h1d_xml.h"
42 
43 namespace XMLMesh1D
44 {
45  // variables_type
46  //
47 
49  var () const
50  {
51  return this->var_;
52  }
53 
55  var ()
56  {
57  return this->var_;
58  }
59 
60  void variables_type::
61  var (const var_sequence& s)
62  {
63  this->var_ = s;
64  }
65 
66 
67  // mesh
68  //
69 
71  variables () const
72  {
73  return this->variables_;
74  }
75 
78  {
79  return this->variables_;
80  }
81 
82  void mesh::
84  {
85  this->variables_.set (x);
86  }
87 
88  void mesh::
90  {
91  this->variables_ = x;
92  }
93 
94  void mesh::
95  variables (::std::auto_ptr< variables_type > x)
96  {
97  this->variables_.set (x);
98  }
99 
100  const mesh::v_sequence& mesh::
101  v () const
102  {
103  return this->v_;
104  }
105 
107  v ()
108  {
109  return this->v_;
110  }
111 
112  void mesh::
113  v (const v_sequence& s)
114  {
115  this->v_ = s;
116  }
117 
118 
119  // var
120  //
121 
122  const var::name_type& var::
123  name () const
124  {
125  return this->name_.get ();
126  }
127 
130  {
131  return this->name_.get ();
132  }
133 
134  void var::
135  name (const name_type& x)
136  {
137  this->name_.set (x);
138  }
139 
140  void var::
141  name (::std::auto_ptr< name_type > x)
142  {
143  this->name_.set (x);
144  }
145 
146  const var::value_type& var::
147  value () const
148  {
149  return this->value_.get ();
150  }
151 
154  {
155  return this->value_.get ();
156  }
157 
158  void var::
159  value (const value_type& x)
160  {
161  this->value_.set (x);
162  }
163 
164 
165  // v
166  //
167 
168  const v::x_type& v::
169  x () const
170  {
171  return this->x_.get ();
172  }
173 
174  v::x_type& v::
175  x ()
176  {
177  return this->x_.get ();
178  }
179 
180  void v::
181  x (const x_type& x)
182  {
183  this->x_.set (x);
184  }
185 
186  void v::
187  x (::std::auto_ptr< x_type > x)
188  {
189  this->x_.set (x);
190  }
191 
192  const v::m_optional& v::
193  m () const
194  {
195  return this->m_;
196  }
197 
199  m ()
200  {
201  return this->m_;
202  }
203 
204  void v::
205  m (const m_type& x)
206  {
207  this->m_.set (x);
208  }
209 
210  void v::
211  m (const m_optional& x)
212  {
213  this->m_ = x;
214  }
215 
216  void v::
217  m (::std::auto_ptr< m_type > x)
218  {
219  this->m_.set (x);
220  }
221 }
222 
223 #include <xsd/cxx/xml/dom/parsing-source.hxx>
224 
225 #include <xsd/cxx/tree/type-factory-map.hxx>
226 
227 namespace _xsd
228 {
229  static
230  const ::xsd::cxx::tree::type_factory_plate< 0, char >
231  type_factory_plate_init;
232 }
233 
234 namespace XMLMesh1D
235 {
236  // variables_type
237  //
238 
241  : ::xml_schema::type (),
242  var_ (::xml_schema::flags (), this)
243  {
244  }
245 
248  ::xml_schema::flags f,
250  : ::xml_schema::type (x, f, c),
251  var_ (x.var_, f, this)
252  {
253  }
254 
256  variables_type (const ::xercesc::DOMElement& e,
257  ::xml_schema::flags f,
259  : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
260  var_ (f, this)
261  {
262  if ((f & ::xml_schema::flags::base) == 0)
263  {
264  ::xsd::cxx::xml::dom::parser< char > p (e, true, false);
265  this->parse (p, f);
266  }
267  }
268 
269  void variables_type::
270  parse (::xsd::cxx::xml::dom::parser< char >& p,
271  ::xml_schema::flags f)
272  {
273  for (; p.more_elements (); p.next_element ())
274  {
275  const ::xercesc::DOMElement& i (p.cur_element ());
276  const ::xsd::cxx::xml::qualified_name< char > n (
277  ::xsd::cxx::xml::dom::name< char > (i));
278 
279  // var
280  //
281  if (n.name () == "var" && n.namespace_ ().empty ())
282  {
283  ::std::auto_ptr< var_type > r (
284  var_traits::create (i, f, this));
285 
286  this->var_.push_back (r);
287  continue;
288  }
289 
290  break;
291  }
292  }
293 
294  variables_type* variables_type::
296  ::xml_schema::container* c) const
297  {
298  return new class variables_type (*this, f, c);
299  }
300 
303  {
304  }
305 
306  // mesh
307  //
308 
309  mesh::
311  : ::xml_schema::type (),
312  variables_ (::xml_schema::flags (), this),
313  v_ (::xml_schema::flags (), this)
314  {
315  }
316 
317  mesh::
318  mesh (const mesh& x,
319  ::xml_schema::flags f,
321  : ::xml_schema::type (x, f, c),
322  variables_ (x.variables_, f, this),
323  v_ (x.v_, f, this)
324  {
325  }
326 
327  mesh::
328  mesh (const ::xercesc::DOMElement& e,
329  ::xml_schema::flags f,
331  : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
332  variables_ (f, this),
333  v_ (f, this)
334  {
335  if ((f & ::xml_schema::flags::base) == 0)
336  {
337  ::xsd::cxx::xml::dom::parser< char > p (e, true, false);
338  this->parse (p, f);
339  }
340  }
341 
342  void mesh::
343  parse (::xsd::cxx::xml::dom::parser< char >& p,
344  ::xml_schema::flags f)
345  {
346  for (; p.more_elements (); p.next_element ())
347  {
348  const ::xercesc::DOMElement& i (p.cur_element ());
349  const ::xsd::cxx::xml::qualified_name< char > n (
350  ::xsd::cxx::xml::dom::name< char > (i));
351 
352  // variables
353  //
354  if (n.name () == "variables" && n.namespace_ ().empty ())
355  {
356  ::std::auto_ptr< variables_type > r (
357  variables_traits::create (i, f, this));
358 
359  if (!this->variables_)
360  {
361  this->variables_.set (r);
362  continue;
363  }
364  }
365 
366  // v
367  //
368  if (n.name () == "v" && n.namespace_ ().empty ())
369  {
370  ::std::auto_ptr< v_type > r (
371  v_traits::create (i, f, this));
372 
373  this->v_.push_back (r);
374  continue;
375  }
376 
377  break;
378  }
379  }
380 
381  mesh* mesh::
383  ::xml_schema::container* c) const
384  {
385  return new class mesh (*this, f, c);
386  }
387 
388  mesh::
390  {
391  }
392 
393  // var
394  //
395 
396  var::
398  const value_type& value)
399  : ::xml_schema::type (),
400  name_ (name, ::xml_schema::flags (), this),
401  value_ (value, ::xml_schema::flags (), this)
402  {
403  }
404 
405  var::
406  var (const var& x,
407  ::xml_schema::flags f,
409  : ::xml_schema::type (x, f, c),
410  name_ (x.name_, f, this),
411  value_ (x.value_, f, this)
412  {
413  }
414 
415  var::
416  var (const ::xercesc::DOMElement& e,
417  ::xml_schema::flags f,
419  : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
420  name_ (f, this),
421  value_ (f, this)
422  {
423  if ((f & ::xml_schema::flags::base) == 0)
424  {
425  ::xsd::cxx::xml::dom::parser< char > p (e, false, true);
426  this->parse (p, f);
427  }
428  }
429 
430  void var::
431  parse (::xsd::cxx::xml::dom::parser< char >& p,
432  ::xml_schema::flags f)
433  {
434  while (p.more_attributes ())
435  {
436  const ::xercesc::DOMAttr& i (p.next_attribute ());
437  const ::xsd::cxx::xml::qualified_name< char > n (
438  ::xsd::cxx::xml::dom::name< char > (i));
439 
440  if (n.name () == "name" && n.namespace_ ().empty ())
441  {
442  ::std::auto_ptr< name_type > r (
443  name_traits::create (i, f, this));
444 
445  this->name_.set (r);
446  continue;
447  }
448 
449  if (n.name () == "value" && n.namespace_ ().empty ())
450  {
451  this->value_.set (value_traits::create (i, f, this));
452  continue;
453  }
454  }
455 
456  if (!name_.present ())
457  {
458  throw ::xsd::cxx::tree::expected_attribute< char > (
459  "name",
460  "");
461  }
462 
463  if (!value_.present ())
464  {
465  throw ::xsd::cxx::tree::expected_attribute< char > (
466  "value",
467  "");
468  }
469  }
470 
471  var* var::
473  ::xml_schema::container* c) const
474  {
475  return new class var (*this, f, c);
476  }
477 
478  var::
480  {
481  }
482 
483  // v
484  //
485 
486  v::
487  v (const x_type& x)
488  : ::xml_schema::type (),
489  x_ (x, ::xml_schema::flags (), this),
490  m_ (::xml_schema::flags (), this)
491  {
492  }
493 
494  v::
495  v (const v& x,
496  ::xml_schema::flags f,
498  : ::xml_schema::type (x, f, c),
499  x_ (x.x_, f, this),
500  m_ (x.m_, f, this)
501  {
502  }
503 
504  v::
505  v (const ::xercesc::DOMElement& e,
506  ::xml_schema::flags f,
508  : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
509  x_ (f, this),
510  m_ (f, this)
511  {
512  if ((f & ::xml_schema::flags::base) == 0)
513  {
514  ::xsd::cxx::xml::dom::parser< char > p (e, false, true);
515  this->parse (p, f);
516  }
517  }
518 
519  void v::
520  parse (::xsd::cxx::xml::dom::parser< char >& p,
521  ::xml_schema::flags f)
522  {
523  while (p.more_attributes ())
524  {
525  const ::xercesc::DOMAttr& i (p.next_attribute ());
526  const ::xsd::cxx::xml::qualified_name< char > n (
527  ::xsd::cxx::xml::dom::name< char > (i));
528 
529  if (n.name () == "x" && n.namespace_ ().empty ())
530  {
531  ::std::auto_ptr< x_type > r (
532  x_traits::create (i, f, this));
533 
534  this->x_.set (r);
535  continue;
536  }
537 
538  if (n.name () == "m" && n.namespace_ ().empty ())
539  {
540  ::std::auto_ptr< m_type > r (
541  m_traits::create (i, f, this));
542 
543  this->m_.set (r);
544  continue;
545  }
546  }
547 
548  if (!x_.present ())
549  {
550  throw ::xsd::cxx::tree::expected_attribute< char > (
551  "x",
552  "");
553  }
554  }
555 
556  v* v::
558  ::xml_schema::container* c) const
559  {
560  return new class v (*this, f, c);
561  }
562 
563  v::
564  ~v ()
565  {
566  }
567 }
568 
569 #include <ostream>
570 
571 #include <xsd/cxx/tree/std-ostream-map.hxx>
572 
573 namespace _xsd
574 {
575  static
576  const ::xsd::cxx::tree::std_ostream_plate< 0, char >
577  std_ostream_plate_init;
578 }
579 
580 namespace XMLMesh1D
581 {
582  ::std::ostream&
583  operator<< (::std::ostream& o, const variables_type& i)
584  {
586  b (i.var ().begin ()), e (i.var ().end ());
587  b != e; ++b)
588  {
589  o << ::std::endl << "var: " << *b;
590  }
591 
592  return o;
593  }
594 
595  ::std::ostream&
596  operator<< (::std::ostream& o, const mesh& i)
597  {
598  if (i.variables ())
599  {
600  o << ::std::endl << "variables: " << *i.variables ();
601  }
602 
604  b (i.v ().begin ()), e (i.v ().end ());
605  b != e; ++b)
606  {
607  o << ::std::endl << "v: " << *b;
608  }
609 
610  return o;
611  }
612 
613  ::std::ostream&
614  operator<< (::std::ostream& o, const var& i)
615  {
616  o << ::std::endl << "name: " << i.name ();
617  o << ::std::endl << "value: " << i.value ();
618  return o;
619  }
620 
621  ::std::ostream&
622  operator<< (::std::ostream& o, const v& i)
623  {
624  o << ::std::endl << "x: " << i.x ();
625  if (i.m ())
626  {
627  o << ::std::endl << "m: " << *i.m ();
628  }
629 
630  return o;
631  }
632 }
633 
634 #include <istream>
635 #include <xsd/cxx/xml/sax/std-input-source.hxx>
636 #include <xsd/cxx/tree/error-handler.hxx>
637 
638 namespace XMLMesh1D
639 {
640  ::std::auto_ptr< ::XMLMesh1D::mesh >
642  ::xml_schema::flags f,
644  {
645  ::xsd::cxx::xml::auto_initializer i (
646  (f & ::xml_schema::flags::dont_initialize) == 0,
647  (f & ::xml_schema::flags::keep_dom) == 0);
648 
649  ::xsd::cxx::tree::error_handler< char > h;
650 
651  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
652  ::xsd::cxx::xml::dom::parse< char > (
653  u, h, p, f));
654 
655  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
656 
657  ::std::auto_ptr< ::XMLMesh1D::mesh > r (
658  ::XMLMesh1D::mesh_ (
659  d, f | ::xml_schema::flags::own_dom, p));
660 
661  return r;
662  }
663 
664  ::std::auto_ptr< ::XMLMesh1D::mesh >
667  ::xml_schema::flags f,
669  {
670  ::xsd::cxx::xml::auto_initializer i (
671  (f & ::xml_schema::flags::dont_initialize) == 0,
672  (f & ::xml_schema::flags::keep_dom) == 0);
673 
674  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
675  ::xsd::cxx::xml::dom::parse< char > (
676  u, h, p, f));
677 
678  if (!d.get ())
679  throw ::xsd::cxx::tree::parsing< char > ();
680 
681  ::std::auto_ptr< ::XMLMesh1D::mesh > r (
682  ::XMLMesh1D::mesh_ (
683  d, f | ::xml_schema::flags::own_dom, p));
684 
685  return r;
686  }
687 
688  ::std::auto_ptr< ::XMLMesh1D::mesh >
690  ::xercesc::DOMErrorHandler& h,
691  ::xml_schema::flags f,
693  {
694  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
695  ::xsd::cxx::xml::dom::parse< char > (
696  u, h, p, f));
697 
698  if (!d.get ())
699  throw ::xsd::cxx::tree::parsing< char > ();
700 
701  ::std::auto_ptr< ::XMLMesh1D::mesh > r (
702  ::XMLMesh1D::mesh_ (
703  d, f | ::xml_schema::flags::own_dom, p));
704 
705  return r;
706  }
707 
708  ::std::auto_ptr< ::XMLMesh1D::mesh >
709  mesh_ (::std::istream& is,
710  ::xml_schema::flags f,
712  {
713  ::xsd::cxx::xml::auto_initializer i (
714  (f & ::xml_schema::flags::dont_initialize) == 0,
715  (f & ::xml_schema::flags::keep_dom) == 0);
716 
717  ::xsd::cxx::xml::sax::std_input_source isrc (is);
718  return ::XMLMesh1D::mesh_ (isrc, f, p);
719  }
720 
721  ::std::auto_ptr< ::XMLMesh1D::mesh >
722  mesh_ (::std::istream& is,
724  ::xml_schema::flags f,
726  {
727  ::xsd::cxx::xml::auto_initializer i (
728  (f & ::xml_schema::flags::dont_initialize) == 0,
729  (f & ::xml_schema::flags::keep_dom) == 0);
730 
731  ::xsd::cxx::xml::sax::std_input_source isrc (is);
732  return ::XMLMesh1D::mesh_ (isrc, h, f, p);
733  }
734 
735  ::std::auto_ptr< ::XMLMesh1D::mesh >
736  mesh_ (::std::istream& is,
737  ::xercesc::DOMErrorHandler& h,
738  ::xml_schema::flags f,
740  {
741  ::xsd::cxx::xml::sax::std_input_source isrc (is);
742  return ::XMLMesh1D::mesh_ (isrc, h, f, p);
743  }
744 
745  ::std::auto_ptr< ::XMLMesh1D::mesh >
746  mesh_ (::std::istream& is,
747  const ::std::string& sid,
748  ::xml_schema::flags f,
750  {
751  ::xsd::cxx::xml::auto_initializer i (
752  (f & ::xml_schema::flags::dont_initialize) == 0,
753  (f & ::xml_schema::flags::keep_dom) == 0);
754 
755  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
756  return ::XMLMesh1D::mesh_ (isrc, f, p);
757  }
758 
759  ::std::auto_ptr< ::XMLMesh1D::mesh >
760  mesh_ (::std::istream& is,
761  const ::std::string& sid,
763  ::xml_schema::flags f,
765  {
766  ::xsd::cxx::xml::auto_initializer i (
767  (f & ::xml_schema::flags::dont_initialize) == 0,
768  (f & ::xml_schema::flags::keep_dom) == 0);
769 
770  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
771  return ::XMLMesh1D::mesh_ (isrc, h, f, p);
772  }
773 
774  ::std::auto_ptr< ::XMLMesh1D::mesh >
775  mesh_ (::std::istream& is,
776  const ::std::string& sid,
777  ::xercesc::DOMErrorHandler& h,
778  ::xml_schema::flags f,
780  {
781  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
782  return ::XMLMesh1D::mesh_ (isrc, h, f, p);
783  }
784 
785  ::std::auto_ptr< ::XMLMesh1D::mesh >
786  mesh_ (::xercesc::InputSource& i,
787  ::xml_schema::flags f,
789  {
790  ::xsd::cxx::tree::error_handler< char > h;
791 
792  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
793  ::xsd::cxx::xml::dom::parse< char > (
794  i, h, p, f));
795 
796  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
797 
798  ::std::auto_ptr< ::XMLMesh1D::mesh > r (
799  ::XMLMesh1D::mesh_ (
800  d, f | ::xml_schema::flags::own_dom, p));
801 
802  return r;
803  }
804 
805  ::std::auto_ptr< ::XMLMesh1D::mesh >
806  mesh_ (::xercesc::InputSource& i,
808  ::xml_schema::flags f,
810  {
811  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
812  ::xsd::cxx::xml::dom::parse< char > (
813  i, h, p, f));
814 
815  if (!d.get ())
816  throw ::xsd::cxx::tree::parsing< char > ();
817 
818  ::std::auto_ptr< ::XMLMesh1D::mesh > r (
819  ::XMLMesh1D::mesh_ (
820  d, f | ::xml_schema::flags::own_dom, p));
821 
822  return r;
823  }
824 
825  ::std::auto_ptr< ::XMLMesh1D::mesh >
826  mesh_ (::xercesc::InputSource& i,
827  ::xercesc::DOMErrorHandler& h,
828  ::xml_schema::flags f,
830  {
831  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
832  ::xsd::cxx::xml::dom::parse< char > (
833  i, h, p, f));
834 
835  if (!d.get ())
836  throw ::xsd::cxx::tree::parsing< char > ();
837 
838  ::std::auto_ptr< ::XMLMesh1D::mesh > r (
839  ::XMLMesh1D::mesh_ (
840  d, f | ::xml_schema::flags::own_dom, p));
841 
842  return r;
843  }
844 
845  ::std::auto_ptr< ::XMLMesh1D::mesh >
846  mesh_ (const ::xercesc::DOMDocument& d,
847  ::xml_schema::flags f,
849  {
850  if (f & ::xml_schema::flags::keep_dom)
851  {
852  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > c (
853  static_cast< ::xercesc::DOMDocument* > (d.cloneNode (true)));
854 
855  ::std::auto_ptr< ::XMLMesh1D::mesh > r (
856  ::XMLMesh1D::mesh_ (
857  c, f | ::xml_schema::flags::own_dom, p));
858 
859  return r;
860  }
861 
862  const ::xercesc::DOMElement& e (*d.getDocumentElement ());
863  const ::xsd::cxx::xml::qualified_name< char > n (
864  ::xsd::cxx::xml::dom::name< char > (e));
865 
866  if (n.name () == "mesh" &&
867  n.namespace_ () == "XMLMesh1D")
868  {
869  ::std::auto_ptr< ::XMLMesh1D::mesh > r (
870  ::xsd::cxx::tree::traits< ::XMLMesh1D::mesh, char >::create (
871  e, f, 0));
872  return r;
873  }
874 
875  throw ::xsd::cxx::tree::unexpected_element < char > (
876  n.name (),
877  n.namespace_ (),
878  "mesh",
879  "XMLMesh1D");
880  }
881 
882  ::std::auto_ptr< ::XMLMesh1D::mesh >
883  mesh_ (::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument >& d,
884  ::xml_schema::flags f,
886  {
887  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > c (
888  ((f & ::xml_schema::flags::keep_dom) &&
889  !(f & ::xml_schema::flags::own_dom))
890  ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (true))
891  : 0);
892 
893  ::xercesc::DOMDocument& doc (c.get () ? *c : *d);
894  const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
895 
896  const ::xsd::cxx::xml::qualified_name< char > n (
897  ::xsd::cxx::xml::dom::name< char > (e));
898 
899  if (f & ::xml_schema::flags::keep_dom)
900  doc.setUserData (::xml_schema::dom::tree_node_key,
901  (c.get () ? &c : &d),
902  0);
903 
904  if (n.name () == "mesh" &&
905  n.namespace_ () == "XMLMesh1D")
906  {
907  ::std::auto_ptr< ::XMLMesh1D::mesh > r (
908  ::xsd::cxx::tree::traits< ::XMLMesh1D::mesh, char >::create (
909  e, f, 0));
910  return r;
911  }
912 
913  throw ::xsd::cxx::tree::unexpected_element < char > (
914  n.name (),
915  n.namespace_ (),
916  "mesh",
917  "XMLMesh1D");
918  }
919 }
920 
921 #include <ostream>
922 #include <xsd/cxx/tree/error-handler.hxx>
923 #include <xsd/cxx/xml/dom/serialization-source.hxx>
924 
925 #include <xsd/cxx/tree/type-serializer-map.hxx>
926 
927 namespace _xsd
928 {
929  static
930  const ::xsd::cxx::tree::type_serializer_plate< 0, char >
931  type_serializer_plate_init;
932 }
933 
934 namespace XMLMesh1D
935 {
936  void
937  mesh_ (::std::ostream& o,
938  const ::XMLMesh1D::mesh& s,
941  ::xml_schema::flags f)
942  {
943  ::xsd::cxx::xml::auto_initializer i (
944  (f & ::xml_schema::flags::dont_initialize) == 0);
945 
946  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
947  ::XMLMesh1D::mesh_ (s, m, f));
948 
949  ::xsd::cxx::tree::error_handler< char > h;
950 
951  ::xsd::cxx::xml::dom::ostream_format_target t (o);
952  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
953  {
954  h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
955  }
956  }
957 
958  void
959  mesh_ (::std::ostream& o,
960  const ::XMLMesh1D::mesh& s,
964  ::xml_schema::flags f)
965  {
966  ::xsd::cxx::xml::auto_initializer i (
967  (f & ::xml_schema::flags::dont_initialize) == 0);
968 
969  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
970  ::XMLMesh1D::mesh_ (s, m, f));
971  ::xsd::cxx::xml::dom::ostream_format_target t (o);
972  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
973  {
974  throw ::xsd::cxx::tree::serialization< char > ();
975  }
976  }
977 
978  void
979  mesh_ (::std::ostream& o,
980  const ::XMLMesh1D::mesh& s,
981  ::xercesc::DOMErrorHandler& h,
984  ::xml_schema::flags f)
985  {
986  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
987  ::XMLMesh1D::mesh_ (s, m, f));
988  ::xsd::cxx::xml::dom::ostream_format_target t (o);
989  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
990  {
991  throw ::xsd::cxx::tree::serialization< char > ();
992  }
993  }
994 
995  void
996  mesh_ (::xercesc::XMLFormatTarget& t,
997  const ::XMLMesh1D::mesh& s,
1000  ::xml_schema::flags f)
1001  {
1002  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
1003  ::XMLMesh1D::mesh_ (s, m, f));
1004 
1005  ::xsd::cxx::tree::error_handler< char > h;
1006 
1007  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1008  {
1009  h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
1010  }
1011  }
1012 
1013  void
1014  mesh_ (::xercesc::XMLFormatTarget& t,
1015  const ::XMLMesh1D::mesh& s,
1019  ::xml_schema::flags f)
1020  {
1021  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
1022  ::XMLMesh1D::mesh_ (s, m, f));
1023  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1024  {
1025  throw ::xsd::cxx::tree::serialization< char > ();
1026  }
1027  }
1028 
1029  void
1030  mesh_ (::xercesc::XMLFormatTarget& t,
1031  const ::XMLMesh1D::mesh& s,
1032  ::xercesc::DOMErrorHandler& h,
1035  ::xml_schema::flags f)
1036  {
1037  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
1038  ::XMLMesh1D::mesh_ (s, m, f));
1039  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1040  {
1041  throw ::xsd::cxx::tree::serialization< char > ();
1042  }
1043  }
1044 
1045  void
1046  mesh_ (::xercesc::DOMDocument& d,
1047  const ::XMLMesh1D::mesh& s,
1049  {
1050  ::xercesc::DOMElement& e (*d.getDocumentElement ());
1051  const ::xsd::cxx::xml::qualified_name< char > n (
1052  ::xsd::cxx::xml::dom::name< char > (e));
1053 
1054  if (n.name () == "mesh" &&
1055  n.namespace_ () == "XMLMesh1D")
1056  {
1057  e << s;
1058  }
1059  else
1060  {
1061  throw ::xsd::cxx::tree::unexpected_element < char > (
1062  n.name (),
1063  n.namespace_ (),
1064  "mesh",
1065  "XMLMesh1D");
1066  }
1067  }
1068 
1069  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument >
1070  mesh_ (const ::XMLMesh1D::mesh& s,
1072  ::xml_schema::flags f)
1073  {
1074  ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
1075  ::xsd::cxx::xml::dom::serialize< char > (
1076  "mesh",
1077  "XMLMesh1D",
1078  m, f));
1079 
1080  ::XMLMesh1D::mesh_ (*d, s, f);
1081  return d;
1082  }
1083 
1084  void
1085  operator<< (::xercesc::DOMElement& e, const variables_type& i)
1086  {
1087  e << static_cast< const ::xml_schema::type& > (i);
1088 
1089  // var
1090  //
1092  b (i.var ().begin ()), n (i.var ().end ());
1093  b != n; ++b)
1094  {
1095  ::xercesc::DOMElement& s (
1096  ::xsd::cxx::xml::dom::create_element (
1097  "var",
1098  e));
1099 
1100  s << *b;
1101  }
1102  }
1103 
1104  void
1105  operator<< (::xercesc::DOMElement& e, const mesh& i)
1106  {
1107  e << static_cast< const ::xml_schema::type& > (i);
1108 
1109  // variables
1110  //
1111  if (i.variables ())
1112  {
1113  ::xercesc::DOMElement& s (
1114  ::xsd::cxx::xml::dom::create_element (
1115  "variables",
1116  e));
1117 
1118  s << *i.variables ();
1119  }
1120 
1121  // v
1122  //
1124  b (i.v ().begin ()), n (i.v ().end ());
1125  b != n; ++b)
1126  {
1127  ::xercesc::DOMElement& s (
1128  ::xsd::cxx::xml::dom::create_element (
1129  "v",
1130  e));
1131 
1132  s << *b;
1133  }
1134  }
1135 
1136  void
1137  operator<< (::xercesc::DOMElement& e, const var& i)
1138  {
1139  e << static_cast< const ::xml_schema::type& > (i);
1140 
1141  // name
1142  //
1143  {
1144  ::xercesc::DOMAttr& a (
1145  ::xsd::cxx::xml::dom::create_attribute (
1146  "name",
1147  e));
1148 
1149  a << i.name ();
1150  }
1151 
1152  // value
1153  //
1154  {
1155  ::xercesc::DOMAttr& a (
1156  ::xsd::cxx::xml::dom::create_attribute (
1157  "value",
1158  e));
1159 
1160  a << ::xml_schema::as_decimal(i.value ());
1161  }
1162  }
1163 
1164  void
1165  operator<< (::xercesc::DOMElement& e, const v& i)
1166  {
1167  e << static_cast< const ::xml_schema::type& > (i);
1168 
1169  // x
1170  //
1171  {
1172  ::xercesc::DOMAttr& a (
1173  ::xsd::cxx::xml::dom::create_attribute (
1174  "x",
1175  e));
1176 
1177  a << i.x ();
1178  }
1179 
1180  // m
1181  //
1182  if (i.m ())
1183  {
1184  ::xercesc::DOMAttr& a (
1185  ::xsd::cxx::xml::dom::create_attribute (
1186  "m",
1187  e));
1188 
1189  a << *i.m ();
1190  }
1191  }
1192 }
1193 
1194 #include <xsd/cxx/post.hxx>
1195 
1196 // Begin epilogue.
1197 //
1198 //
1199 // End epilogue.
1200 
::xml_schema::string m_type
Attribute type.
virtual mesh * _clone(::xml_schema::flags f=0,::xml_schema::container *c=0) const
Copy the instance polymorphically.
::xsd::cxx::tree::flags flags
Parsing and serialization flags.
virtual ~mesh()
Destructor.
::xml_schema::decimal value_type
Attribute type.
virtual v * _clone(::xml_schema::flags f=0,::xml_schema::container *c=0) const
Copy the instance polymorphically.
Generated from mesh_h1d_xml.xsd.
virtual ~v()
Destructor.
Class corresponding to the v schema type.
C++ namespace for the XMLMesh1D schema namespace.
Definition: mesh_h1d_xml.h:624
virtual ~variables_type()
Destructor.
::xsd::cxx::tree::as_decimal< decimal > as_decimal
Serialization wrapper for the decimal type.
::xml_schema::string name_type
Attribute type.
::xsd::cxx::tree::type type
C++ type corresponding to the anyType XML Schema built-in type.
const m_optional & m() const
Return a read-only (constant) reference to the attribute container.
Class corresponding to the mesh schema type.
Definition: mesh_h1d_xml.h:804
::std::auto_ptr< ::XMLMesh1D::mesh > mesh_(const ::std::string &uri,::xml_schema::flags f=0, const ::xml_schema::properties &p=::xml_schema::properties())
Parse a URI or a local file.
v(const x_type &)
Create an instance from the ultimate base and initializers for required elements and attributes...
const value_type & value() const
Return a read-only (constant) reference to the attribute.
virtual ~var()
Destructor.
::xsd::cxx::tree::name< char, token > name
C++ type corresponding to the Name XML Schema built-in type.
::xsd::cxx::xml::dom::namespace_infomap< char > namespace_infomap
Namespace serialization information map.
v_sequence::const_iterator v_const_iterator
Element constant iterator type.
Definition: mesh_h1d_xml.h:909
::xsd::cxx::tree::optional< m_type > m_optional
Attribute optional container type.
::xsd::cxx::xml::error_handler< char > error_handler
Error handler callback interface.
::xsd::cxx::tree::sequence< v_type > v_sequence
Element sequence container type.
Definition: mesh_h1d_xml.h:899
const XMLCh *const tree_node_key
DOM user data key for back pointers to tree nodes.
::xsd::cxx::tree::properties< char > properties
Parsing properties.
Class corresponding to the var schema type.
virtual var * _clone(::xml_schema::flags f=0,::xml_schema::container *c=0) const
Copy the instance polymorphically.
const v_sequence & v() const
Return a read-only (constant) reference to the element sequence.
const x_type & x() const
Return a read-only (constant) reference to the attribute.
virtual variables_type * _clone(::xml_schema::flags f=0,::xml_schema::container *c=0) const
Copy the instance polymorphically.
::xsd::cxx::tree::optional< variables_type > variables_optional
Element optional container type.
Definition: mesh_h1d_xml.h:823
var_sequence::const_iterator var_const_iterator
Element constant iterator type.
Definition: mesh_h1d_xml.h:686
const name_type & name() const
Return a read-only (constant) reference to the attribute.
C++ namespace for the http://www.w3.org/2001/XMLSchema schema namespace.
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
const var_sequence & var() const
Return a read-only (constant) reference to the element sequence.
variables_type()
Create an instance from the ultimate base and initializers for required elements and attributes...
Class corresponding to the variables_type schema type.
Definition: mesh_h1d_xml.h:657
::xsd::cxx::tree::type container
Alias for the anyType type.
const variables_optional & variables() const
Return a read-only (constant) reference to the element container.
::xsd::cxx::tree::sequence< var_type > var_sequence
Element sequence container type.
Definition: mesh_h1d_xml.h:676
::xml_schema::string x_type
Attribute type.
mesh()
Create an instance from the ultimate base and initializers for required elements and attributes...
var(const name_type &, const value_type &)
Create an instance from the ultimate base and initializers for required elements and attributes...