This defines smart pointer to manage AddRef
and Release
calls to FCM objects. In AutoPtr<T>
, T has to be an interface derived from IFCMUnknown. AutoPtr<T>
can be used to control the lifetime of objects without explicitly calling AddRef
and Release
.
More...
#include <FCMPluginInterface.h>
|
| AutoPtr (T *p) |
| Constructs an AutoPtr<T> object. More...
|
|
| AutoPtr (const AutoPtr< T > &pObj) |
| Copy constructor for AutoPtr<T> More...
|
|
template<typename Q > |
| AutoPtr (Q *p) |
| Constructs an AutoPtr<T> object from a pointer to Q, where both T and Q have to be interfaces derived from IFCMUnknown. The construction succeeds only if the QueryInterface call for the interface T succeeds on the object passed. More...
|
|
template<typename Q > |
| AutoPtr (const AutoPtr< Q > &pObj) |
| Constructs an AutoPtr<T> object from an AutoPtr<Q> object, where both T and Q are interfaces derived from IFCMUnknown. The construction succeeds only if the QueryInterface call for the interface T succeeds on the object passed. More...
|
|
| operator T * () const |
| The operator to convert to T * .
|
|
T * | operator-> () const |
| The member access operator to get the pointer held by this object.
|
|
T ** | operator& () |
| The address operator that returns the address of pointer held by this object.
|
|
| operator bool () const |
| The operator to convert to bool. More...
|
|
bool | operator!= (T *p) const |
| The != comparison operator. More...
|
|
bool | operator== (T *p) const |
| The == comparison operator. More...
|
|
void | operator= (T *p) |
| The overloaded assignment operator to assign a pointer. More...
|
|
void | operator= (const AutoPtr< T > &pObj) |
| The overloaded assignment operator to assign an AutoPtr<T> object. More...
|
|
template<typename Q > |
void | operator= (const AutoPtr< Q > &pObj) |
| The overloaded assignment operator. to assign an AutoPtr<Q> object. More...
|
|
template<typename Q > |
void | operator= (Q *p) |
| Overloaded assignment operator. More...
|
|
void | Reset () |
| Resets the pointer after calling Release .
|
|
void | Detach () |
| Detaches the pointer without calling Release .
|
|
void | Attach (T *p) |
| Attaches the pointer without calling AddRef .
|
|
template<typename Q > |
bool | IsSameUnknown (Q *pArg) |
| Returns true if the underlying IFCMUnknown pointer this object is same as that of the argument.
|
|
template<typename T>
class FCM::AutoPtr< T >
This defines smart pointer to manage AddRef
and Release
calls to FCM objects. In AutoPtr<T>
, T has to be an interface derived from IFCMUnknown. AutoPtr<T>
can be used to control the lifetime of objects without explicitly calling AddRef
and Release
.
Constructs an AutoPtr<T>
object.
- Parameters
-
p | (IN) The pointer to object of type T. T has to be derived from IFCMUnknown The constructor in turn calls AddRef on the pointer p |
Copy constructor for AutoPtr<T>
- Parameters
-
pObj | (IN) An object of AutoPtr<T> . The constructor in turn calls AddRef on the pointer held by pObj. |
template<typename T>
template<typename Q >
Constructs an AutoPtr<T>
object from a pointer to Q, where both T and Q have to be interfaces derived from IFCMUnknown. The construction succeeds only if the QueryInterface call for the interface T succeeds on the object passed.
- Parameters
-
p | (IN) A pointer to an object of type Q. Q has to be derived from IFCMUnknown. The QueryInterface call for the interface T on the object p points to should succeed for successful construction of AutoPtr<T> . On successful construction, it calls AddRef on the pointer p. In case of failure, the AutoPtr<T> object created points to NULL. |
template<typename T>
template<typename Q >
Constructs an AutoPtr<T>
object from an AutoPtr<Q>
object, where both T and Q are interfaces derived from IFCMUnknown. The construction succeeds only if the QueryInterface call for the interface T succeeds on the object passed.
- Parameters
-
pObj | (IN) An object of AutoPtr<Q> , where Q has to be derived from IFCMUnknown. The QueryInterface call for the interface T on the object pObj should succeed for successful construction of AutoPtr<T> . On successful construction it calls AddRef on the pObj. In case of failure the AutoPtr<T> object created will point to NULL. |
The operator to convert to bool.
- Returns
- Returns true if the pointer held by this object is not NULL, else returns false.
The !=
comparison operator.
- Parameters
-
p | (IN) The pointer to compare. |
- Returns
- Returns true if the pointer
p
is not same the one held by this object.
The overloaded assignment operator to assign a pointer.
- Parameters
-
p | (IN) The pointer to assign. |
The overloaded assignment operator to assign an AutoPtr<T>
object.
- Parameters
-
pObj | (IN) The AutoPtr<T> object to assign. |
template<typename T>
template<typename Q >
The overloaded assignment operator. to assign an AutoPtr<Q>
object.
- Parameters
-
pObj | (IN) The AutoPtr<Q> object to assign. The QueryInterface call for the interface T on the object pObj should succeed. |
template<typename T>
template<typename Q >
Overloaded assignment operator.
- Parameters
-
p | (IN) The pointer to Q to assign. The QueryInterface call for the interface T on the object p should succeed. |
The == comparison operator.
- Parameters
-
p | (IN) The pointer to compare. |
- Returns
- Returns true if the pointer
p
is same as the one held by this object.
The documentation for this class was generated from the following file: