Hi all, I didn't figure out a better title for the question. Let me explain it better now:
The project I am working on is going to connect to a remote server, encrypt the session and send/receive data packets. I'd like to make it modular enough, so I thought it'd be nice to use 3 distinct classes. These would be:
1) A socket wrapper class with some virtual methods such as OnReceivedData() and OnConnected().
2) An inherited class of the socket wrapper, implementing the encryption of data before it is sent and decrypting data on its arrival.
3) The main object itself, which should override any one of the above classes depending upon its need to be encrypted or not, so it could receive the OnReceivedData() and OnConnected() events notification as well and act based upon it.
So the problem is HOW do I make my program to know it has to first call the event on the encryption object and then call that same event on the main object? Because I guess if I override the socket wraper with the encryption and then override the encryption with the main object, it will probably just call the main object method (it would call the OnReceivedData() directly on the main object, not passing through the decryption object first, right?).
Is this called multiple inheritance?
BTW if you think it is a bad project design, I would appreciate any better approaches. Thank you for taking your time to read this.