X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FParseVec.ih;h=2937351f6114996e01c785ea81db28604f6999c6;hb=688f3266c15bd532194fe81e704c0a2cf320375a;hp=339b8f4184f79eb9b9c487e92b595bb54aafb93c;hpb=a3d3979b7daaf22ea63ca356edbfa8047dff7b78;p=senf.git diff --git a/Packets/ParseVec.ih b/Packets/ParseVec.ih index 339b8f4..2937351 100644 --- a/Packets/ParseVec.ih +++ b/Packets/ParseVec.ih @@ -37,14 +37,14 @@ namespace detail { This is the sizer policy used by Parse_VectorN */ - template + template struct Parse_VectorN_Sizer { typedef PacketParserBase::size_type size_type; typedef PacketParserBase::data_iterator iterator; typedef PacketParserBase::state_type state_type; - static const size_type init_bytes = SizeParser::fixed_bytes; + static const size_type init_bytes = 0; size_type size (iterator i, state_type s) const; void size (iterator i, state_type s, size_type v) const; @@ -53,6 +53,14 @@ namespace detail { void init (iterator i, state_type s) const; }; +# define SENF_PARSER_VEC_N_I(field, name, size, elt_type) \ + typedef senf::Parse_VectorN< elt_type, \ + BOOST_PP_CAT(size, _t), \ + SENF_PARSER_CURRENT_FIXED_OFFSET() \ + - SENF_PARSER_FIXED_OFFSET(size) \ + >::parser BOOST_PP_CAT(name, _vec_t); \ + field( name, BOOST_PP_CAT(name, _vec_t) ) + }} ///////////////////////////////ih.e////////////////////////////////////////