28524bc3aad168c37a5207a26dac2e6ef888245b
[senf.git] / Packets / ParseListN.hh
1
2 // Copyright (C) 2007 
3 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
4 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
5 //     Stefan Bund <g0dil@berlios.de>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the
19 // Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21
22 /** \file
23     \brief ParseListN public header */
24
25 #ifndef HH_ParseListN_
26 #define HH_ParseListN_ 1
27
28 // Custom includes
29 #include "ParseList.hh"
30
31 //#include "ParseListN.mpp"
32 ///////////////////////////////hh.p////////////////////////////////////////
33
34 namespace senf {
35
36     namespace detail { template <class ElementParser, class SizeParser>
37                        class Parse_ListN_Policy; }
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::Parse_VectorN< Parser_UInt32, Parser_UInt16 >::parser Parse_MyVector;
45         senf::Parse_ListN< Parse_MyVector, Parse_UInt16 >::parser Parse_MyList;
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 Parse_List
51         \ingroup parsecollection
52      */
53     template <class ElementParser, class SizeParser>
54     struct Parse_ListN {
55         typedef Parse_List< detail::Parse_ListN_Policy<ElementParser,SizeParser> > parser;
56     };
57
58 }
59
60 ///////////////////////////////hh.e////////////////////////////////////////
61 #endif
62 #if !defined(HH_Packets__decls_) && !defined(HH_ParseListN_i_)
63 #define HH_ParseListN_i_
64 //#include "ParseListN.cci"
65 #include "ParseListN.ct"
66 #include "ParseListN.cti"
67 #endif
68
69 \f
70 // Local Variables:
71 // mode: c++
72 // fill-column: 100
73 // comment-column: 40
74 // c-file-style: "senf"
75 // indent-tabs-mode: nil
76 // ispell-local-dictionary: "american"
77 // compile-command: "scons -u test"
78 // End: