Hi Atul,
The chain of responsibility sounds interesting! I’ll check your patch.
I think we’ll anyway need to know the type because the users of BDecoder like Torrent (file) or TrackerResponse will have to parse the raw data and they’ll need BDecoder for that. Depending on the context a BInt as a BItem or a BDictionary as a BItem may be expected. Using the generalization BItem in the generic BDecoder and then using the specializations at the more specific Torrent or TrackerResponse is IMHO perfectly fine as far as OO is concerned.
So my question is whether there are any arguments against using typeid(). If not than we should better use the language features instead of implementing our own “type system” using the pure virtual type().
Regards,
Peter
