Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / Packets / ListNParser.ih
1 // $Id$
2 //
3 // Copyright (C) 2007
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.de>
7 //
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.
12 //
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.
17 //
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.
22
23 /** \file
24     \brief ListNParser internal header */
25
26 #ifndef IH_SENF_Packets_ListNParser_
27 #define IH_SENF_Packets_ListNParser_ 1
28
29 // Custom includes
30 #include "ListParser.ih"
31
32 //-/////////////////////////////////////////////////////////////////////////////////////////////////
33
34 namespace senf {
35 namespace detail {
36
37     /** \brief Internal: ListPolicy defining the ListNParser parser
38         \internal
39         \see \ref ListParser
40      */
41     template <class ElementParser, class AuxPolicy>
42     struct ListNParser_Policy
43         : public AuxPolicy
44     {
45         typedef ListNParser_Policy<
46             ElementParser, typename AuxPolicy::ParserPolicy> parser_policy;
47         typedef ListNParser_Policy<
48             ElementParser, typename AuxPolicy::WrapperPolicy> container_policy;
49         typedef PacketParserBase::data_iterator data_iterator;
50         typedef PacketParserBase::state_type state_type;
51         typedef PacketParserBase::size_type size_type;
52         typedef ElementParser element_type;
53         typedef ListParser<parser_policy> parser_type;
54         typedef ListParser_Container<container_policy> container_type;
55
56         static const size_type init_bytes = AuxPolicy::aux_bytes;
57
58         ListNParser_Policy();
59         template <class Arg> ListNParser_Policy(Arg const & aux);
60         ListNParser_Policy(parser_policy const & policy);
61
62         size_type bytes  (data_iterator i, state_type s) const;
63         size_type size   (data_iterator i, state_type s) const;
64         void      init   (data_iterator i, state_type s) const;
65
66         void      construct (container_type & c) const;
67         void      destruct  (container_type & c) const;
68         void      erase     (container_type & c, data_iterator p) const;
69         void      insert    (container_type & c, data_iterator p) const;
70         void      update    (container_type const & c) const;
71
72         /** Internal: ListNParser iterator specific data */
73         struct iterator_data {
74             size_type n_;
75         };
76
77         data_iterator setBegin        (container_type const & c, iterator_data & d) const;
78         data_iterator setEnd          (container_type const & c, iterator_data & d) const;
79         void          setFromPosition (container_type const & c, iterator_data & d, data_iterator p) const;
80         data_iterator next            (container_type const & c, iterator_data & d) const;
81         data_iterator raw             (container_type const & c, iterator_data const & d) const;
82     };
83
84 #ifndef DOXYGEN
85
86     template <class ElementParser, class AuxPolicy>
87     struct ListParserPolicy<ElementParser, AuxPolicy, senf::detail::auxtag::none>
88     {
89         typedef ListNParser_Policy<ElementParser, AuxPolicy> type;
90     };
91
92     template <class ElementParser, class AuxPolicy, class Transform>
93     struct ListParserPolicy<ElementParser, AuxPolicy,
94                             senf::detail::auxtag::transform<Transform,
95                                                             senf::detail::auxtag::none> >
96     {
97         typedef ListNParser_Policy< ElementParser,
98                                     TransformAuxParserPolicy<AuxPolicy, Transform> > type;
99     };
100
101 #endif
102
103 }}
104
105 //-/////////////////////////////////////////////////////////////////////////////////////////////////
106 #endif
107
108 \f
109 // Local Variables:
110 // mode: c++
111 // fill-column: 100
112 // comment-column: 40
113 // c-file-style: "senf"
114 // indent-tabs-mode: nil
115 // ispell-local-dictionary: "american"
116 // compile-command: "scons -u test"
117 // End: