X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FListBParser.hh;h=7b66813ed51a75e02f06bdb0ef8ad9bb87791a9e;hb=a4ebeef29f8eb69dc2dad10668d762540002b924;hp=b35ba404a1b9f7a48d1f9bf3e020882ef4352676;hpb=f73fa16ed5abdce272ac77f8b8b9ef2b9922c266;p=senf.git diff --git a/Packets/ListBParser.hh b/Packets/ListBParser.hh index b35ba40..7b66813 100644 --- a/Packets/ListBParser.hh +++ b/Packets/ListBParser.hh @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -33,56 +33,6 @@ ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { - - namespace detail { template - class ListBParser_Policy; } - - /** \brief List parser with size-field in bytes - - This list parser will parse a list which size is given by a preceding field containing the - length of the list in bytes. This struct is just a template typedef: - \code - typedef senf::VectorNParser< Parser_UInt32, Parser_UInt16 >::parser MyVectorParser; - typedef senf::ListBParser< MyVectorParser, UInt16Parser >::parser MyListParser; - \endcode - This first defines a Vector of 32 bit unsigned integers with 16 bit length counter. Then it - defines a list of such vectors with a 16 bit bytes field. - - \warning There are some caveats when working with this kind of list - \li You may only change the size of a contained element from a container wrapper. - \li While you hold a container wrapper, only access the packet through this wrapper - or a nested wrapper either for reading or writing. - - If lists are nested, you need to allocate a container wrapper for each level and may only - access the packet through the lowest-level active container wrapper. - - \implementation These restrictions are necessary to ensure correct recalculation of the - bytes field. For more info, see the comments in \ref ListBParser.ih - - \see ListParser - \ingroup parsecollection - */ - template - struct ListBParser { - typedef ListParser< detail::ListBParser_Policy > parser; - }; - - /** \brief Define ListBParser field - - This macro is a special helper to define a senf::ListBParser 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) giving the total number of bytes of the list (not the - element count). - - \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_B(name, elt_type, size_type) \ - typedef senf::ListBParser::parser BOOST_PP_CAT(name, _list_t); \ - SENF_PARSER_FIELD( name, BOOST_PP_CAT(name, _list_t) ) }