I guess you need to go back to OOP basics... All you need is to have a base class, possibly pure virtual (i.e abstract, an interface, ...), for instance AbstractNet, which would define the base API of all network classes (e.g read(), write(), ...) and all other classes would inherit from that base class and reimplement the proper methods.
Then "declaring a variable as polymorphic" boils down to declaring it as a pointer to an object of the base class.




Reply With Quote
Bookmarks