#include <xsd/cxx/pre.hxx>

#include "EnvironmentActions.hxx"

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {

        const EnvironmentChangeData::ConditionsFile_optional& EnvironmentChangeData::
        ConditionsFile () const
        {
          return this->ConditionsFile_;
        }

        EnvironmentChangeData::ConditionsFile_optional& EnvironmentChangeData::
        ConditionsFile ()
        {
          return this->ConditionsFile_;
        }

        void EnvironmentChangeData::
        ConditionsFile (const ConditionsFile_type& x)
        {
          this->ConditionsFile_.set (x);
        }

        void EnvironmentChangeData::
        ConditionsFile (const ConditionsFile_optional& x)
        {
          this->ConditionsFile_ = x;
        }

        void EnvironmentChangeData::
        ConditionsFile (::std::unique_ptr< ConditionsFile_type > x)
        {
          this->ConditionsFile_.set (std::move (x));
        }

        const EnvironmentChangeData::Conditions_optional& EnvironmentChangeData::
        Conditions () const
        {
          return this->Conditions_;
        }

        EnvironmentChangeData::Conditions_optional& EnvironmentChangeData::
        Conditions ()
        {
          return this->Conditions_;
        }

        void EnvironmentChangeData::
        Conditions (const Conditions_type& x)
        {
          this->Conditions_.set (x);
        }

        void EnvironmentChangeData::
        Conditions (const Conditions_optional& x)
        {
          this->Conditions_ = x;
        }

        void EnvironmentChangeData::
        Conditions (::std::unique_ptr< Conditions_type > x)
        {
          this->Conditions_.set (std::move (x));
        }

        const ThermalApplicationData::ActiveHeating_optional& ThermalApplicationData::
        ActiveHeating () const
        {
          return this->ActiveHeating_;
        }

        ThermalApplicationData::ActiveHeating_optional& ThermalApplicationData::
        ActiveHeating ()
        {
          return this->ActiveHeating_;
        }

        void ThermalApplicationData::
        ActiveHeating (const ActiveHeating_type& x)
        {
          this->ActiveHeating_.set (x);
        }

        void ThermalApplicationData::
        ActiveHeating (const ActiveHeating_optional& x)
        {
          this->ActiveHeating_ = x;
        }

        void ThermalApplicationData::
        ActiveHeating (::std::unique_ptr< ActiveHeating_type > x)
        {
          this->ActiveHeating_.set (std::move (x));
        }

        const ThermalApplicationData::ActiveCooling_optional& ThermalApplicationData::
        ActiveCooling () const
        {
          return this->ActiveCooling_;
        }

        ThermalApplicationData::ActiveCooling_optional& ThermalApplicationData::
        ActiveCooling ()
        {
          return this->ActiveCooling_;
        }

        void ThermalApplicationData::
        ActiveCooling (const ActiveCooling_type& x)
        {
          this->ActiveCooling_.set (x);
        }

        void ThermalApplicationData::
        ActiveCooling (const ActiveCooling_optional& x)
        {
          this->ActiveCooling_ = x;
        }

        void ThermalApplicationData::
        ActiveCooling (::std::unique_ptr< ActiveCooling_type > x)
        {
          this->ActiveCooling_.set (std::move (x));
        }

        const ThermalApplicationData::AppliedTemperature_optional& ThermalApplicationData::
        AppliedTemperature () const
        {
          return this->AppliedTemperature_;
        }

        ThermalApplicationData::AppliedTemperature_optional& ThermalApplicationData::
        AppliedTemperature ()
        {
          return this->AppliedTemperature_;
        }

        void ThermalApplicationData::
        AppliedTemperature (const AppliedTemperature_type& x)
        {
          this->AppliedTemperature_.set (x);
        }

        void ThermalApplicationData::
        AppliedTemperature (const AppliedTemperature_optional& x)
        {
          this->AppliedTemperature_ = x;
        }

        void ThermalApplicationData::
        AppliedTemperature (::std::unique_ptr< AppliedTemperature_type > x)
        {
          this->AppliedTemperature_.set (std::move (x));
        }

        const ThermalApplicationData::AppendToPrevious_type& ThermalApplicationData::
        AppendToPrevious () const
        {
          return this->AppendToPrevious_.get ();
        }

        ThermalApplicationData::AppendToPrevious_type& ThermalApplicationData::
        AppendToPrevious ()
        {
          return this->AppendToPrevious_.get ();
        }

        void ThermalApplicationData::
        AppendToPrevious (const AppendToPrevious_type& x)
        {
          this->AppendToPrevious_.set (x);
        }
      }
    }
  }
}

#include <xsd/cxx/xml/dom/parsing-source.hxx>

#include <xsd/cxx/tree/type-factory-map.hxx>

