Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "member-pskel.hxx"
00040
00041 #include "member_type-pskel.hxx"
00042
00043
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
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
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
00186
00187
00188
00189