summaryrefslogtreecommitdiff
path: root/ThirdParty/StaticConstructor/StaticConstructorSample/MyClass.h
diff options
context:
space:
mode:
Diffstat (limited to 'ThirdParty/StaticConstructor/StaticConstructorSample/MyClass.h')
-rw-r--r--ThirdParty/StaticConstructor/StaticConstructorSample/MyClass.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/ThirdParty/StaticConstructor/StaticConstructorSample/MyClass.h b/ThirdParty/StaticConstructor/StaticConstructorSample/MyClass.h
new file mode 100644
index 0000000..5f86f22
--- /dev/null
+++ b/ThirdParty/StaticConstructor/StaticConstructorSample/MyClass.h
@@ -0,0 +1,36 @@
+// MyClass.h
+//
+#include <string>
+#include <StaticConstructor.h>
+
+
+class MyClass
+{
+protected:
+ // Declaration of protected static data members:
+ // Cannot be initialized here (C++ language limitation)
+ static void* mpStaticMemory;
+ static const double mPI;
+ static std::string mStaticStr;
+
+public:
+ // Static function members to get the static data members (to unify the Tests):
+ static const double& PI() { return mPI; };
+ static std::string& StaticStr() { return mStaticStr; };
+
+public:
+ // Default Constructor:
+ MyClass();
+
+ // Destructor:
+ virtual ~MyClass();
+
+ // Static Constructor:
+ // (Should be called by INVOKE_STATIC_CONSTRUCTOR macro in the CPP file)
+ STATIC_CONSTRUCTOR();
+
+ // Static Destructor:
+ // (Should be called by INVOKE_STATIC_CONSTRUCTOR macro in the CPP file)
+ STATIC_DESTRUCTOR();
+};
+