/home/martin/workspace/OpenStreetNav/src/xmlparse/xml/member-pskel.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2005-2010 Code Synthesis Tools CC
00002 //
00003 // This program was generated by CodeSynthesis XSD, an XML Schema to
00004 // C++ data binding compiler.
00005 //
00006 // This program is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License version 2 as
00008 // published by the Free Software Foundation.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00018 //
00019 // In addition, as a special exception, Code Synthesis Tools CC gives
00020 // permission to link this program with the Xerces-C++ library (or with
00021 // modified versions of Xerces-C++ that use the same license as Xerces-C++),
00022 // and distribute linked combinations including the two. You must obey
00023 // the GNU General Public License version 2 in all respects for all of
00024 // the code used other than Xerces-C++. If you modify this copy of the
00025 // program, you may extend this exception to your version of the program,
00026 // but you are not obligated to do so. If you do not wish to do so, delete
00027 // this exception statement from your version.
00028 //
00029 // Furthermore, Code Synthesis Tools CC makes a special exception for
00030 // the Free/Libre and Open Source Software (FLOSS) which is described
00031 // in the accompanying FLOSSE file.
00032 //
00033 
00034 // Begin prologue.
00035 //
00036 //
00037 // End prologue.
00038 
00039 #include "member-pskel.hxx"
00040 
00041 #include "member_type-pskel.hxx"
00042 
00043 // member_pskel
00044 //
00045 
00046 void member_pskel::
00047 type_parser (::member_type_pskel& p)
00048 {
00049   this->type_parser_ = &p;
00050 }
00051 
00052 void member_pskel::
00053 ref_parser (::xml_schema::long_pskel& p)
00054 {
00055   this->ref_parser_ = &p;
00056 }
00057 
00058 void member_pskel::
00059 role_parser (::xml_schema::string_pskel& p)
00060 {
00061   this->role_parser_ = &p;
00062 }
00063 
00064 void member_pskel::
00065 parsers (::member_type_pskel& type,
00066          ::xml_schema::long_pskel& ref,
00067          ::xml_schema::string_pskel& role)
00068 {
00069   this->type_parser_ = &type;
00070   this->ref_parser_ = &ref;
00071   this->role_parser_ = &role;
00072 }
00073 
00074 member_pskel::
00075 member_pskel ()
00076 : type_parser_ (0),
00077   ref_parser_ (0),
00078   role_parser_ (0),
00079   v_state_attr_stack_ (sizeof (v_state_attr_), &v_state_attr_first_)
00080 {
00081 }
00082 
00083 // member_pskel
00084 //
00085 
00086 void member_pskel::
00087 type (const osm::ObjectType&)
00088 {
00089 }
00090 
00091 void member_pskel::
00092 ref (long long)
00093 {
00094 }
00095 
00096 void member_pskel::
00097 role (const ::std::string&)
00098 {
00099 }
00100 
00101 #include <cassert>
00102 
00103 // Attribute validation and dispatch functions for member_pskel.
00104 //
00105 bool member_pskel::
00106 _attribute_impl_phase_one (const ::xml_schema::ro_string& ns,
00107                            const ::xml_schema::ro_string& n,
00108                            const ::xml_schema::ro_string& s)
00109 {
00110   if (n == "type" && ns.empty ())
00111   {
00112     if (this->type_parser_)
00113     {
00114       this->type_parser_->pre ();
00115       this->type_parser_->_pre_impl ();
00116       this->type_parser_->_characters (s);
00117       this->type_parser_->_post_impl ();
00118       const osm::ObjectType& tmp (this->type_parser_->post_member_type ());
00119       this->type (tmp);
00120     }
00121 
00122     static_cast< v_state_attr_* > (this->v_state_attr_stack_.top ())->type = true;
00123     return true;
00124   }
00125 
00126   if (n == "ref" && ns.empty ())
00127   {
00128     if (this->ref_parser_)
00129     {
00130       this->ref_parser_->pre ();
00131       this->ref_parser_->_pre_impl ();
00132       this->ref_parser_->_characters (s);
00133       this->ref_parser_->_post_impl ();
00134       long long tmp (this->ref_parser_->post_long ());
00135       this->ref (tmp);
00136     }
00137 
00138     static_cast< v_state_attr_* > (this->v_state_attr_stack_.top ())->ref = true;
00139     return true;
00140   }
00141 
00142   if (n == "role" && ns.empty ())
00143   {
00144     if (this->role_parser_)
00145     {
00146       this->role_parser_->pre ();
00147       this->role_parser_->_pre_impl ();
00148       this->role_parser_->_characters (s);
00149       this->role_parser_->_post_impl ();
00150       const ::std::string& tmp (this->role_parser_->post_string ());
00151       this->role (tmp);
00152     }
00153 
00154     return true;
00155   }
00156 
00157   return false;
00158 }
00159 
00160 void member_pskel::
00161 _pre_a_validate ()
00162 {
00163   this->v_state_attr_stack_.push ();
00164   v_state_attr_& as = *static_cast< v_state_attr_* > (this->v_state_attr_stack_.top ());
00165 
00166   as.type = false;
00167   as.ref = false;
00168 }
00169 
00170 void member_pskel::
00171 _post_a_validate ()
00172 {
00173   v_state_attr_& as = *static_cast< v_state_attr_* > (this->v_state_attr_stack_.top ());
00174 
00175   if (!as.type)
00176     this->_expected_attribute (
00177       "", "type");
00178   if (!as.ref)
00179     this->_expected_attribute (
00180       "", "ref");
00181 
00182   this->v_state_attr_stack_.pop ();
00183 }
00184 
00185 // Begin epilogue.
00186 //
00187 //
00188 // End epilogue.
00189 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines