X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FVariantParser.hh;h=17b0ca414445dfeaebcbb89ead5bde5424f04799;hb=b89e3166f7680755683dccee5e48cb3a820185c0;hp=8722e950f920f70a4951102e4c7b729ff27517af;hpb=ef9940d989277e814988967b0022bfdd13542045;p=senf.git diff --git a/Packets/VariantParser.hh b/Packets/VariantParser.hh index 8722e95..17b0ca4 100644 --- a/Packets/VariantParser.hh +++ b/Packets/VariantParser.hh @@ -23,10 +23,10 @@ /** \file \brief VariantParser public header */ -#ifndef HH_VariantParser_ -#define HH_VariantParser_ 1 +#ifndef HH_SENF_Packets_VariantParser_ +#define HH_SENF_Packets_VariantParser_ 1 -#ifndef HH_Packets_ +#ifndef HH_SENF_Packets_Packets_ #error "Don't include 'VariantParser.hh' directly, include 'Packets.hh'" #endif @@ -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) ...
@@ -253,8 +257,8 @@ namespace senf { ///////////////////////////////hh.e//////////////////////////////////////// #endif -#if !defined(HH_Packets__decls_) && !defined(HH_VariantParser_i_) -#define HH_VariantParser_i_ +#if !defined(HH_SENF_Packets_Packets__decls_) && !defined(HH_SENF_Packets_VariantParser_i_) +#define HH_SENF_Packets_VariantParser_i_ //#include "VariantParser.cci" #include "VariantParser.ct" #include "VariantParser.cti"