X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FGenericTLV.ct;h=6605618a17be93b8f6e64490200e311985867c5d;hb=47d8fe245087b57098115b66094872cfffb8cbed;hp=fb59a100049c13e91d17ccbd55887e8133fa0797;hpb=bea7cfcf3d02688ece159d76890acfe2d0051d71;p=senf.git diff --git a/senf/Packets/GenericTLV.ct b/senf/Packets/GenericTLV.ct index fb59a10..6605618 100644 --- a/senf/Packets/GenericTLV.ct +++ b/senf/Packets/GenericTLV.ct @@ -104,7 +104,7 @@ prefix_ void senf::GenericTLVParserRegistry::registerParser( template prefix_ void senf::GenericTLVParserRegistry::dump( - GenericTLVParserBase const & parser, std::ostream & os) + GenericTLVParser const & parser, std::ostream & os) const { typename Map::const_iterator i (map_.find( parser.type())); @@ -114,7 +114,7 @@ prefix_ void senf::GenericTLVParserRegistry::dump( template prefix_ void senf::GenericTLVParserRegistry::dump( - GenericTLVParserBase const & parser, Keytype const & key, std::ostream & os) + GenericTLVParser const & parser, Keytype const & key, std::ostream & os) const { typename Map::const_iterator i (map_.find( key)); @@ -122,6 +122,32 @@ prefix_ void senf::GenericTLVParserRegistry::dump( (i->second)->dump(parser, os); } +template +prefix_ senf::PacketParserBase::size_type senf::GenericTLVParserRegistry::bytes( + GenericTLVParser const & parser) + const +{ + typename Map::const_iterator i (map_.find( parser.type())); + if (i != map_.end()) + return (i->second)->bytes(parser); + else + throw TLVParserNotRegisteredException(); +} + +template +prefix_ senf::PacketParserBase::size_type senf::GenericTLVParserRegistry::bytes( + GenericTLVParser const & parser, Keytype const & key) + const +{ + typename Map::const_iterator i (map_.find( key)); + if (i != map_.end()) + return (i->second)->bytes(parser); + else + throw TLVParserNotRegisteredException(); +} + + + ///////////////////////////////ct.e//////////////////////////////////////// #undef prefix_