X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FVariantParser.hh;h=a76900e981f88540474a1de21b369dbd0d5c5e4f;hb=3593676775cfadb0094eb4f472c6ced0763e0068;hp=8722e950f920f70a4951102e4c7b729ff27517af;hpb=ef9940d989277e814988967b0022bfdd13542045;p=senf.git diff --git a/Packets/VariantParser.hh b/Packets/VariantParser.hh index 8722e95..a76900e 100644 --- a/Packets/VariantParser.hh +++ b/Packets/VariantParser.hh @@ -133,11 +133,11 @@ namespace senf { SENF_PARSER_PRIVATE_FIELD( type, senf::UInt8Parser ); SENF_PARSER_VARIANT( content, type, - (novalue( disable, senf::VoidPacketParser )) - ( id( uint8, senf::UInt8Parser )) - ( id( uint16, senf::UInt16Parser )) - ( id( uint24, senf::UInt24Parser )) - ( id( uint32, senf::UInt32Parser )) ); + (novalue( disable, senf::VoidPacketParser )) + ( id( uint8value, senf::UInt8Parser )) + ( id( uint16value, senf::UInt16Parser )) + ( id( uint24value, senf::UInt24Parser )) + ( id( uint32value, senf::UInt32Parser )) ); SENF_PARSER_FINALIZE(SomeParser); }; @@ -146,6 +146,10 @@ namespace senf { The variant \c content chooses one of the sub parsers depending on the \c type field. If \c type is 0, senf::VoidPacketParser is selected, if it is 1, senf::UInt8Parser and so on. + \warning Realize, that the \a chooser field is controlled by the variant parser. This field + should therefore be declared either read-only or private and must be changed only via + the variant parser. + The \a types parameter specifies the types of sub-objects supported by this variant parser. This parameter is a (Boost.Preprocessor style) sequence
(\a type) (\a type) ...