Re: Various compilers/OS/architectures calitko tests

Hi Petr,

I think that putting using Packet::writePayload; to these classes (which are derived from e.g. BitTorrent::Packets::Packet) would solve the “problem” - I’m just thinking, isn’t now impossible to call e.g. BitField::writePayload(); (the function from the Packet class) from the derived classes? Because if you create a new function of the same name, but with different signature in the base class and you implement only one of them in the derived class, the second one would be hidden by the first one and thus cannot be called. More details are here. I didn’t study these classes deeply, so correct me if I’m wrong.

Aha, that’s it! Even though the function overrides one of the virtual functions, it does hide the other virtual function by the same name. Would you please try adding

using PacketBase::readPayload();
using PacketBase::writePayload();

as you suggested, to e.g. class BitField and see if the warnings are gone? If yes, then I’ll modify the packet-gen templates to generate the two lines in all concrete packet classes.

Thanks in advance!

Peter

Would you like to post a relpy?


This post is a reply to:
Re: Various compilers/OS/architectures calitko tests
Hi Peter, Any idea how to solve: [snip] It appears numerous times and the cause is that Gnutella::Packets::PacketBase and BitTorrent::Packets::PacketBase implement writePayload() and define a new pure virtual function void writePayload (BinaryWriter &), (more...)

Follow-ups:
Re: Various compilers/OS/architectures calitko tests
Hi Peter, I've tried to add using PacketBase::readPayload; using PacketBase::writePayload; to all PacketBase derived classes in the BitTorrent package and related warnings ("...is hidden...") are gone, so you can modify packet templates. I've tested (more...)