one function to send them all
Okay I have one class called landscapeClient that sends to data across a network to a server.
Now, I want to send several different types of classes through just one function.
The current prototype that I have at the moment is:
landscape client &operator<<( const messagePacket * );
landscape client operator>>( messagePacket * );
messagePacket is the base class that all of the different types of messages are derived from, though only part of the variables defined in the messagePacket class are sent. Thus not all of the information is getting through.
as the aformentioned functions that are a part of the landscapeClient class only need to have the prototype changed from messagePacket * to textMessagePacket * in order to accept and send the full class.
I have tried templating the functions, though the linker stuffs up and complains bitterly.
Any suggestions as to how this can be fixed will be greately appreciated.