Fovia C++ In-Process API
|
Public Member Functions | |
void | Attach (T *p2) |
CBComPtr () | |
CBComPtr (T *lp) | |
CBComPtr (const CBComPtr< T > &lp) | |
RRESULT | CopyTo (T **ppT) |
void | DecRef () |
T * | Detach () |
bool | IsEqualObject (IRoot *pOther) |
operator T * () const | |
bool | operator! () const |
T ** | operator& () |
T & | operator* () const |
_protptr< T > * | operator-> () const |
bool | operator< (T *pT) const |
T * | operator= (T *lp) |
T * | operator= (const CBComPtr< T > &lp) |
bool | operator== (T *pT) const |
~CBComPtr () | |
Public Attributes | |
T * | p |
Smart pointer class intended to handle the reference counting operations on an IRoot automatically. The following illustrates a typical use case for this object.
The default constructor. The internal pointer is set to NULL by default.
Constructs a new CBComPtr and initializes the internal pointer to lp. If lp is not NULL, the reference count is increased by 1.
lp | The pointer to assign to this object. NULL is acceptable here. |
Standard copy constructor. If lp's internal pointer is not NULL, the reference count of the interface is increased by 1.
lp | The CBComPtr to assign to this object. |
References CBComPtr< T >::p.
Destructs this object. If the internal pointer is not NULL, then its reference count is decreased by 1.
|
inline |
Attaches p2 to this object. If this object's internal interface pointer is not NULL, its reference count is decreased by 1 first. p2's reference count is NOT incremented by this operation.
p2 | The interface pointer to attach to this object. |
|
inline |
Copies the internal interface pointer to the pointer contained at address ppT. If the internal interface pointer is not NULL, the interface's reference count is incremented by this operation.
ppT | The address of the pointer to get this objects interface pointer. NULL will return E_POINTER. |
References BCOM_ASSERT, E_POINTER, CBComPtr< T >::p, and S_OK.
|
inline |
Explicitly decreases the reference count on the internal pointer by 1 if it is not NULL.
References IRoot::DecRef(), and CBComPtr< T >::p.
|
inline |
Detaches the internal interface pointer from this object (sets it to NULL) and returns the old value. The reference count of that interface is NOT decremented by this operation.
References CBComPtr< T >::p.
Compares this object's internal interface pointer with pOther. Returns true if they are both the same or they are both NULL, false otherwise.
pOther | The interface pointer to compare to this object's internal interface pointer. |
References IRoot::AskInterface().
|
inline |
Casting this object to its internal interface type will return the internal interface pointer.
References CBComPtr< T >::p.
|
inline |
Returns true if this object's internal interface pointer is NULL, false otherwise.
|
inline |
Returns the address of the internal interface pointer.
References BCOM_ASSERT, and CBComPtr< T >::p.
|
inline |
Dereferencing the object will return a deferencing of the internal interface pointer.
References BCOM_ASSERT, and CBComPtr< T >::p.
Use this to call a function on the internal interface. For example:
References BCOM_ASSERT, and CBComPtr< T >::p.
|
inline |
Returns true if the address of this object's internal interface pointer is less than pT, false otherwise.
pT | The interface pointer to compare to this object's interface pointer. |
|
inline |
Sets the internal interface pointer to lp. NULL is acceptable here.
lp | The interface pointer to assign to this object. NULL is acceptable here. |
Sets the internal interface pointer to the value of the internal interface pointer of lp.
lp | The CBComPtr that contains the interface pointer you wish to assign to this object. |
References CBComPtr< T >::p.
|
inline |
Returns true if the address of this object's internal interface pointer is equal to pT, false otherwise.
pT | The interface pointer to compare to this object's interface pointer. NULL is acceptable here. |
T* CBComPtr< T >::p |
The internal interface pointer. In most cases, you will not need to access this member directly.
Referenced by CBComPtr< T >::CBComPtr(), CBComPtr< T >::CopyTo(), CBComPtr< T >::DecRef(), CBComPtr< T >::Detach(), CBComPtr< T >::operator T *(), CBComPtr< T >::operator&(), CBComPtr< T >::operator*(), CBComPtr< T >::operator->(), and CBComPtr< T >::operator=().