Fix SCons 1.2.0 build failure
[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 ///////////////////////////////ih.p////////////////////////////////////////
33
34 namespace senf {
35 namespace detail {
36
37     /** \brief Internal: ListPolicy defining the ListNParser parser
38         \internal
39         \see \ref ListNParser
40      */
41     template <class ElementParser, class AuxPolicy>
42     struct ListNParser_Policy
43         : public AuxPolicy
44     {
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;
51
52         static const size_type init_bytes = AuxPolicy::aux_bytes;
53
54         ListNParser_Policy();
55         template <class Arg> ListNParser_Policy(Arg const & aux);
56
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;
60         
61         void      erase  (container_type & c, data_iterator p) const;
62         void      insert (container_type & c, data_iterator p) const;
63         void      update (container_type const & c) const;
64
65         /** Internal: ListNParser iterator specific data */
66         struct iterator_data {
67             size_type n_;
68         };
69
70         data_iterator setBegin        (container_type const & c, iterator_data & d) const;
71         data_iterator setEnd          (container_type const & c, iterator_data & d) const;
72         void          setFromPosition (container_type const & c, iterator_data & d, data_iterator p) const;
73         data_iterator next            (container_type const & c, iterator_data & d) const;
74         data_iterator raw             (container_type const & c, iterator_data const & d) const;
75     };
76
77 #ifndef DOXYGEN
78
79     template <class ElementParser, class AuxPolicy>
80     struct ListParserPolicy<ElementParser, AuxPolicy, senf::detail::auxtag::none>
81     {
82         typedef ListNParser_Policy<ElementParser, AuxPolicy> type;
83     };
84
85     template <class ElementParser, class AuxPolicy, class Transform>
86     struct ListParserPolicy<ElementParser, AuxPolicy, 
87                             senf::detail::auxtag::transform<Transform, 
88                                                             senf::detail::auxtag::none> >
89     {
90         typedef ListNParser_Policy< ElementParser,
91                                     TransformAuxParserPolicy<AuxPolicy, Transform> > type;
92     };
93
94 #endif
95
96 }}
97
98 ///////////////////////////////ih.e////////////////////////////////////////
99 #endif
100
101 \f
102 // Local Variables:
103 // mode: c++
104 // fill-column: 100
105 // comment-column: 40
106 // c-file-style: "senf"
107 // indent-tabs-mode: nil
108 // ispell-local-dictionary: "american"
109 // compile-command: "scons -u test"
110 // End: