Why switch/case in Packet::name??

Dear all

I think it would be easier to make name() a pure virtual …

So the compiler makes sure we provide a name ;-)

Switch/case is really against OO… I think Packet::fromRawData is fin as it is a factory ( we should think for a better name though for this method … )

What do you all think?

— cheers atul


	

Would you like to post a relpy?


This post starts a thread.
Follow-ups:
Re: Why switch/case in Packet::name??
Hi Atul, You are right that name() should be a pure virtual. It was just a fast hack some long time ago when I needed to dump some debug info. name() (more...)