forked from mirror/waf
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
554 B
C++
31 lines
554 B
C++
#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
|
|
|