namespace _xsd
{
  static
  const ::xsd::cxx::tree::type_factory_plate< 0, char >
  type_factory_plate_init;
}

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {

        EnvironmentActionData::
        EnvironmentActionData ()
        : ::mil::tatrc::physiology::datamodel::ActionData ()
        {
        }

        EnvironmentActionData::
        EnvironmentActionData (const EnvironmentActionData& x,
                               ::xml_schema::flags f,
                               ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::ActionData (x, f, c)
        {
        }

        EnvironmentActionData::
        EnvironmentActionData (const ::xercesc::DOMElement& e,
                               ::xml_schema::flags f,
                               ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::ActionData (e, f, c)
        {
        }

        EnvironmentActionData* EnvironmentActionData::
        _clone (::xml_schema::flags f,
                ::xml_schema::container* c) const
        {
          return new class EnvironmentActionData (*this, f, c);
        }

        EnvironmentActionData::
        ~EnvironmentActionData ()
        {
        }

        static
        const ::xsd::cxx::tree::type_factory_initializer< 0, char, EnvironmentActionData >
        _xsd_EnvironmentActionData_type_factory_init (
          "EnvironmentActionData",
          "uri:/mil/tatrc/physiology/datamodel");

        EnvironmentChangeData::
        EnvironmentChangeData ()
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (),
          ConditionsFile_ (this),
          Conditions_ (this)
        {
        }

        EnvironmentChangeData::
        EnvironmentChangeData (const EnvironmentChangeData& x,
                               ::xml_schema::flags f,
                               ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (x, f, c),
          ConditionsFile_ (x.ConditionsFile_, f, this),
          Conditions_ (x.Conditions_, f, this)
        {
        }

        EnvironmentChangeData::
        EnvironmentChangeData (const ::xercesc::DOMElement& e,
                               ::xml_schema::flags f,
                               ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (e, f | ::xml_schema::flags::base, c),
          ConditionsFile_ (this),
          Conditions_ (this)
        {
          if ((f & ::xml_schema::flags::base) == 0)
          {
            ::xsd::cxx::xml::dom::parser< char > p (e, true, false, false);
            this->parse (p, f);
          }
        }

        void EnvironmentChangeData::
        parse (::xsd::cxx::xml::dom::parser< char >& p,
               ::xml_schema::flags f)
        {
          this->::mil::tatrc::physiology::datamodel::EnvironmentActionData::parse (p, f);

          for (; p.more_content (); p.next_content (false))
          {
            const ::xercesc::DOMElement& i (p.cur_element ());
            const ::xsd::cxx::xml::qualified_name< char > n (
              ::xsd::cxx::xml::dom::name< char > (i));

            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "ConditionsFile",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< ConditionsFile_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->ConditionsFile_)
                {
                  ::std::unique_ptr< ConditionsFile_type > r (
                    dynamic_cast< ConditionsFile_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->ConditionsFile_.set (::std::move (r));
                  continue;
                }
              }
            }

            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "Conditions",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< Conditions_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->Conditions_)
                {
                  ::std::unique_ptr< Conditions_type > r (
                    dynamic_cast< Conditions_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->Conditions_.set (::std::move (r));
                  continue;
                }
              }
            }

            break;
          }
        }

        EnvironmentChangeData* EnvironmentChangeData::
        _clone (::xml_schema::flags f,
                ::xml_schema::container* c) const
        {
          return new class EnvironmentChangeData (*this, f, c);
        }

        EnvironmentChangeData& EnvironmentChangeData::
        operator= (const EnvironmentChangeData& x)
        {
          if (this != &x)
          {
            static_cast< ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (*this) = x;
            this->ConditionsFile_ = x.ConditionsFile_;
            this->Conditions_ = x.Conditions_;
          }

          return *this;
        }

        EnvironmentChangeData::
        ~EnvironmentChangeData ()
        {
        }

        static
        const ::xsd::cxx::tree::type_factory_initializer< 0, char, EnvironmentChangeData >
        _xsd_EnvironmentChangeData_type_factory_init (
          "EnvironmentChangeData",
          "uri:/mil/tatrc/physiology/datamodel");

        ThermalApplicationData::
        ThermalApplicationData ()
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (),
          ActiveHeating_ (this),
          ActiveCooling_ (this),
          AppliedTemperature_ (this),
          AppendToPrevious_ (this)
        {
        }

        ThermalApplicationData::
        ThermalApplicationData (const AppendToPrevious_type& AppendToPrevious)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (),
          ActiveHeating_ (this),
          ActiveCooling_ (this),
          AppliedTemperature_ (this),
          AppendToPrevious_ (AppendToPrevious, this)
        {
        }

        ThermalApplicationData::
        ThermalApplicationData (const ThermalApplicationData& x,
                                ::xml_schema::flags f,
                                ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (x, f, c),
          ActiveHeating_ (x.ActiveHeating_, f, this),
          ActiveCooling_ (x.ActiveCooling_, f, this),
          AppliedTemperature_ (x.AppliedTemperature_, f, this),
          AppendToPrevious_ (x.AppendToPrevious_, f, this)
        {
        }

        ThermalApplicationData::
        ThermalApplicationData (const ::xercesc::DOMElement& e,
                                ::xml_schema::flags f,
                                ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (e, f | ::xml_schema::flags::base, c),
          ActiveHeating_ (this),
          ActiveCooling_ (this),
          AppliedTemperature_ (this),
          AppendToPrevious_ (this)
        {
          if ((f & ::xml_schema::flags::base) == 0)
          {
            ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
            this->parse (p, f);
          }
        }

        void ThermalApplicationData::
        parse (::xsd::cxx::xml::dom::parser< char >& p,
               ::xml_schema::flags f)
        {
          this->::mil::tatrc::physiology::datamodel::EnvironmentActionData::parse (p, f);

          for (; p.more_content (); p.next_content (false))
          {
            const ::xercesc::DOMElement& i (p.cur_element ());
            const ::xsd::cxx::xml::qualified_name< char > n (
              ::xsd::cxx::xml::dom::name< char > (i));

            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "ActiveHeating",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< ActiveHeating_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->ActiveHeating_)
                {
                  ::std::unique_ptr< ActiveHeating_type > r (
                    dynamic_cast< ActiveHeating_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->ActiveHeating_.set (::std::move (r));
                  continue;
                }
              }
            }

            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "ActiveCooling",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< ActiveCooling_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->ActiveCooling_)
                {
                  ::std::unique_ptr< ActiveCooling_type > r (
                    dynamic_cast< ActiveCooling_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->ActiveCooling_.set (::std::move (r));
                  continue;
                }
              }
            }

            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "AppliedTemperature",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< AppliedTemperature_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->AppliedTemperature_)
                {
                  ::std::unique_ptr< AppliedTemperature_type > r (
                    dynamic_cast< AppliedTemperature_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->AppliedTemperature_.set (::std::move (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 () == "AppendToPrevious" && n.namespace_ ().empty ())
            {
              this->AppendToPrevious_.set (AppendToPrevious_traits::create (i, f, this));
              continue;
            }
          }

          if (!AppendToPrevious_.present ())
          {
            throw ::xsd::cxx::tree::expected_attribute< char > (
              "AppendToPrevious",
              "");
          }
        }

        ThermalApplicationData* ThermalApplicationData::
        _clone (::xml_schema::flags f,
                ::xml_schema::container* c) const
        {
          return new class ThermalApplicationData (*this, f, c);
        }

        ThermalApplicationData& ThermalApplicationData::
        operator= (const ThermalApplicationData& x)
        {
          if (this != &x)
          {
            static_cast< ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (*this) = x;
            this->ActiveHeating_ = x.ActiveHeating_;
            this->ActiveCooling_ = x.ActiveCooling_;
            this->AppliedTemperature_ = x.AppliedTemperature_;
            this->AppendToPrevious_ = x.AppendToPrevious_;
          }

          return *this;
        }

        ThermalApplicationData::
        ~ThermalApplicationData ()
        {
        }

        static
        const ::xsd::cxx::tree::type_factory_initializer< 0, char, ThermalApplicationData >
        _xsd_ThermalApplicationData_type_factory_init (
          "ThermalApplicationData",
          "uri:/mil/tatrc/physiology/datamodel");
      }
    }
  }
}

