X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FParseHelpers.ih;h=f279f35bbc854d4e9eb279daaeec1e76797099da;hb=58a75247c7915bf6fa5e8205d06cdc4a9adfc537;hp=942281165245c5719dc517eb5ab8cbb4200d686a;hpb=7baaacae27c02c86ceda5c7ee41d3172d1e23ffa;p=senf.git diff --git a/Packets/ParseHelpers.ih b/Packets/ParseHelpers.ih index 9422811..f279f35 100644 --- a/Packets/ParseHelpers.ih +++ b/Packets/ParseHelpers.ih @@ -147,15 +147,19 @@ # // SENF_PARSER_I_FIELD_OFS_* # # define SENF_PARSER_I_FIELD_OFS_var(name, type, access) \ + protected: \ size_type BOOST_PP_CAT(name,_offset)() const { \ return field_offset_(static_cast*>(0)); \ } \ static size_type const BOOST_PP_CAT(name, _init_bytes) = \ - SENF_MPL_SLOT_GET(init_bytes); + SENF_MPL_SLOT_GET(init_bytes); \ + private: # # define SENF_PARSER_I_FIELD_OFS_fix(name, type, access) \ + protected: \ static size_type const BOOST_PP_CAT(name, _offset) = \ - SENF_MPL_SLOT_GET(offset); + SENF_MPL_SLOT_GET(offset); \ + private: # # //////////////////////////////////////// # // SENF_PARSER_I_ADVANCE_OFS_* @@ -180,7 +184,9 @@ return BOOST_PP_CAT(name, _next_offset)(); \ } \ SENF_MPL_SLOT_SET(init_bytes, BOOST_PP_CAT(name,_next_init_bytes)); \ + protected: \ static size_type const BOOST_PP_CAT(name, _group) = SENF_MPL_SLOT_GET(group) + isvar; \ + private: \ SENF_MPL_SLOT_SET(group, BOOST_PP_CAT(name, _group)); \ access: # @@ -195,7 +201,7 @@ # // SENF_PARSER_I_FIELD_VAL_* # # define SENF_PARSER_I_FIELD_VAL_rw(name, type, access) \ - private: \ + protected: \ BOOST_PP_CAT(name, _t) BOOST_PP_CAT(name, _)() const { \ return parse( SENF_PARSER_OFFSET(name) ); \ } \ @@ -205,7 +211,7 @@ } # # define SENF_PARSER_I_FIELD_VAL_ro(name, type, access) \ - private: \ + protected: \ BOOST_PP_CAT(name, _t) BOOST_PP_CAT(name, _)() const { \ return parse( SENF_PARSER_OFFSET(name) ); \ } \ @@ -445,15 +451,15 @@ # // SENF_PARSER_COLLECTION_I # # ifndef DOXYGEN -# - namespace senf { namespace detail { namespace auxtag { +# + namespace senf { namespace detail { namespace auxtag { struct none {}; } } } - namespace senf { namespace detail { namespace auxtag { + namespace senf { namespace detail { namespace auxtag { struct bytes {}; } } } - namespace senf { namespace detail { namespace auxtag { - template + namespace senf { namespace detail { namespace auxtag { + template struct transform {}; } } } -# +# # endif # # define SENF_PARSER_COLLECTION_TAG_GOBBLE__bytes(x) @@ -547,10 +553,10 @@ template struct DynamicAuxParserPolicy; template struct FixedAuxParserPolicy; template - struct ParserAuxPolicySelect + struct ParserAuxPolicySelect { typedef senf::detail::DynamicAuxParserPolicy type; }; template - struct ParserAuxPolicySelect + struct ParserAuxPolicySelect { typedef senf::detail::FixedAuxParserPolicy type; }; }}; # @@ -572,7 +578,7 @@ template T BOOST_PP_CAT(name, _dispatch)(boost::true_type) const \ { return parse( SENF_PARSER_OFFSET(name) ); } \ template T BOOST_PP_CAT(name, _dispatch)(boost::false_type) const \ - { return parse( aux(), SENF_PARSER_OFFSET(name) ); } \ + { return parse( BOOST_PP_CAT(aux,_)(), SENF_PARSER_OFFSET(name) ); } \ BOOST_PP_CAT(name, _t) BOOST_PP_CAT(name, _)() const \ { return BOOST_PP_CAT(name, _dispatch) ( \ boost::integral_constant()); } \