1 // Common/MyTypes.h 2 3 #ifndef __COMMON_MY_TYPES_H 4 #define __COMMON_MY_TYPES_H 5 6 #include "../../C/7zTypes.h" 7 8 typedef int HRes; 9 10 struct CBoolPair 11 { 12 bool Val; 13 bool Def; 14 CBoolPairCBoolPair15 CBoolPair(): Val(false), Def(false) {} 16 InitCBoolPair17 void Init() 18 { 19 Val = false; 20 Def = false; 21 } 22 SetTrueTrueCBoolPair23 void SetTrueTrue() 24 { 25 Val = true; 26 Def = true; 27 } 28 SetVal_as_DefinedCBoolPair29 void SetVal_as_Defined(bool val) 30 { 31 Val = val; 32 Def = true; 33 } 34 }; 35 36 #define CLASS_NO_COPY(cls) \ 37 private: \ 38 cls(const cls &); \ 39 cls &operator=(const cls &); 40 41 class CUncopyable 42 { 43 protected: CUncopyable()44 CUncopyable() {} // allow constructor 45 // ~CUncopyable() {} 46 CLASS_NO_COPY(CUncopyable) 47 }; 48 49 #define MY_UNCOPYABLE :private CUncopyable 50 // #define MY_UNCOPYABLE 51 52 #endif 53