Packets: Migrate VariantParser to use AuxParser/container infrstructure
[senf.git] / Packets / ListNParser.hh
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 public header */
25
26 #ifndef HH_ListNParser_
27 #define HH_ListNParser_ 1
28
29 // Custom includes
30 #include "ListParser.hh"
31 #include "AuxParser.hh"
32
33 //#include "ListNParser.mpp"
34 #include "ListNParser.ih"
35 ///////////////////////////////hh.p////////////////////////////////////////
36
37 namespace senf {
38
39     /** \brief List parser with size-field giving number of list elements
40
41         This parser will parse a list which size is giving by a preceding field containing the
42         number of list elements. This struct is just a 'template typedef':
43         \code
44         senf::VectorNParser< Parser_UInt32, Parser_UInt16 >::parser MyVectorParser;
45         senf::ListNParser< MyVectorParser, UInt16Parser >::parser MyListParser;
46         \endcode
47         This first defines a Vector of 32 bit unsigned integers with 16 bit length counter. Then it
48         defines a list of such vectors with a 16 bit size field.
49
50         \see ListParser
51         \ingroup parsecollection
52      */
53
54     /** \brief Define ListNParser field
55
56         This macro is a special helper to define a senf::ListNParser type field, a list of elements
57         of type \a elt_type (a parser type) directly preceded by a numeric size field of type \a
58         size_type (another parser type).
59
60         \param[in] name field name
61         \param[in] elt_type list element type
62         \param[in] size_type size type
63         \hideinitializer
64         \ingroup packetparsermacros
65      */
66 }
67
68 ///////////////////////////////hh.e////////////////////////////////////////
69 #endif
70 #if !defined(HH_Packets__decls_) && !defined(HH_ListNParser_i_)
71 #define HH_ListNParser_i_
72 //#include "ListNParser.cci"
73 #include "ListNParser.ct"
74 #include "ListNParser.cti"
75 #endif
76
77 \f
78 // Local Variables:
79 // mode: c++
80 // fill-column: 100
81 // comment-column: 40
82 // c-file-style: "senf"
83 // indent-tabs-mode: nil
84 // ispell-local-dictionary: "american"
85 // compile-command: "scons -u test"
86 // End: