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 ListNParser internal header */
31 #ifndef IH_SENF_Packets_ListNParser_
32 #define IH_SENF_Packets_ListNParser_ 1
35 #include "ListParser.ih"
37 //-/////////////////////////////////////////////////////////////////////////////////////////////////
42 /** \brief Internal: ListPolicy defining the ListNParser parser
46 template <class ElementParser, class AuxPolicy>
47 struct ListNParser_Policy
50 typedef ListNParser_Policy<
51 ElementParser, typename AuxPolicy::ParserPolicy> parser_policy;
52 typedef ListNParser_Policy<
53 ElementParser, typename AuxPolicy::WrapperPolicy> container_policy;
54 typedef PacketParserBase::data_iterator data_iterator;
55 typedef PacketParserBase::state_type state_type;
56 typedef PacketParserBase::size_type size_type;
57 typedef ElementParser element_type;
58 typedef ListParser<parser_policy> parser_type;
59 typedef ListParser_Container<container_policy> container_type;
61 static const size_type init_bytes = AuxPolicy::aux_bytes;
64 template <class Arg> ListNParser_Policy(Arg const & aux);
65 ListNParser_Policy(parser_policy const & policy);
67 size_type bytes (data_iterator i, state_type s) const;
68 size_type size (data_iterator i, state_type s) const;
69 void init (data_iterator i, state_type s) const;
71 void construct (container_type & c) const;
72 void destruct (container_type & c) const;
73 void erase (container_type & c, data_iterator p) const;
74 void insert (container_type & c, data_iterator p) const;
75 void update (container_type const & c) const;
77 /** Internal: ListNParser iterator specific data */
78 struct iterator_data {
82 data_iterator setBegin (container_type const & c, iterator_data & d) const;
83 data_iterator setEnd (container_type const & c, iterator_data & d) const;
84 void setFromPosition (container_type const & c, iterator_data & d, data_iterator p) const;
85 data_iterator next (container_type const & c, iterator_data & d) const;
86 data_iterator raw (container_type const & c, iterator_data const & d) const;
91 template <class ElementParser, class AuxPolicy>
92 struct ListParserPolicy<ElementParser, AuxPolicy, senf::detail::auxtag::none>
94 typedef ListNParser_Policy<ElementParser, AuxPolicy> type;
97 template <class ElementParser, class AuxPolicy, class Transform>
98 struct ListParserPolicy<ElementParser, AuxPolicy,
99 senf::detail::auxtag::transform<Transform,
100 senf::detail::auxtag::none> >
102 typedef ListNParser_Policy< ElementParser,
103 TransformAuxParserPolicy<AuxPolicy, Transform> > type;
110 //-/////////////////////////////////////////////////////////////////////////////////////////////////
117 // comment-column: 40
118 // c-file-style: "senf"
119 // indent-tabs-mode: nil
120 // ispell-local-dictionary: "american"
121 // compile-command: "scons -u test"