blob: 5f86f22e88aa6812066a5be633166d29cc512310 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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();
};
|