class singleton
{
public:
	//all logs come through here
	static void test()
	{
		init();
		Singleton->do_something();
	}

private:
	//only the singleton can initialize itself
	singleton();

	//the one possible instance
	static singleton * Singleton;

	static void init()
	{
		if(Singleton == 0){
			Singleton = new singleton;
		}
	}

	void do_something();
};

singleton * singleton::Singleton = 0;

singleton::singleton()
{

}

void singleton::do_something()
{

}

int main(int argc, char * argv[])
{
	singleton::test();

	return 0;
}