#include <ostream>

#include <xsd/cxx/tree/std-ostream-map.hxx>

namespace _xsd
{
  static
  const ::xsd::cxx::tree::std_ostream_plate< 0, char >
  std_ostream_plate_init;
}

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {
        ::std::ostream&
        operator<< (::std::ostream& o, const EnvironmentActionData& i)
        {
          o << static_cast< const ::mil::tatrc::physiology::datamodel::ActionData& > (i);

          return o;
        }

        static
        const ::xsd::cxx::tree::std_ostream_initializer< 0, char, EnvironmentActionData >
        _xsd_EnvironmentActionData_std_ostream_init;

        ::std::ostream&
        operator<< (::std::ostream& o, const EnvironmentChangeData& i)
        {
          o << static_cast< const ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (i);

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.ConditionsFile ())
            {
              o << ::std::endl << "ConditionsFile: ";
              om.insert (o, *i.ConditionsFile ());
            }
          }

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.Conditions ())
            {
              o << ::std::endl << "Conditions: ";
              om.insert (o, *i.Conditions ());
            }
          }

          return o;
        }

        static
        const ::xsd::cxx::tree::std_ostream_initializer< 0, char, EnvironmentChangeData >
        _xsd_EnvironmentChangeData_std_ostream_init;

        ::std::ostream&
        operator<< (::std::ostream& o, const ThermalApplicationData& i)
        {
          o << static_cast< const ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (i);

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.ActiveHeating ())
            {
              o << ::std::endl << "ActiveHeating: ";
              om.insert (o, *i.ActiveHeating ());
            }
          }

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.ActiveCooling ())
            {
              o << ::std::endl << "ActiveCooling: ";
              om.insert (o, *i.ActiveCooling ());
            }
          }

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.AppliedTemperature ())
            {
              o << ::std::endl << "AppliedTemperature: ";
              om.insert (o, *i.AppliedTemperature ());
            }
          }

          o << ::std::endl << "AppendToPrevious: " << i.AppendToPrevious ();
          return o;
        }

        static
        const ::xsd::cxx::tree::std_ostream_initializer< 0, char, ThermalApplicationData >
        _xsd_ThermalApplicationData_std_ostream_init;
      }
    }
  }
}

