The WeakReference<> holds a weak reference to an object. More...
#include <weakref.hxx>
Public Member Functions | |
| WeakReference () | |
| Default ctor. | |
| WeakReference (const Reference< interface_type > &rRef) | |
| Copy ctor. | |
| WeakReference & | operator= (const css::uno::Reference< interface_type > &xInt) |
| Releases this reference and takes over hard reference xInt. | |
| operator Reference< interface_type > () const | |
| Gets a hard reference to the object. | |
Public Member Functions inherited from com::sun::star::uno::WeakReferenceHelper | |
| WeakReferenceHelper () | |
| Default ctor. | |
| WeakReferenceHelper (const WeakReferenceHelper &rWeakRef) | |
| Copy ctor. | |
| WeakReferenceHelper (const css::uno::Reference< css::uno::XInterface > &xInt) | |
| Initialize this reference with the hard interface reference xInt. | |
| ~WeakReferenceHelper () | |
| Releases this reference. | |
| WeakReferenceHelper & | operator= (const WeakReferenceHelper &rWeakRef) |
| Releases this reference and takes over rWeakRef. | |
| WeakReferenceHelper & | operator= (const css::uno::Reference< css::uno::XInterface > &xInt) |
| Releases this reference and takes over hard reference xInt. | |
| bool | operator== (const WeakReferenceHelper &rObj) const |
| Returns true if both weak refs reference to the same object. | |
| css::uno::Reference< css::uno::XInterface > | get () const |
| Gets a hard reference to the object. | |
| operator Reference< XInterface > () const | |
| Gets a hard reference to the object. | |
| void | clear () |
| Releases this reference. | |
The WeakReference<> holds a weak reference to an object.
That object must implement the css::uno::XWeak interface.
The WeakReference itself is not thread safe, just as Reference itself isn't, but the implementation of the listeners etc. behind it is thread-safe, so multiple threads can have their own WeakReferences to the same XWeak object.
| interface_type | type of interface |
|
inline |
Default ctor.
Creates an empty weak reference.
|
inline |
Copy ctor.
Initialize this reference with a hard reference.
| rRef | another hard ref |
|
inline |
Gets a hard reference to the object.
|
inline |
Releases this reference and takes over hard reference xInt.
If the implementation behind xInt does not support XWeak or XInt is null, then this reference is null.
| xInt | another hard reference |