General information
Category:
Object Oriented Programming
>I'm sorry I meant to say PEMStatus() that will let you know if the method has been overridden. As far as the code goes though there is only so much you can do that would control the possible subclassing. What you really have to do is code a robust baseclass which probably won't be completely finished until the fourth or fifth subclass has been created to really put the class through its paces.
Yes PEMStatus() is the one. I implemented something with it, and then noticed that it was not necessary, as the check on the calling stack was enough : if somebody overrides the Init without calling DODEFAULT() there is not much I can do anyway, and if somebody does it with calling DODEFAULT(), I can tell from the stack that Singleton.Init was not called by GetSingleton(). Job done :-)
>The mutex code is one manner in which you can create a singleton detection code. My singleton class uses a DDE based detection method.
Unfortunately, for the moment my time for Singleton is over and I must move to other things. We will live with private vars, and I will come back to this if necessary. Good to know that it is possible though !
Thanks for everything,
David
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only