#include <istream>
#include <xsd/cxx/xml/sax/std-input-source.hxx>
#include <xsd/cxx/tree/error-handler.hxx>

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {
      }
    }
  }
}

#include <ostream>
#include <xsd/cxx/tree/error-handler.hxx>
#include <xsd/cxx/xml/dom/serialization-source.hxx>

#include <xsd/cxx/tree/type-serializer-map.hxx>

namespace _xsd
{
  static
  const ::xsd::cxx::tree::type_serializer_plate< 0, char >
  type_serializer_plate_init;
}

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {
        void
        operator<< (::xercesc::DOMElement& e, const EnvironmentActionData& i)
        {
          e << static_cast< const ::mil::tatrc::physiology::datamodel::ActionData& > (i);
        }

        static
        const ::xsd::cxx::tree::type_serializer_initializer< 0, char, EnvironmentActionData >
        _xsd_EnvironmentActionData_type_serializer_init (
          "EnvironmentActionData",
          "uri:/mil/tatrc/physiology/datamodel");

        void
        operator<< (::xercesc::DOMElement& e, const EnvironmentChangeData& i)
        {
          e << static_cast< const ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (i);

          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.ConditionsFile ())
            {
              const EnvironmentChangeData::ConditionsFile_type& x (*i.ConditionsFile ());
              if (typeid (EnvironmentChangeData::ConditionsFile_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "ConditionsFile",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "ConditionsFile",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }

          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.Conditions ())
            {
              const EnvironmentChangeData::Conditions_type& x (*i.Conditions ());
              if (typeid (EnvironmentChangeData::Conditions_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "Conditions",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "Conditions",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }
        }

        static
        const ::xsd::cxx::tree::type_serializer_initializer< 0, char, EnvironmentChangeData >
        _xsd_EnvironmentChangeData_type_serializer_init (
          "EnvironmentChangeData",
          "uri:/mil/tatrc/physiology/datamodel");

        void
        operator<< (::xercesc::DOMElement& e, const ThermalApplicationData& i)
        {
          e << static_cast< const ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (i);

          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.ActiveHeating ())
            {
              const ThermalApplicationData::ActiveHeating_type& x (*i.ActiveHeating ());
              if (typeid (ThermalApplicationData::ActiveHeating_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "ActiveHeating",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "ActiveHeating",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }

          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.ActiveCooling ())
            {
              const ThermalApplicationData::ActiveCooling_type& x (*i.ActiveCooling ());
              if (typeid (ThermalApplicationData::ActiveCooling_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "ActiveCooling",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "ActiveCooling",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }

          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.AppliedTemperature ())
            {
              const ThermalApplicationData::AppliedTemperature_type& x (*i.AppliedTemperature ());
              if (typeid (ThermalApplicationData::AppliedTemperature_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "AppliedTemperature",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "AppliedTemperature",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }

          {
            ::xercesc::DOMAttr& a (
              ::xsd::cxx::xml::dom::create_attribute (
                "AppendToPrevious",
                e));

            a << i.AppendToPrevious ();
          }
        }

        static
        const ::xsd::cxx::tree::type_serializer_initializer< 0, char, ThermalApplicationData >
        _xsd_ThermalApplicationData_type_serializer_init (
          "ThermalApplicationData",
          "uri:/mil/tatrc/physiology/datamodel");
      }
    }
  }
}

#include <xsd/cxx/post.hxx>
// Copyright (c) 2005-2014 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 <xsd/cxx/pre.hxx>

#include "EnvironmentActions.hxx"

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {
        // EnvironmentActionData
        // 


        // EnvironmentChangeData
        // 

        const EnvironmentChangeData::ConditionsFile_optional& EnvironmentChangeData::
        ConditionsFile () const
        {
          return this->ConditionsFile_;
        }

        EnvironmentChangeData::ConditionsFile_optional& EnvironmentChangeData::
        ConditionsFile ()
        {
          return this->ConditionsFile_;
        }

        void EnvironmentChangeData::
        ConditionsFile (const ConditionsFile_type& x)
        {
          this->ConditionsFile_.set (x);
        }

        void EnvironmentChangeData::
        ConditionsFile (const ConditionsFile_optional& x)
        {
          this->ConditionsFile_ = x;
        }

        void EnvironmentChangeData::
        ConditionsFile (::std::unique_ptr< ConditionsFile_type > x)
        {
          this->ConditionsFile_.set (std::move (x));
        }

        const EnvironmentChangeData::Conditions_optional& EnvironmentChangeData::
        Conditions () const
        {
          return this->Conditions_;
        }

        EnvironmentChangeData::Conditions_optional& EnvironmentChangeData::
        Conditions ()
        {
          return this->Conditions_;
        }

        void EnvironmentChangeData::
        Conditions (const Conditions_type& x)
        {
          this->Conditions_.set (x);
        }

        void EnvironmentChangeData::
        Conditions (const Conditions_optional& x)
        {
          this->Conditions_ = x;
        }

        void EnvironmentChangeData::
        Conditions (::std::unique_ptr< Conditions_type > x)
        {
          this->Conditions_.set (std::move (x));
        }


        // ThermalApplicationData
        // 

        const ThermalApplicationData::ActiveHeating_optional& ThermalApplicationData::
        ActiveHeating () const
        {
          return this->ActiveHeating_;
        }

        ThermalApplicationData::ActiveHeating_optional& ThermalApplicationData::
        ActiveHeating ()
        {
          return this->ActiveHeating_;
        }

        void ThermalApplicationData::
        ActiveHeating (const ActiveHeating_type& x)
        {
          this->ActiveHeating_.set (x);
        }

        void ThermalApplicationData::
        ActiveHeating (const ActiveHeating_optional& x)
        {
          this->ActiveHeating_ = x;
        }

        void ThermalApplicationData::
        ActiveHeating (::std::unique_ptr< ActiveHeating_type > x)
        {
          this->ActiveHeating_.set (std::move (x));
        }

        const ThermalApplicationData::ActiveCooling_optional& ThermalApplicationData::
        ActiveCooling () const
        {
          return this->ActiveCooling_;
        }

        ThermalApplicationData::ActiveCooling_optional& ThermalApplicationData::
        ActiveCooling ()
        {
          return this->ActiveCooling_;
        }

        void ThermalApplicationData::
        ActiveCooling (const ActiveCooling_type& x)
        {
          this->ActiveCooling_.set (x);
        }

        void ThermalApplicationData::
        ActiveCooling (const ActiveCooling_optional& x)
        {
          this->ActiveCooling_ = x;
        }

        void ThermalApplicationData::
        ActiveCooling (::std::unique_ptr< ActiveCooling_type > x)
        {
          this->ActiveCooling_.set (std::move (x));
        }

        const ThermalApplicationData::AppliedTemperature_optional& ThermalApplicationData::
        AppliedTemperature () const
        {
          return this->AppliedTemperature_;
        }

        ThermalApplicationData::AppliedTemperature_optional& ThermalApplicationData::
        AppliedTemperature ()
        {
          return this->AppliedTemperature_;
        }

        void ThermalApplicationData::
        AppliedTemperature (const AppliedTemperature_type& x)
        {
          this->AppliedTemperature_.set (x);
        }

        void ThermalApplicationData::
        AppliedTemperature (const AppliedTemperature_optional& x)
        {
          this->AppliedTemperature_ = x;
        }

        void ThermalApplicationData::
        AppliedTemperature (::std::unique_ptr< AppliedTemperature_type > x)
        {
          this->AppliedTemperature_.set (std::move (x));
        }

        const ThermalApplicationData::AppendToPrevious_type& ThermalApplicationData::
        AppendToPrevious () const
        {
          return this->AppendToPrevious_.get ();
        }

        ThermalApplicationData::AppendToPrevious_type& ThermalApplicationData::
        AppendToPrevious ()
        {
          return this->AppendToPrevious_.get ();
        }

        void ThermalApplicationData::
        AppendToPrevious (const AppendToPrevious_type& x)
        {
          this->AppendToPrevious_.set (x);
        }
      }
    }
  }
}

