9 #ifndef P6REFCOUNTED_H__
10 #define P6REFCOUNTED_H__ 1
27 #define INTERFACE p6IRefCounted
67 operator I*()
const {
return static_cast<I*
>(
m_pRaw); }
78 return reinterpret_cast<I**
>(&
m_pRaw);
84 return reinterpret_cast<I**
>(&
m_pRaw);
91 *pRaw =
reinterpret_cast<I*
>(
m_pRaw);
105 return reinterpret_cast<I*
>(
m_pRaw);
193 #endif // __cplusplus
#define P6DECLAREIF(iface)
unsigned char P6BOOL
Boolean type.
virtual P6INT32 release(void)=0
P6BOOL operator==(I *pI) const
P6ERR(P6CCALL * P6ASSERT)(const P6WCHAR *pszExpr, const P6CHAR *pszFile, P6UINT32 nLine)
void attach(I *pIface)
Take ownership of a new interface without addref().
void swap(I **pRaw)
Exchange ownership.
#define P6DECLCOMMETHOD_(type, method)
p6RefCounted(I *ip=0)
Construct from a raw pointer of the correct type Must be derrived from p6ICom.
I ** addressofWithRelease()
void swap(p6RefCountedBase< I > &rhs)
Exchange ownership.
I * detach()
Detach the owned inteface and return a dumb pointer without release().
This is a non-COM based interface that is used (along with the P6_REFCOUNTED macro) for reference cou...
p6RefCounted(const p6RefCounted< I > &rSI)
Copy.
p6RefCounted< I > & operator=(I *ip)
Assign from a dumb pointer of the correct type.
p6RefCounted< I > & operator=(const p6RefCounted< I > &cp)
Assign from a smart pointer of the correct type.
P6BOOL operator<(I *pI) const
P6BOOL operator!=(I *pI) const
p6RefCountedBase(I *pRawPtr=NULL)
void detach(I **ppIface)
Detach the owned interface without release().