Lines Matching defs:RefPtr

21 // RefPtr and PassRefPtr are documented at http://webkit.org/coding/RefPtr.html
34 template<typename T> class RefPtr {
36 ALWAYS_INLINE RefPtr() : m_ptr(0) { }
37 ALWAYS_INLINE RefPtr(T* ptr) : m_ptr(ptr) { refIfNotNull(ptr); }
38 ALWAYS_INLINE explicit RefPtr(T& ref) : m_ptr(&ref) { m_ptr->ref(); }
39 ALWAYS_INLINE RefPtr(const RefPtr& o) : m_ptr(o.m_ptr) { refIfNotNull(m_ptr); }
40 template<typename U> RefPtr(const RefPtr<U>& o, EnsurePtrConvertibleArgDecl(U, T)) : m_ptr(o.get()) { refIfNotNull(m_ptr); }
43 template<typename U> RefPtr(const PassRefPtr<U>&, EnsurePtrConvertibleArgDecl(U, T));
46 RefPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { }
49 ALWAYS_INLINE ~RefPtr() { derefIfNotNull(m_ptr); }
62 typedef T* (RefPtr::*UnspecifiedBoolType);
63 operator UnspecifiedBoolType() const { return m_ptr ? &RefPtr::m_ptr : 0; }
65 RefPtr& operator=(const RefPtr&);
66 RefPtr& operator=(T*);
67 RefPtr& operator=(const PassRefPtr<T>&);
69 RefPtr& operator=(std::nullptr_t) { clear(); return *this; }
71 template<typename U> RefPtr<T>& operator=(const RefPtr<U>&);
72 template<typename U> RefPtr<T>& operator=(const PassRefPtr<U>&);
74 void swap(RefPtr&);
82 template<typename T> template<typename U> inline RefPtr<T>::RefPtr(const PassRefPtr<U>& o, EnsurePtrConvertibleArgDefn(U, T))
87 template<typename T> inline void RefPtr<T>::clear()
94 template<typename T> inline RefPtr<T>& RefPtr<T>::operator=(const RefPtr& o)
96 RefPtr ptr = o;
101 template<typename T> template<typename U> inline RefPtr<T>& RefPtr<T>::operator=(const RefPtr<U>& o)
103 RefPtr ptr = o;
108 template<typename T> inline RefPtr<T>& RefPtr<T>::operator=(T* optr)
110 RefPtr ptr = optr;
115 template<typename T> inline RefPtr<T>& RefPtr<T>::operator=(const PassRefPtr<T>& o)
117 RefPtr ptr = o;
122 template<typename T> template<typename U> inline RefPtr<T>& RefPtr<T>::operator=(const PassRefPtr<U>& o)
124 RefPtr ptr = o;
129 template<class T> inline void RefPtr<T>::swap(RefPtr& o)
134 template<class T> inline void swap(RefPtr<T>& a, RefPtr<T>& b)
139 template<typename T, typename U> inline bool operator==(const RefPtr<T>& a, const RefPtr<U>& b)
144 template<typename T, typename U> inline bool operator==(const RefPtr<T>& a, U* b)
149 template<typename T, typename U> inline bool operator==(T* a, const RefPtr<U>& b)
154 template<typename T, typename U> inline bool operator!=(const RefPtr<T>& a, const RefPtr<U>& b)
159 template<typename T, typename U> inline bool operator!=(const RefPtr<T>& a, U* b)
164 template<typename T, typename U> inline bool operator!=(T* a, const RefPtr<U>& b)
169 template<typename T, typename U> inline RefPtr<T> static_pointer_cast(const RefPtr<U>& p)
171 return RefPtr<T>(static_cast<T*>(p.get()));
174 template<typename T> inline T* getPtr(const RefPtr<T>& p)
181 using WTF::RefPtr;