It's a design pattern. A singleton class is a class where there is only once instance of. So when you use the getInstance() method you're always getting the same object (usefull for sharing data between classes etc.).
Singelton is a "design pattern" that allows to make sure that only and exactly one instance of a specific class is ever created and used in the whole application regardles in which part of it and how often it gets requested.
It is like it is. And because it is like it is, things are like they are.
Very clever certainly, but macros are something I generally try to avoid....
I generally prefer cleaner inheritance relationships than using a template and macro as you have done here. I'm sure this is just my own personal style, so regardless, as I said, pretty clever
-Ted
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
buhatkj wrote:Very clever certainly, but macros are something I generally try to avoid....
I generally prefer cleaner inheritance relationships than using a template and macro as you have done here. I'm sure this is just my own personal style, so regardless, as I said, pretty clever
-Ted
I like the ::getInstance() singleton pattern.
Please send me an e-mail instead of a private message.