4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief AuxParser inline template implementation */
31 //#include "AuxParser.ih"
35 #define prefix_ inline
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
38 //-/////////////////////////////////////////////////////////////////////////////////////////////////
39 // senf::detail::PrefixAuxParserPolicy<P>
42 prefix_ typename P::value_type
43 senf::detail::PrefixAuxParserPolicy<P>::aux(PacketParserBase::data_iterator i,
44 PacketParserBase::state_type s)
47 return P(i, s).value();
51 prefix_ void senf::detail::PrefixAuxParserPolicy<P>::aux(typename P::value_type const & v,
52 PacketParserBase::data_iterator i,
53 PacketParserBase::state_type s)
60 prefix_ senf::PacketParserBase::data_iterator
61 senf::detail::PrefixAuxParserPolicy<P>::adjust(PacketParserBase::data_iterator i,
62 PacketParserBase::state_type s)
65 return i+P::fixed_bytes;
68 //-/////////////////////////////////////////////////////////////////////////////////////////////////
69 // senf::detail::FixedAuxParserPolicy<P>
71 template <class P, unsigned Dist>
72 prefix_ typename P::value_type
73 senf::detail::FixedAuxParserPolicy<P,Dist>::aux(PacketParserBase::data_iterator i,
74 PacketParserBase::state_type s)
77 return P(i-Dist, s).value();
80 template <class P, unsigned Dist>
81 prefix_ void senf::detail::FixedAuxParserPolicy<P,Dist>::aux(typename P::value_type const & v,
82 PacketParserBase::data_iterator i,
83 PacketParserBase::state_type s)
86 P(i-Dist, s).value(v);
89 template <class P, unsigned Dist>
90 prefix_ senf::PacketParserBase::data_iterator
91 senf::detail::FixedAuxParserPolicy<P,Dist>::adjust(PacketParserBase::data_iterator i,
92 PacketParserBase::state_type s)
98 //-/////////////////////////////////////////////////////////////////////////////////////////////////
99 // senf::detail::DynamicAuxParserPolicy<P>
102 prefix_ senf::detail::DynamicAuxParserPolicy<P>::DynamicAuxParserPolicy(P p)
108 senf::detail::DynamicAuxParserPolicy<P>::DynamicAuxParserPolicy(WrapperPolicy const & other)
113 prefix_ typename P::value_type
114 senf::detail::DynamicAuxParserPolicy<P>::aux(PacketParserBase::data_iterator i,
115 PacketParserBase::state_type s)
122 prefix_ void senf::detail::DynamicAuxParserPolicy<P>::aux(typename P::value_type const & v,
123 PacketParserBase::data_iterator i,
124 PacketParserBase::state_type s)
131 prefix_ senf::PacketParserBase::data_iterator
132 senf::detail::DynamicAuxParserPolicy<P>::adjust(PacketParserBase::data_iterator i,
133 PacketParserBase::state_type s)
139 //-/////////////////////////////////////////////////////////////////////////////////////////////////
140 // senf::detail::DynamicWrapperAuxParserPolicy<P>
143 prefix_ senf::detail::DynamicWrapperAuxParserPolicy<P>::
144 DynamicWrapperAuxParserPolicy(ParserPolicy const & other)
149 prefix_ typename P::value_type
150 senf::detail::DynamicWrapperAuxParserPolicy<P>::aux(PacketParserBase::data_iterator i,
151 PacketParserBase::state_type s)
159 senf::detail::DynamicWrapperAuxParserPolicy<P>::aux(typename P::value_type const & v,
160 PacketParserBase::data_iterator i,
161 PacketParserBase::state_type s)
168 prefix_ senf::PacketParserBase::data_iterator
169 senf::detail::DynamicWrapperAuxParserPolicy<P>::adjust(PacketParserBase::data_iterator i,
170 PacketParserBase::state_type s)
176 //-/////////////////////////////////////////////////////////////////////////////////////////////////
177 // senf::detail::TransformAuxParserPolicy<Policy,Transform>
179 template <class Policy, class Transform>
180 prefix_ senf::detail::TransformAuxParserPolicy<Policy,Transform>::TransformAuxParserPolicy()
183 template <class Policy, class Transform>
185 prefix_ senf::detail::TransformAuxParserPolicy<Policy,Transform>::
186 TransformAuxParserPolicy(Arg const & arg)
190 template <class Policy, class Transform>
191 prefix_ typename Transform::value_type
192 senf::detail::TransformAuxParserPolicy<Policy,Transform>::aux(PacketParserBase::data_iterator i,
193 PacketParserBase::state_type s)
196 return Transform::get(Policy::aux(i,s));
199 template <class Policy, class Transform>
200 prefix_ void senf::detail::TransformAuxParserPolicy<Policy,Transform>::
201 aux(typename Transform::value_type const & v, PacketParserBase::data_iterator i,
202 PacketParserBase::state_type s)
205 Policy::aux(Transform::set(v), i, s);
208 //-/////////////////////////////////////////////////////////////////////////////////////////////////
215 // comment-column: 40
216 // c-file-style: "senf"
217 // indent-tabs-mode: nil
218 // ispell-local-dictionary: "american"
219 // compile-command: "scons -u test"