Lines Matching refs:ptr

43   T* ptr;
52 explicit scoped_ptr(T* p = NULL): ptr(p) {} in ptr() function
56 delete ptr; in ~scoped_ptr() local
62 if (ptr != p) {
63 T* obj = ptr;
64 ptr = p;
71 assert(ptr != NULL);
72 return *ptr;
76 assert(ptr != NULL);
77 return ptr;
81 return ptr; in get()
85 T* tmp = b.ptr; in swap()
86 b.ptr = ptr; in swap()
87 ptr = tmp; in swap()
91 T* tmp = ptr; in release()
92 ptr = NULL; in release()
97 if (ptr) { in accept()
98 delete ptr; in accept() local
99 ptr = NULL; in accept()
101 return &ptr; in accept()
105 return &ptr; in use()
125 T* ptr;
134 explicit scoped_array(T* p = NULL) : ptr(p) {} in ptr() function
138 delete[] ptr; in ~scoped_array()
144 if (ptr != p) {
145 T* arr = ptr;
146 ptr = p;
153 assert(ptr != NULL);
155 return ptr[i];
159 return ptr; in get()
163 T* tmp = b.ptr; in swap()
164 b.ptr = ptr; in swap()
165 ptr = tmp; in swap()
169 T* tmp = ptr; in release()
170 ptr = NULL; in release()
175 if (ptr) { in accept()
176 delete [] ptr; in accept()
177 ptr = NULL; in accept()
179 return &ptr; in accept()
194 T* ptr;
203 explicit scoped_ptr_malloc(T* p = 0): ptr(p) {} in ptr() function
206 FF(static_cast<void*>(ptr)); in ~scoped_ptr_malloc()
210 if (ptr != p) {
211 FF(static_cast<void*>(ptr));
212 ptr = p;
217 assert(ptr != 0);
218 return *ptr;
222 assert(ptr != 0);
223 return ptr;
227 return ptr; in get()
231 T* tmp = b.ptr; in swap()
232 b.ptr = ptr; in swap()
233 ptr = tmp; in swap()
237 T* tmp = ptr; in release()
238 ptr = 0; in release()
243 if (ptr) { in accept()
244 FF(static_cast<void*>(ptr)); in accept()
245 ptr = 0; in accept()
247 return &ptr; in accept()