Packets/GenericTLV: added bytes(key) member to registry
[senf.git] / senf / Packets / GenericTLV.ct
index 28ae2be..6605618 100644 (file)
@@ -134,6 +134,18 @@ prefix_ senf::PacketParserBase::size_type senf::GenericTLVParserRegistry<BasePar
         throw TLVParserNotRegisteredException();
 }
 
+template <class BaseParser, class Keytype>
+prefix_ senf::PacketParserBase::size_type senf::GenericTLVParserRegistry<BaseParser,Keytype>::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////////////////////////////////////////