Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > contrib-backports > by-pkgid > 5449138d6297d4beefc46ffe46a8c51a > files > 364

waf-1.5.11-1mdv2009.1.noarch.rpm

#ifndef SWIGTOOLDEMO_HPP
#define SWIGTOOLDEMO_HPP

// singleton shared between test app and python
// (Note: this is a demo, remember singletons should not be used)
class TestClass
{
	public:
		static TestClass* instance()
		{
			if (_instance == 0)
				_instance = new TestClass();
			return _instance;
		}

		void destroy () { delete _instance; _instance = 0; }

	protected:
		TestClass() {};
		~TestClass(){};

	public:
		const char* test() { return "Hello World from C++\n"; }

	private:
		static TestClass* _instance;
};

#endif //SWIGTOOLDEMO_HPP