Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifdef DPTR_CLASS_NAME
00011 #undef DPTR_CLASS_NAME
00012 #endif
00013
00014 #ifdef DPTR_NAME
00015 #undef DPTR_NAME
00016 #endif
00017
00018 #ifdef DPTR_WRAPPER_NAME
00019 #undef DPTR_WRAPPER_NAME
00020 #endif
00021
00025 #define DPTR_CLASS_NAME(Class) Class::Private
00026
00030 #define DPTR_NAME Private
00031
00035 #define DPTR_WRAPPER_NAME DPrivate
00036
00037 #ifdef DECLARE_DPTR
00038 #undef DECLARE_DPTR
00039 #endif
00040
00060 #define DECLARE_DPTR(dp) \
00061 private:\
00062 class Private; \
00063 class DPrivate{\
00064 public:DPrivate();DPrivate(const DPrivate&);~DPrivate();\
00065 DPrivate&operator=(const DPrivate&);\
00066 const Private*operator->()const{return d;}\
00067 Private*operator->(){return d;}\
00068 DPrivate clone()const;\
00069 private:Private*d;\
00070 }; \
00071 DPrivate dp;
00072
00073 #ifdef DECLARE_SHARED_DPTR
00074 #undef DECLARE_SHARED_DPTR
00075 #endif
00076
00097 #define DECLARE_SHARED_DPTR(dp) \
00098 private:\
00099 class Private; \
00100 class DPrivate{\
00101 public:DPrivate();DPrivate(const DPrivate&);~DPrivate();\
00102 DPrivate&operator=(const DPrivate&);\
00103 const Private*operator->()const{return d;}\
00104 Private*operator->(){return d;}\
00105 DPrivate clone()const;\
00106 void decouple();\
00107 private:Private*d;\
00108 }; \
00109 DPrivate dp;
00110
00111
00112 #ifdef DECLARE_NONCOPY_DPTR
00113 #undef DECLARE_NONCOPY_DPTR
00114 #endif
00115
00134 #define DECLARE_NONCOPY_DPTR(dp) \
00135 private:\
00136 class Private; \
00137 class DPrivate{\
00138 public:DPrivate();~DPrivate();\
00139 const Private*operator->()const{return d;}\
00140 Private*operator->(){return d;}\
00141 private:Private*d;\
00142 DPrivate(const DPrivate&);DPrivate&operator=(const DPrivate&);\
00143 }; \
00144 DPrivate dp;