• Advertisement


This topic is now archived and is closed to further replies.

Looking for some design advice

This topic is 5209 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to write a class that will provide some event like stuff for me to coding, and now I think for 2 way to do it. (e.g. A audio class which have start(), stop(), pause() etc... and so I can code something of these event) 1) A class have all the event function, so, I can create a sub-class and override them for coding 2) Calling function pointer inside the class, and the class have some function to set the function pointer, and so, I can create a function and pass it to the class to handle the event. Which is better? In terms of overhead performance etc... And any other better idea? Wish you understand what I am talking about

Share this post

Link to post
Share on other sites

  • Advertisement