X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FGenericTLV.hh;h=e14f5c6f201bc8b4c4fa138dc00be85705a77ac7;hb=482523171f06cf239fd7e8c991f81711c02cf0ba;hp=e8e1bb586ea6659ef5521077c1622708cc4c480f;hpb=cf48e83de9d4793ca5bd67d1e5acdb5b20968638;p=senf.git diff --git a/senf/Packets/GenericTLV.hh b/senf/Packets/GenericTLV.hh index e8e1bb5..e14f5c6 100644 --- a/senf/Packets/GenericTLV.hh +++ b/senf/Packets/GenericTLV.hh @@ -183,14 +183,14 @@ namespace senf { namespace detail { template struct GenericTLVParserRegistry_EntryBase { - virtual void dump(std::ostream & os, GenericTLVParserBase const & parser) = 0; + virtual void dump(GenericTLVParserBase const & parser, std::ostream & os) = 0; }; template struct GenericTLVParserRegistry_Entry : GenericTLVParserRegistry_EntryBase { - virtual void dump(std::ostream & os, GenericTLVParserBase const & parser); + virtual void dump(GenericTLVParserBase const & parser, std::ostream & os); }; } @@ -208,14 +208,25 @@ namespace senf { using senf::singleton >::instance; friend class senf::singleton >; + template + struct RegistrationProxy { + RegistrationProxy(); + }; + template void registerParser(); - void dump(std::ostream & os, GenericTLVParserBase const & parser); + void dump(GenericTLVParserBase const & parser, std::ostream & os); }; + +# define SENF_PACKET_TLV_REGISTRY_REGISTER( ConreteTLVParser ) \ + namespace { \ + ConreteTLVParser::Registry::RegistrationProxy \ + BOOST_PP_CAT(tlvparserRegistration_, __LINE__); \ + } + } - ///////////////////////////////hh.e//////////////////////////////////////// //#include "GenericTLV.cci" #include "GenericTLV.ct"