class TLibAssoc : public TLibAssocBase |
Associates a dynamically loadable DLL and an instance of a class that, typically, will have been created using the ordinal 1 function of that DLL.
An object of this type is useful when cleanup behaviour requires that a class instance be deleted and the associated DLL be closed.
The DLL is expected to be already open when the TLibAssoc object is created.
Public Member Functions | |
---|---|
TLibAssoc () | |
TLibAssoc (const RLibrary &, T *) | |
T * | Ptr () |
const T * | PtrC () |
void | Set (const RLibrary &, T *) |
void | Unload () |
operator T * () | |
operator TCleanupItem () | |
operator TLibAssoc * () | |
operator const T * () | |
T * | operator-> () |
const T * | operator-> () |
Private Member Functions | |
---|---|
void | Cleanup ( TAny *) |
Inherited Attributes | |
---|---|
TLibAssocBase::iPtr |
TLibAssoc | ( | ) | [inline] |
Default constructor.
An association between a DLL and a class instance can be made after construction using the Set() function.
TLibAssoc | ( | const RLibrary & | aLib, |
T * | aClass | ||
) | [inline] |
Constructs the object taking the specified DLL and an instance of the specified class.
const RLibrary & aLib | A reference to a DLL that has already been opened. |
T * aClass | A pointer to an object to be associated with the DLL. Typically, this object will have been created using the ordinal 1 function from that DLL. |
void | Cleanup | ( | TAny * | aThis | ) | [private, static] |
The cleanup operation.
The implementation deletes the class instance and calls Close() on the associated DLL.
Note that this function is internal and is not intended for use; it is documented for completeness.
TAny * aThis |
void | Set | ( | const RLibrary & | aLib, |
T * | aClass | |||
) | [inline] |
Makes an association between the specified DLL and an instance of the specified class.
const RLibrary & aLib | A reference to a DLL that has already been opened. |
T * aClass | A pointer to an object to be associated with the DLL. Typically, this object will have been created using the ordinal 1 function from that DLL. |
void | Unload | ( | ) | [inline] |
Deletes the class instance and calls Close() on the associated DLL.
operator T * | ( | ) | [inline] |
Conversion operator.
Invoked by the compiler when a TLibAssoc<T> type is passed to a function that is prototyped to take a T* type.
operator TCleanupItem | ( | ) | [inline] |
The TCleanupItem conversion operator.
Invoked by the compiler when a TLibAssoc<T> type is passed to a function that is prototyped to take a TCleanupItem type.
The most common usage is to put a cleanup item onto the cleanup stack using CleanupStack::PushL() . The cleanup operation is represented by the private static function Cleanup() .
For example, if we declare
TLibAssoc<A> a;
then we can simply put a cleanup item onto the cleanup stack by calling
CleanupStack::PushL(a);
operator const T * | ( | ) | const [inline] |
Const conversion operator.
Invoked by the compiler when a TLibAssoc<T> type is passed to a function that is prototyped to take a const T* type.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.