LibreOffice Module unotools (master) 1
|
The WeakReference<> holds a weak reference to an object. More...
#include <weakref.hxx>
Public Member Functions | |
WeakReference () | |
Default ctor. More... | |
WeakReference (const rtl::Reference< interface_type > &rRef) | |
Copy ctor. More... | |
WeakReference (interface_type &rRef) | |
Copy ctor. More... | |
WeakReference (interface_type *pRef) | |
Copy ctor. More... | |
WeakReference & | operator= (const rtl::Reference< interface_type > &xInt) |
Releases this reference and takes over hard reference xInt. More... | |
WeakReference & | operator= (rtl::Reference< interface_type > &&xInt) |
WeakReference & | operator= (interface_type *pInt) |
rtl::Reference< interface_type > SAL_CALL | get () const |
Gets a hard reference to the object. More... | |
operator::rtl::Reference () const | |
Gets a hard reference to the object. More... | |
Public Member Functions inherited from com::sun::star::uno::WeakReferenceHelper | |
WeakReferenceHelper () | |
WeakReferenceHelper (const WeakReferenceHelper &rWeakRef) | |
WeakReferenceHelper (const css::uno::Reference< css::uno::XInterface > &xInt) | |
~WeakReferenceHelper () | |
WeakReferenceHelper &SAL_CALL | operator= (const WeakReferenceHelper &rWeakRef) |
WeakReferenceHelper &SAL_CALL | operator= (const css::uno::Reference< css::uno::XInterface > &xInt) |
bool SAL_CALL | operator== (const WeakReferenceHelper &rObj) const |
css::uno::Reference< css::uno::XInterface > SAL_CALL | get () const |
SAL_CALL | operator Reference< XInterface > () const |
void SAL_CALL | clear () |
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 | Must be a C++ implementation class type, not a UNO interface type. (See the C++20 requires-clause on the get member. That clause is not put on the class as a whole to avoid overly tight requirements on when interface_type needs to be complete.) |
Definition at line 50 of file weakref.hxx.
|
inline |
|
inline |
Copy ctor.
Initialize this reference with a hard reference.
rRef | another hard ref |
Definition at line 64 of file weakref.hxx.
References Reference.
|
inline |
Copy ctor.
Initialize this reference with a hard reference.
rRef | another hard ref |
Definition at line 73 of file weakref.hxx.
|
inline |
Copy ctor.
Initialize this reference with a hard reference.
rRef | another hard ref |
Definition at line 82 of file weakref.hxx.
References Reference.
|
inline |
Gets a hard reference to the object.
Definition at line 117 of file weakref.hxx.
References Translate::get().
|
inline |
Gets a hard reference to the object.
Definition at line 117 of file weakref.hxx.
|
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 |
Definition at line 94 of file weakref.hxx.
|
inline |
Definition at line 106 of file weakref.hxx.
|
inline |
Definition at line 100 of file weakref.hxx.