00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef lestes__std___ptr_hh___included
00029 #define lestes__std___ptr_hh___included
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include <lestes/std/mem/root_pointer.hh>
00039 #include <lestes/std/srp.hh>
00040
00041 package(lestes);
00042 package(std);
00043
00044
00045 template <typename T>
00046 class srp;
00047
00048
00049
00050
00051
00052 template <typename T>
00053 class ptr : public mem::root_pointer {
00054 #ifdef LESTES_OLD_POINTER_CONDITION
00055 #else
00056
00057
00058
00059
00060
00061
00062 struct condition {
00063
00064
00065
00066
00067
00068
00069 condition(void) {
00070 }
00071 private:
00072
00073
00074
00075
00076
00077
00078 void operator delete(void *);
00079 };
00080 #endif
00081 public:
00082
00083
00084
00085
00086
00087 typedef T pointee_type;
00088
00089 inline ptr(void);
00090
00091 inline ptr(T *a_pointer);
00092
00093 template <typename U>
00094 inline ptr(U *a_pointer);
00095
00096 inline ptr(const ptr<T> &other);
00097
00098 template <typename U>
00099 inline ptr(const ptr<U> &other);
00100
00101 template <typename U>
00102 inline ptr(const srp<U> &other);
00103
00104 inline ~ptr(void);
00105
00106 inline T *operator->(void) const;
00107
00108 inline T &operator *(void) const;
00109
00110 inline ptr<T> &operator=(T *a_pointer);
00111
00112 template <typename U>
00113 inline ptr<T> &operator=(U *a_pointer);
00114
00115 inline ptr<T> &operator=(const ptr<T> &other);
00116
00117 template <typename U>
00118 inline ptr<T> &operator=(const ptr<U> &other);
00119
00120 template <typename U>
00121 inline ptr<T> &operator=(const srp<U> &other);
00122 #ifdef LESTES_OLD_POINTER_CONDITION
00123
00124 inline operator bool(void) const;
00125 #else
00126
00127 inline operator condition *(void) const;
00128 #endif
00129
00130 inline bool operator!(void) const;
00131
00132 inline bool operator==(T *a_pointer) const;
00133
00134 template <typename U>
00135 inline bool operator==(U *a_pointer) const;
00136
00137 inline bool operator==(::std::ptrdiff_t a_pointer) const;
00138
00139 template <typename U>
00140 inline bool operator==(const ptr<U> &other) const;
00141
00142 template <typename U>
00143 inline bool operator==(const srp<U> &other) const;
00144
00145 inline bool operator!=(T *a_pointer) const;
00146
00147 template <typename U>
00148 inline bool operator!=(U *a_pointer) const;
00149
00150 inline bool operator!=(::std::ptrdiff_t a_pointer) const;
00151
00152 template <typename U>
00153 inline bool operator!=(const ptr<U> &other) const;
00154
00155 template <typename U>
00156 inline bool operator!=(const srp<U> &other) const;
00157
00158 template <typename U>
00159 inline ptr<U> dncast(void) const;
00160
00161 inline T *pointer_get(void) const;
00162
00163 inline bool operator < (const ptr<T> &) const;
00164 private:
00165
00166 inline void pointer_set(T *a_pointer);
00167 };
00168
00169 end_package(std);
00170 end_package(lestes);
00171
00172 #endif
00173