11 #define P6COMPTR_H__ 1
64 operator I*()
const {
return static_cast<I*
>(
m_pRaw); }
74 return reinterpret_cast<I**
>(&
m_pRaw);
80 return reinterpret_cast<I**
>(&
m_pRaw);
94 *ppIface =
reinterpret_cast<I*
>(
m_pRaw);
108 inline I*
get()
const
110 return reinterpret_cast<I*
>(
m_pRaw);
201 return m_pRaw->queryInterface(riid,reinterpret_cast<P6VOID**>(ppIface));
235 if(pErr) (*pErr) = err;
242 if(pErr) (*pErr) = err;
259 if(pErr) (*pErr) = err;
403 #define VALIDATECOMPTR(type,smartComPtr) IID_##type, reinterpret_cast<P6R::P6VOID**>(static_cast<type**>((smartComPtr).addressofWithRelease()))
P6R::P6ERR createInstance(P6R::p6ICom *pOuter, const P6R::CID &cid, const P6R::IID &riid)
Create a new component instance and assign the result to this smart pointer.
A smart pointer implementation to help manage and use [p6]COM based interfaces.
P6R::P6ERR(* P6ASSERT)(const P6R::P6WCHAR *pszExpr, const P6R::P6CHAR *pszFile, P6R::P6UINT32 nLine)
P6API P6R::P6ERR p6CreateInstance(P6R::p6ICom *pOuter, const P6R::CID &cid, const P6R::IID &iid, P6R::P6VOID **ppIface)
Creates a single uninitialized instance of the class/interface associated with the specified componen...
p6ComPtrBase(I *pRawPtr=NULL)
Default constructor.
I * detach()
Detach the owned inteface from the smart pointer and return a dumb pointer without release() directly...
p6ComPtr< I > & operator=(I *ip)
Assign from a dumb pointer of the correct type.
P6BOOL operator!=(I *pI) const
P6VOID swap(p6ComPtrBase< I > &rhs)
Exchange ownership.
P6VOID detach(I **ppIface)
Detach the owned interface from the smart pointer without release().
P6R::P6ERR getRuntimeIface(const P6R::IID &riid)
Get an instance of a runtime interface and adding the result to this smart pointer.
p6ComPtr(p6ICom *pI)
Contruct from a dumb pointer of the correct type.
p6ComPtr()
Default constructor.
I ** addressofWithRelease()
virtual P6R::P6ERR queryInterface(const P6R::IID &iid, P6R::P6VOID **ppIface)=0
This method queries the component for a specific interface.
void attach(I *pIface)
Take ownership of a new interface without addref().
p6ComPtr(const p6ComPtr< I > &rSI)
Copy.
The base interface all [p6]COM components must derive from and implement.
p6ComPtr< I > & operator=(const p6ComPtr< I > &cp)
Assign from a smart pointer of the correct type.
P6BOOL operator==(I *pI) const
A template specialization to support the p6ICom interface.
p6ComPtr(I *ip=NULL)
Construct from a raw pointer of the correct type Must be derrived from p6ICom.
p6ComPtr< p6ICom > & operator=(const p6ComPtr< p6ICom > &cp)
Assign from a smart pointer of the correct type.
A universally unique indentifier (UUID).
P6R::P6ERR queryInterface(const P6R::IID &riid, Q **ppIface)
A type safe version of queryInterface().
p6ComPtr< p6ICom > & operator=(p6ICom *ip)
Assign from a dumb pointer of the correct type.
p6ComPtr(const P6R::CID &rclsid, const P6R::IID &riid, P6R::P6ERR *pErr=NULL)
Construct a new instance given the component ID and interface ID.
P6BOOL operator<(I *pI) const
P6UINT32 P6ERR
COM err return type see P6ERR.h.
Base class which implements common functionality for p6ComPtr and it's p6ICom specialization.
p6ComPtr(const P6R::IID &riid, P6R::P6ERR *pErr=NULL)
P6API P6R::P6ERR p6GetRuntimeIface(const P6R::IID &iid, P6R::P6VOID **ppIface)
This method is used to retreive any of the loader runtime interfaces.
p6ComPtr(p6ICom *pCom, const P6R::IID &riid, P6R::P6ERR *pErr=NULL)
Construct from the specified interface via queryInterface() This will query the interface passed in p...
p6ComPtr(const p6ComPtr< p6ICom > &smartPtr)
Copy constructor.
P6VOID swap(I **ppIface)
Exchange ownership.