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 ListNParser internal header */
26 #ifndef IH_SENF_Packets_ListNParser_
27 #define IH_SENF_Packets_ListNParser_ 1
30 #include "ListParser.ih"
32 ///////////////////////////////ih.p////////////////////////////////////////
37 /** \brief Internal: ListPolicy defining the ListNParser parser
41 template <class ElementParser, class AuxPolicy>
42 struct ListNParser_Policy
45 typedef PacketParserBase::data_iterator data_iterator;
46 typedef PacketParserBase::state_type state_type;
47 typedef PacketParserBase::size_type size_type;
48 typedef ElementParser element_type;
49 typedef ListParser< ListNParser_Policy > parser_type;
50 typedef ListParser_Container< ListNParser_Policy > container_type;
52 static const size_type init_bytes = AuxPolicy::aux_bytes;
55 template <class Arg> ListNParser_Policy(Arg const & aux);
57 size_type bytes (data_iterator i, state_type s) const;
58 size_type size (data_iterator i, state_type s) const;
59 void init (data_iterator i, state_type s) const;
61 void construct (container_type & c) const;
62 void destruct (container_type & c) const;
63 void erase (container_type & c, data_iterator p) const;
64 void insert (container_type & c, data_iterator p) const;
65 void update (container_type const & c) const;
67 /** Internal: ListNParser iterator specific data */
68 struct iterator_data {
72 data_iterator setBegin (container_type const & c, iterator_data & d) const;
73 data_iterator setEnd (container_type const & c, iterator_data & d) const;
74 void setFromPosition (container_type const & c, iterator_data & d, data_iterator p) const;
75 data_iterator next (container_type const & c, iterator_data & d) const;
76 data_iterator raw (container_type const & c, iterator_data const & d) const;
81 template <class ElementParser, class AuxPolicy>
82 struct ListParserPolicy<ElementParser, AuxPolicy, senf::detail::auxtag::none>
84 typedef ListNParser_Policy<ElementParser, AuxPolicy> type;
87 template <class ElementParser, class AuxPolicy, class Transform>
88 struct ListParserPolicy<ElementParser, AuxPolicy,
89 senf::detail::auxtag::transform<Transform,
90 senf::detail::auxtag::none> >
92 typedef ListNParser_Policy< ElementParser,
93 TransformAuxParserPolicy<AuxPolicy, Transform> > type;
100 ///////////////////////////////ih.e////////////////////////////////////////
107 // comment-column: 40
108 // c-file-style: "senf"
109 // indent-tabs-mode: nil
110 // ispell-local-dictionary: "american"
111 // compile-command: "scons -u test"