X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FParseListN.hh;h=a6cd9e0994e21e8c5187ba8fa92fcafa008127a7;hb=6116cb96ea7bdcb42b7d12165a05fcbe0687226d;hp=28524bc3aad168c37a5207a26dac2e6ef888245b;hpb=54eed72c506b09ef5b4be0b62fecedfbc0e3f261;p=senf.git diff --git a/Packets/ParseListN.hh b/Packets/ParseListN.hh index 28524bc..a6cd9e0 100644 --- a/Packets/ParseListN.hh +++ b/Packets/ParseListN.hh @@ -1,4 +1,5 @@ - +// $Id$ +// // Copyright (C) 2007 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) @@ -55,6 +56,22 @@ namespace senf { typedef Parse_List< detail::Parse_ListN_Policy > parser; }; + /** \brief Define Parse_ListN field + + This macro is a special helper to define a senf::Parse_ListN type field, a list of elements + of type \a elt_type (a parser type) directly preceded by a numeric size field of type \a + size_type (another parser type). + + \param[in] name field name + \param[in] elt_type list element type + \param[in] size_type size type + \hideinitializer + \ingroup packetparsermacros + */ +# define SENF_PARSER_LIST_N(name, elt_type, size_type) \ + typedef senf::Parse_ListN::parser BOOST_PP_CAT(name, _list_t); \ + SENF_PARSER_FIELD( name, BOOST_PP_CAT(name, _list_t) ) + } ///////////////////////////////hh.e////////////////////////////////////////