source:
trunk/testcase/456/class.cpp@
1456
| Last change on this file since 1456 was 823, checked in by , 22 years ago | |
|---|---|
|
|
| File size: 1.2 KB | |
| Line | |
|---|---|
| 1 | |
| 2 | class ParentClass |
| 3 | { |
| 4 | private: |
| 5 | int iPrivate; |
| 6 | static char *pszPrivateStatic; |
| 7 | |
| 8 | protected: |
| 9 | int iProtected; |
| 10 | static char *pszProtectedStatic; |
| 11 | |
| 12 | public: |
| 13 | static char *pszPublicStatic; |
| 14 | static long lPublicStatic; |
| 15 | int iPublic; |
| 16 | |
| 17 | ParentClass() |
| 18 | { |
| 19 | iPublic = 1; |
| 20 | iProtected = 2; |
| 21 | iPrivate = 3; |
| 22 | } |
| 23 | |
| 24 | virtual ~ParentClass() |
| 25 | { |
| 26 | iPublic = -1; |
| 27 | iProtected = -2; |
| 28 | iPrivate = -3; |
| 29 | } |
| 30 | |
| 31 | virtual int get() const |
| 32 | { |
| 33 | return iProtected + iPrivate; |
| 34 | } |
| 35 | |
| 36 | virtual void set(int i) |
| 37 | { |
| 38 | iPublic = i; |
| 39 | iProtected = i + 1; |
| 40 | iPrivate = i + 2; |
| 41 | } |
| 42 | |
| 43 | int getPrivate(void) |
| 44 | { |
| 45 | return iPrivate; |
| 46 | } |
| 47 | }; |
| 48 | char *ParentClass::pszPrivateStatic = "PrivateStatic"; |
| 49 | char *ParentClass::pszProtectedStatic = "ProtectedStatic"; |