#include <xsd/cxx/xml/dom/parsing-source.hxx>

#include <xsd/cxx/tree/type-factory-map.hxx>

namespace _xsd
{
  static
  const ::xsd::cxx::tree::type_factory_plate< 0, char >
  type_factory_plate_init;
}

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {
        // EnvironmentActionData
        //

        EnvironmentActionData::
        EnvironmentActionData ()
        : ::mil::tatrc::physiology::datamodel::ActionData ()
        {
        }

        EnvironmentActionData::
        EnvironmentActionData (const EnvironmentActionData& x,
                               ::xml_schema::flags f,
                               ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::ActionData (x, f, c)
        {
        }

        EnvironmentActionData::
        EnvironmentActionData (const ::xercesc::DOMElement& e,
                               ::xml_schema::flags f,
                               ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::ActionData (e, f, c)
        {
        }

        EnvironmentActionData* EnvironmentActionData::
        _clone (::xml_schema::flags f,
                ::xml_schema::container* c) const
        {
          return new class EnvironmentActionData (*this, f, c);
        }

        EnvironmentActionData::
        ~EnvironmentActionData ()
        {
        }

        static
        const ::xsd::cxx::tree::type_factory_initializer< 0, char, EnvironmentActionData >
        _xsd_EnvironmentActionData_type_factory_init (
          "EnvironmentActionData",
          "uri:/mil/tatrc/physiology/datamodel");

        // EnvironmentChangeData
        //

        EnvironmentChangeData::
        EnvironmentChangeData ()
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (),
          ConditionsFile_ (this),
          Conditions_ (this)
        {
        }

        EnvironmentChangeData::
        EnvironmentChangeData (const EnvironmentChangeData& x,
                               ::xml_schema::flags f,
                               ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (x, f, c),
          ConditionsFile_ (x.ConditionsFile_, f, this),
          Conditions_ (x.Conditions_, f, this)
        {
        }

        EnvironmentChangeData::
        EnvironmentChangeData (const ::xercesc::DOMElement& e,
                               ::xml_schema::flags f,
                               ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (e, f | ::xml_schema::flags::base, c),
          ConditionsFile_ (this),
          Conditions_ (this)
        {
          if ((f & ::xml_schema::flags::base) == 0)
          {
            ::xsd::cxx::xml::dom::parser< char > p (e, true, false, false);
            this->parse (p, f);
          }
        }

        void EnvironmentChangeData::
        parse (::xsd::cxx::xml::dom::parser< char >& p,
               ::xml_schema::flags f)
        {
          this->::mil::tatrc::physiology::datamodel::EnvironmentActionData::parse (p, f);

          for (; p.more_content (); p.next_content (false))
          {
            const ::xercesc::DOMElement& i (p.cur_element ());
            const ::xsd::cxx::xml::qualified_name< char > n (
              ::xsd::cxx::xml::dom::name< char > (i));

            // ConditionsFile
            //
            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "ConditionsFile",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< ConditionsFile_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->ConditionsFile_)
                {
                  ::std::unique_ptr< ConditionsFile_type > r (
                    dynamic_cast< ConditionsFile_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->ConditionsFile_.set (::std::move (r));
                  continue;
                }
              }
            }

            // Conditions
            //
            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "Conditions",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< Conditions_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->Conditions_)
                {
                  ::std::unique_ptr< Conditions_type > r (
                    dynamic_cast< Conditions_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->Conditions_.set (::std::move (r));
                  continue;
                }
              }
            }

            break;
          }
        }

        EnvironmentChangeData* EnvironmentChangeData::
        _clone (::xml_schema::flags f,
                ::xml_schema::container* c) const
        {
          return new class EnvironmentChangeData (*this, f, c);
        }

        EnvironmentChangeData& EnvironmentChangeData::
        operator= (const EnvironmentChangeData& x)
        {
          if (this != &x)
          {
            static_cast< ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (*this) = x;
            this->ConditionsFile_ = x.ConditionsFile_;
            this->Conditions_ = x.Conditions_;
          }

          return *this;
        }

        EnvironmentChangeData::
        ~EnvironmentChangeData ()
        {
        }

        static
        const ::xsd::cxx::tree::type_factory_initializer< 0, char, EnvironmentChangeData >
        _xsd_EnvironmentChangeData_type_factory_init (
          "EnvironmentChangeData",
          "uri:/mil/tatrc/physiology/datamodel");

        // ThermalApplicationData
        //

        ThermalApplicationData::
        ThermalApplicationData ()
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (),
          ActiveHeating_ (this),
          ActiveCooling_ (this),
          AppliedTemperature_ (this),
          AppendToPrevious_ (this)
        {
        }

        ThermalApplicationData::
        ThermalApplicationData (const AppendToPrevious_type& AppendToPrevious)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (),
          ActiveHeating_ (this),
          ActiveCooling_ (this),
          AppliedTemperature_ (this),
          AppendToPrevious_ (AppendToPrevious, this)
        {
        }

        ThermalApplicationData::
        ThermalApplicationData (const ThermalApplicationData& x,
                                ::xml_schema::flags f,
                                ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (x, f, c),
          ActiveHeating_ (x.ActiveHeating_, f, this),
          ActiveCooling_ (x.ActiveCooling_, f, this),
          AppliedTemperature_ (x.AppliedTemperature_, f, this),
          AppendToPrevious_ (x.AppendToPrevious_, f, this)
        {
        }

        ThermalApplicationData::
        ThermalApplicationData (const ::xercesc::DOMElement& e,
                                ::xml_schema::flags f,
                                ::xml_schema::container* c)
        : ::mil::tatrc::physiology::datamodel::EnvironmentActionData (e, f | ::xml_schema::flags::base, c),
          ActiveHeating_ (this),
          ActiveCooling_ (this),
          AppliedTemperature_ (this),
          AppendToPrevious_ (this)
        {
          if ((f & ::xml_schema::flags::base) == 0)
          {
            ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
            this->parse (p, f);
          }
        }

        void ThermalApplicationData::
        parse (::xsd::cxx::xml::dom::parser< char >& p,
               ::xml_schema::flags f)
        {
          this->::mil::tatrc::physiology::datamodel::EnvironmentActionData::parse (p, f);

          for (; p.more_content (); p.next_content (false))
          {
            const ::xercesc::DOMElement& i (p.cur_element ());
            const ::xsd::cxx::xml::qualified_name< char > n (
              ::xsd::cxx::xml::dom::name< char > (i));

            // ActiveHeating
            //
            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "ActiveHeating",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< ActiveHeating_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->ActiveHeating_)
                {
                  ::std::unique_ptr< ActiveHeating_type > r (
                    dynamic_cast< ActiveHeating_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->ActiveHeating_.set (::std::move (r));
                  continue;
                }
              }
            }

            // ActiveCooling
            //
            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "ActiveCooling",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< ActiveCooling_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->ActiveCooling_)
                {
                  ::std::unique_ptr< ActiveCooling_type > r (
                    dynamic_cast< ActiveCooling_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->ActiveCooling_.set (::std::move (r));
                  continue;
                }
              }
            }

            // AppliedTemperature
            //
            {
              ::std::unique_ptr< ::xsd::cxx::tree::type > tmp (
                ::xsd::cxx::tree::type_factory_map_instance< 0, char > ().create (
                  "AppliedTemperature",
                  "uri:/mil/tatrc/physiology/datamodel",
                  &::xsd::cxx::tree::factory_impl< AppliedTemperature_type >,
                  false, true, i, n, f, this));

              if (tmp.get () != 0)
              {
                if (!this->AppliedTemperature_)
                {
                  ::std::unique_ptr< AppliedTemperature_type > r (
                    dynamic_cast< AppliedTemperature_type* > (tmp.get ()));

                  if (r.get ())
                    tmp.release ();
                  else
                    throw ::xsd::cxx::tree::not_derived< char > ();

                  this->AppliedTemperature_.set (::std::move (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 () == "AppendToPrevious" && n.namespace_ ().empty ())
            {
              this->AppendToPrevious_.set (AppendToPrevious_traits::create (i, f, this));
              continue;
            }
          }

          if (!AppendToPrevious_.present ())
          {
            throw ::xsd::cxx::tree::expected_attribute< char > (
              "AppendToPrevious",
              "");
          }
        }

        ThermalApplicationData* ThermalApplicationData::
        _clone (::xml_schema::flags f,
                ::xml_schema::container* c) const
        {
          return new class ThermalApplicationData (*this, f, c);
        }

        ThermalApplicationData& ThermalApplicationData::
        operator= (const ThermalApplicationData& x)
        {
          if (this != &x)
          {
            static_cast< ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (*this) = x;
            this->ActiveHeating_ = x.ActiveHeating_;
            this->ActiveCooling_ = x.ActiveCooling_;
            this->AppliedTemperature_ = x.AppliedTemperature_;
            this->AppendToPrevious_ = x.AppendToPrevious_;
          }

          return *this;
        }

        ThermalApplicationData::
        ~ThermalApplicationData ()
        {
        }

        static
        const ::xsd::cxx::tree::type_factory_initializer< 0, char, ThermalApplicationData >
        _xsd_ThermalApplicationData_type_factory_init (
          "ThermalApplicationData",
          "uri:/mil/tatrc/physiology/datamodel");
      }
    }
  }
}

