Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <BALIBA.H>

Class TLibAssoc

class TLibAssoc : public TLibAssocBase;

Description

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.

Derivation

Members

Defined in TLibAssoc:

Inherited from TLibAssocBase:


Construction and destruction


TLibAssoc()

inline TLibAssoc();

Description

Default constructor.

An association between a DLL and a class instance can be made after construction using the TLibAssoc::Set(const RLibrary &,T *) function.


TLibAssoc(const RLibrary &,T *)

inline TLibAssoc(const RLibrary &aLib, T *aClass);

Description

Constructs the object taking the specified DLL and an instance of the specified class.

Parameters

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.

[Top]


Member functions


Set(const RLibrary &,T *)

inline void Set(const RLibrary &aLib, T *aClass);

Description

Makes an association between the specified DLL and an instance of the specified class.

Parameters

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.


Unload()

inline void Unload();

Description

Deletes the class instance and calls Close() on the associated DLL.

See also:


operator TCleanupItem()

inline operator TCleanupItem();

Description

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(TAny *). The cleanup operation is represented by the private static function TLibAssoc::Cleanup(TAny *).

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);

Return value

See also:


operator TLibAssoc *()

operator TLibAssoc *();

Description

Return value


Ptr()

inline T* Ptr();

Description

Gets a pointer to the class instance.

Return value

T *

A pointer to the class instance.


PtrC()const

inline const T* PtrC() const;

Description

Gets a pointer to the const class instance.

Return value

const T *

A pointer to the const class instance.


operator T *()

inline operator T *();

Description

Conversion operator.

Invoked by the compiler when a TLibAssoc<T> type is passed to a function that is prototyped to take a T* type.

Return value


operator const T *()const

inline operator const T *() const;

Description

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.

Return value


operator->()

inline T* operator->();

Description

Dereferencing operator.

Return value

T *

A pointer to the class instance.


operator->()const

inline const T* operator->() const;

Description

Const dereferencing operator.

Return value

const T *

A pointer to the const class instance.