Home | History | Annotate | Download | only in internal

Lines Matching refs:ptr

109   void join(linked_ptr_internal const* ptr) {
112 linked_ptr_internal const* p = ptr;
113 while (p->next_ != ptr) p = p->next_;
115 next_ = ptr;
142 explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
146 template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
147 linked_ptr(linked_ptr const& ptr) { // NOLINT
148 assert(&ptr != this);
149 copy(&ptr);
153 template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
155 copy(&ptr);
159 linked_ptr& operator=(linked_ptr const& ptr) {
160 if (&ptr != this) {
162 copy(&ptr);
168 void reset(T* ptr = NULL) {
170 capture(ptr);
179 bool operator==(linked_ptr<U> const& ptr) const {
180 return value_ == ptr.get();
183 bool operator!=(linked_ptr<U> const& ptr) const {
184 return value_ != ptr.get();
198 void capture(T* ptr) {
199 value_ = ptr;
203 template <typename U> void copy(linked_ptr<U> const* ptr) {
204 value_ = ptr->get();
206 link_.join(&ptr->link_);
213 bool operator==(T* ptr, const linked_ptr<T>& x) {
214 return ptr == x.get();
218 bool operator!=(T* ptr, const linked_ptr<T>& x) {
219 return ptr != x.get();
226 linked_ptr<T> make_linked_ptr(T* ptr) {
227 return linked_ptr<T>(ptr);