#include <ostream>

#include <xsd/cxx/tree/std-ostream-map.hxx>

namespace _xsd
{
  static
  const ::xsd::cxx::tree::std_ostream_plate< 0, char >
  std_ostream_plate_init;
}

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {
        ::std::ostream&
        operator<< (::std::ostream& o, const EnvironmentActionData& i)
        {
          o << static_cast< const ::mil::tatrc::physiology::datamodel::ActionData& > (i);

          return o;
        }

        static
        const ::xsd::cxx::tree::std_ostream_initializer< 0, char, EnvironmentActionData >
        _xsd_EnvironmentActionData_std_ostream_init;

        ::std::ostream&
        operator<< (::std::ostream& o, const EnvironmentChangeData& i)
        {
          o << static_cast< const ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (i);

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.ConditionsFile ())
            {
              o << ::std::endl << "ConditionsFile: ";
              om.insert (o, *i.ConditionsFile ());
            }
          }

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.Conditions ())
            {
              o << ::std::endl << "Conditions: ";
              om.insert (o, *i.Conditions ());
            }
          }

          return o;
        }

        static
        const ::xsd::cxx::tree::std_ostream_initializer< 0, char, EnvironmentChangeData >
        _xsd_EnvironmentChangeData_std_ostream_init;

        ::std::ostream&
        operator<< (::std::ostream& o, const ThermalApplicationData& i)
        {
          o << static_cast< const ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (i);

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.ActiveHeating ())
            {
              o << ::std::endl << "ActiveHeating: ";
              om.insert (o, *i.ActiveHeating ());
            }
          }

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.ActiveCooling ())
            {
              o << ::std::endl << "ActiveCooling: ";
              om.insert (o, *i.ActiveCooling ());
            }
          }

          {
            ::xsd::cxx::tree::std_ostream_map< char >& om (
              ::xsd::cxx::tree::std_ostream_map_instance< 0, char > ());

            if (i.AppliedTemperature ())
            {
              o << ::std::endl << "AppliedTemperature: ";
              om.insert (o, *i.AppliedTemperature ());
            }
          }

          o << ::std::endl << "AppendToPrevious: " << i.AppendToPrevious ();
          return o;
        }

        static
        const ::xsd::cxx::tree::std_ostream_initializer< 0, char, ThermalApplicationData >
        _xsd_ThermalApplicationData_std_ostream_init;
      }
    }
  }
}

