Home | History | Annotate | Download | only in win

Lines Matching refs:COMPtr

50 template<typename T> class COMPtr {
52 COMPtr() : m_ptr(0) { }
53 COMPtr(T* ptr) : m_ptr(ptr) { if (m_ptr) m_ptr->AddRef(); }
54 COMPtr(AdoptCOMTag, T* ptr) : m_ptr(ptr) { }
55 COMPtr(const COMPtr& o) : m_ptr(o.m_ptr) { if (T* ptr = m_ptr) ptr->AddRef(); }
57 COMPtr(QueryTag, IUnknown* ptr) : m_ptr(copyQueryInterfaceRef(ptr)) { }
58 template<typename U> COMPtr(QueryTag, const COMPtr<U>& ptr) : m_ptr(copyQueryInterfaceRef(ptr.get())) { }
60 COMPtr(CreateTag, const IID& clsid) : m_ptr(createInstance(clsid)) { }
63 COMPtr(WTF::HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { }
66 ~COMPtr() { if (m_ptr) m_ptr->Release(); }
81 typedef T* (COMPtr::*UnspecifiedBoolType)() const;
82 operator UnspecifiedBoolType() const { return m_ptr ? &COMPtr::get : 0; }
84 COMPtr& operator=(const COMPtr&);
85 COMPtr& operator=(T*);
86 template<typename U> COMPtr& operator=(const COMPtr<U>&);
89 template<typename U> void query(const COMPtr<U>& ptr) { query(ptr.get()); }
107 template<typename T> inline void COMPtr<T>::clear()
115 template<typename T> inline T* COMPtr<T>::leakRef()
122 template<typename T> inline T* COMPtr<T>::createInstance(const IID& clsid)
130 template<typename T> inline T* COMPtr<T>::copyQueryInterfaceRef(IUnknown* ptr)
140 template<typename T> template<typename U> inline HRESULT COMPtr<T>::copyRefTo(U** ptr)
150 template<typename T> inline void COMPtr<T>::adoptRef(T *ptr)
157 template<typename T> inline COMPtr<T>& COMPtr<T>::operator=(const COMPtr<T>& o)
169 template<typename T> template<typename U> inline COMPtr<T>& COMPtr<T>::operator=(const COMPtr<U>& o)
181 template<typename T> inline COMPtr<T>& COMPtr<T>::operator=(T* optr)
192 template<typename T, typename U> inline bool operator==(const COMPtr<T>& a, const COMPtr<U>& b)
197 template<typename T, typename U> inline bool operator==(const COMPtr<T>& a, U* b)
202 template<typename T, typename U> inline bool operator==(T* a, const COMPtr<U>& b)
207 template<typename T, typename U> inline bool operator!=(const COMPtr<T>& a, const COMPtr<U>& b)
212 template<typename T, typename U> inline bool operator!=(const COMPtr<T>& a, U* b)
217 template<typename T, typename U> inline bool operator!=(T* a, const COMPtr<U>& b)
224 template<typename P> struct HashTraits<COMPtr<P> > : GenericHashTraits<COMPtr<P> > {
226 static void constructDeletedValue(COMPtr<P>& slot) { new (&slot) COMPtr<P>(HashTableDeletedValue); }
227 static bool isDeletedValue(const COMPtr<P>& value) { return value.isHashTableDeletedValue(); }
230 template<typename P> struct PtrHash<COMPtr<P> > : PtrHash<P*> {
232 static unsigned hash(const COMPtr<P>& key) { return hash(key.get()); }
234 static bool equal(const COMPtr<P>& a, const COMPtr<P>& b) { return a == b; }
235 static bool equal(P* a, const COMPtr<P>& b) { return a == b; }
236 static bool equal(const COMPtr<P>& a, P* b) { return a == b; }
239 template<typename P> struct DefaultHash<COMPtr<P> > { typedef PtrHash<COMPtr<P> > Hash; };