4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief AuxParser inline template implementation */
26 //#include "AuxParser.ih"
30 #define prefix_ inline
31 ///////////////////////////////cti.p///////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////////////
34 // senf::detail::PrefixAuxParserPolicy<P>
37 prefix_ typename P::value_type
38 senf::detail::PrefixAuxParserPolicy<P>::aux(PacketParserBase::data_iterator i,
39 PacketParserBase::state_type s)
42 return P(i, s).value();
46 prefix_ void senf::detail::PrefixAuxParserPolicy<P>::aux(typename P::value_type const & v,
47 PacketParserBase::data_iterator i,
48 PacketParserBase::state_type s)
55 prefix_ senf::PacketParserBase::data_iterator
56 senf::detail::PrefixAuxParserPolicy<P>::adjust(PacketParserBase::data_iterator i,
57 PacketParserBase::state_type s)
60 return i+P::fixed_bytes;
63 ///////////////////////////////////////////////////////////////////////////
64 // senf::detail::FixedAuxParserPolicy<P>
66 template <class P, unsigned Dist>
67 prefix_ typename P::value_type
68 senf::detail::FixedAuxParserPolicy<P,Dist>::aux(PacketParserBase::data_iterator i,
69 PacketParserBase::state_type s)
72 return P(i-Dist, s).value();
75 template <class P, unsigned Dist>
76 prefix_ void senf::detail::FixedAuxParserPolicy<P,Dist>::aux(typename P::value_type const & v,
77 PacketParserBase::data_iterator i,
78 PacketParserBase::state_type s)
81 P(i-Dist, s).value(v);
84 template <class P, unsigned Dist>
85 prefix_ senf::PacketParserBase::data_iterator
86 senf::detail::FixedAuxParserPolicy<P,Dist>::adjust(PacketParserBase::data_iterator i,
87 PacketParserBase::state_type s)
93 ///////////////////////////////////////////////////////////////////////////
94 // senf::detail::DynamicAuxParserPolicy<P>
97 prefix_ senf::detail::DynamicAuxParserPolicy<P>::DynamicAuxParserPolicy(P p)
103 senf::detail::DynamicAuxParserPolicy<P>::DynamicAuxParserPolicy(WrapperPolicy const & other)
108 prefix_ typename P::value_type
109 senf::detail::DynamicAuxParserPolicy<P>::aux(PacketParserBase::data_iterator i,
110 PacketParserBase::state_type s)
117 prefix_ void senf::detail::DynamicAuxParserPolicy<P>::aux(typename P::value_type const & v,
118 PacketParserBase::data_iterator i,
119 PacketParserBase::state_type s)
126 prefix_ senf::PacketParserBase::data_iterator
127 senf::detail::DynamicAuxParserPolicy<P>::adjust(PacketParserBase::data_iterator i,
128 PacketParserBase::state_type s)
134 ///////////////////////////////////////////////////////////////////////////
135 // senf::detail::DynamicWrapperAuxParserPolicy<P>
138 prefix_ senf::detail::DynamicWrapperAuxParserPolicy<P>::
139 DynamicWrapperAuxParserPolicy(ParserPolicy const & other)
144 prefix_ typename P::value_type
145 senf::detail::DynamicWrapperAuxParserPolicy<P>::aux(PacketParserBase::data_iterator i,
146 PacketParserBase::state_type s)
154 senf::detail::DynamicWrapperAuxParserPolicy<P>::aux(typename P::value_type const & v,
155 PacketParserBase::data_iterator i,
156 PacketParserBase::state_type s)
163 prefix_ senf::PacketParserBase::data_iterator
164 senf::detail::DynamicWrapperAuxParserPolicy<P>::adjust(PacketParserBase::data_iterator i,
165 PacketParserBase::state_type s)
171 ///////////////////////////////////////////////////////////////////////////
172 // senf::detail::TransformAuxParserPolicy<Policy,Transform>
174 template <class Policy, class Transform>
175 prefix_ senf::detail::TransformAuxParserPolicy<Policy,Transform>::TransformAuxParserPolicy()
178 template <class Policy, class Transform>
180 prefix_ senf::detail::TransformAuxParserPolicy<Policy,Transform>::
181 TransformAuxParserPolicy(Arg const & arg)
185 template <class Policy, class Transform>
186 prefix_ typename Transform::value_type
187 senf::detail::TransformAuxParserPolicy<Policy,Transform>::aux(PacketParserBase::data_iterator i,
188 PacketParserBase::state_type s)
191 return Transform::get(Policy::aux(i,s));
194 template <class Policy, class Transform>
195 prefix_ void senf::detail::TransformAuxParserPolicy<Policy,Transform>::
196 aux(typename Transform::value_type const & v, PacketParserBase::data_iterator i,
197 PacketParserBase::state_type s)
200 Policy::aux(Transform::set(v), i, s);
203 ///////////////////////////////cti.e///////////////////////////////////////
210 // comment-column: 40
211 // c-file-style: "senf"
212 // indent-tabs-mode: nil
213 // ispell-local-dictionary: "american"
214 // compile-command: "scons -u test"