#include <istream>
#include <xsd/cxx/xml/sax/std-input-source.hxx>
#include <xsd/cxx/tree/error-handler.hxx>

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {
      }
    }
  }
}

#include <ostream>
#include <xsd/cxx/tree/error-handler.hxx>
#include <xsd/cxx/xml/dom/serialization-source.hxx>

#include <xsd/cxx/tree/type-serializer-map.hxx>

namespace _xsd
{
  static
  const ::xsd::cxx::tree::type_serializer_plate< 0, char >
  type_serializer_plate_init;
}

namespace mil
{
  namespace tatrc
  {
    namespace physiology
    {
      namespace datamodel
      {
        void
        operator<< (::xercesc::DOMElement& e, const EnvironmentActionData& i)
        {
          e << static_cast< const ::mil::tatrc::physiology::datamodel::ActionData& > (i);
        }

        static
        const ::xsd::cxx::tree::type_serializer_initializer< 0, char, EnvironmentActionData >
        _xsd_EnvironmentActionData_type_serializer_init (
          "EnvironmentActionData",
          "uri:/mil/tatrc/physiology/datamodel");


        void
        operator<< (::xercesc::DOMElement& e, const EnvironmentChangeData& i)
        {
          e << static_cast< const ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (i);

          // ConditionsFile
          //
          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.ConditionsFile ())
            {
              const EnvironmentChangeData::ConditionsFile_type& x (*i.ConditionsFile ());
              if (typeid (EnvironmentChangeData::ConditionsFile_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "ConditionsFile",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "ConditionsFile",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }

          // Conditions
          //
          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.Conditions ())
            {
              const EnvironmentChangeData::Conditions_type& x (*i.Conditions ());
              if (typeid (EnvironmentChangeData::Conditions_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "Conditions",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "Conditions",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }
        }

        static
        const ::xsd::cxx::tree::type_serializer_initializer< 0, char, EnvironmentChangeData >
        _xsd_EnvironmentChangeData_type_serializer_init (
          "EnvironmentChangeData",
          "uri:/mil/tatrc/physiology/datamodel");


        void
        operator<< (::xercesc::DOMElement& e, const ThermalApplicationData& i)
        {
          e << static_cast< const ::mil::tatrc::physiology::datamodel::EnvironmentActionData& > (i);

          // ActiveHeating
          //
          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.ActiveHeating ())
            {
              const ThermalApplicationData::ActiveHeating_type& x (*i.ActiveHeating ());
              if (typeid (ThermalApplicationData::ActiveHeating_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "ActiveHeating",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "ActiveHeating",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }

          // ActiveCooling
          //
          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.ActiveCooling ())
            {
              const ThermalApplicationData::ActiveCooling_type& x (*i.ActiveCooling ());
              if (typeid (ThermalApplicationData::ActiveCooling_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "ActiveCooling",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "ActiveCooling",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }

          // AppliedTemperature
          //
          {
            ::xsd::cxx::tree::type_serializer_map< char >& tsm (
              ::xsd::cxx::tree::type_serializer_map_instance< 0, char > ());

            if (i.AppliedTemperature ())
            {
              const ThermalApplicationData::AppliedTemperature_type& x (*i.AppliedTemperature ());
              if (typeid (ThermalApplicationData::AppliedTemperature_type) == typeid (x))
              {
                ::xercesc::DOMElement& s (
                  ::xsd::cxx::xml::dom::create_element (
                    "AppliedTemperature",
                    "uri:/mil/tatrc/physiology/datamodel",
                    e));

                s << x;
              }
              else
                tsm.serialize (
                  "AppliedTemperature",
                  "uri:/mil/tatrc/physiology/datamodel",
                  false, true, e, x);
            }
          }

          // AppendToPrevious
          //
          {
            ::xercesc::DOMAttr& a (
              ::xsd::cxx::xml::dom::create_attribute (
                "AppendToPrevious",
                e));

            a << i.AppendToPrevious ();
          }
        }

        static
        const ::xsd::cxx::tree::type_serializer_initializer< 0, char, ThermalApplicationData >
        _xsd_ThermalApplicationData_type_serializer_init (
          "ThermalApplicationData",
          "uri:/mil/tatrc/physiology/datamodel");
      }
    }
  }
}

#include <xsd/cxx/post.hxx>

// Begin epilogue.
//
//
// End epilogue.

