LibreOffice Module cli_ure (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
uno.util.WeakAdapter Class Reference

An XAdapter implementation that holds a weak reference (System.WeakReference) to an object. More...

Inheritance diagram for uno.util.WeakAdapter:
[legend]
Collaboration diagram for uno.util.WeakAdapter:
[legend]

Public Member Functions

 WeakAdapter (Object obj)
 ctor. More...
 
Object queryAdapted ()
 Called to obtain a hard reference o the object which is kept weakly by this instance. More...
 
void removeReference (XReference xReference)
 Called by clients to register listener which are notified when the weak object is dying. More...
 
void addReference (XReference xReference)
 Called by clients to unregister listeners. More...
 

Private Member Functions

delegate void XReference_dispose ()
 

Private Attributes

WeakReference m_weakRef
 
XReference_dispose m_XReference_dispose
 

Detailed Description

An XAdapter implementation that holds a weak reference (System.WeakReference) to an object.

Clients can register listeners (unoidl.com.sun.star.lang.XReference) which are notified when the object (the one which is kept weak) is being finalized. That is, that object is being destroyed because there are not any hard references to it.

Definition at line 33 of file WeakAdapter.cs.

Constructor & Destructor Documentation

◆ WeakAdapter()

uno.util.WeakAdapter.WeakAdapter ( Object  obj)
inline

ctor.

Parameters
objthe object that is to be held weakly

Definition at line 45 of file WeakAdapter.cs.

References uno.util.WeakAdapter.m_weakRef, and uno.util.WeakAdapter.m_XReference_dispose.

Member Function Documentation

◆ addReference()

void uno.util.WeakAdapter.addReference ( XReference  xReference)
inline

Called by clients to unregister listeners.

Parameters
xReferencea listener

Definition at line 101 of file WeakAdapter.cs.

References lock(), uno.util.WeakAdapter.m_XReference_dispose, and uno.util.WeakAdapter.XReference_dispose().

◆ queryAdapted()

Object uno.util.WeakAdapter.queryAdapted ( )
inline

Called to obtain a hard reference o the object which is kept weakly by this instance.

Returns
hard reference to the object

Definition at line 80 of file WeakAdapter.cs.

References uno.util.WeakAdapter.m_weakRef, and Object.

◆ removeReference()

void uno.util.WeakAdapter.removeReference ( XReference  xReference)
inline

Called by clients to register listener which are notified when the weak object is dying.

Parameters
xReferencea listener

Definition at line 89 of file WeakAdapter.cs.

References lock(), uno.util.WeakAdapter.m_XReference_dispose, and uno.util.WeakAdapter.XReference_dispose().

◆ XReference_dispose()

delegate void uno.util.WeakAdapter.XReference_dispose ( )
private

Member Data Documentation

◆ m_weakRef

WeakReference uno.util.WeakAdapter.m_weakRef
private

◆ m_XReference_dispose

XReference_dispose uno.util.WeakAdapter.m_XReference_dispose
private

The documentation for this class was generated from the following file: