Wednesday, June 29, 2011

Singleton Class in C++

class SingletonClass
{
private:
static bool SingletonIsstanceFlag;
static SingletonClass *single;
SingletonClass()
{
//private constructor

}
public:
static SingletonClass* getInstance();
void method();
~SingletonClass()
{
SingletonIsstanceFlag = false;
}
};

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

Permission Denied while deleteing a file or folder in Windows

“ Access denied ” while deleting a directory usually means the folder is in use, protected, owned by another user, or you lack sufficient pe...