3 #ifndef INCLUDED_CPPUHELPER_WEAKREF_HXX
4 #define INCLUDED_CPPUHELPER_WEAKREF_HXX
11 #include "com/sun/star/uno/XInterface.hpp"
24 class OWeakRefListener;
51 #if defined LIBO_INTERNAL_ONLY
53 { other.m_pImpl =
nullptr; }
61 WeakReferenceHelper(
const css::uno::Reference< css::uno::XInterface > & xInt );
63 #if defined LIBO_INTERNAL_ONLY
70 WeakReferenceHelper(
const css::uno::Reference< css::uno::XWeak > & xWeak );
75 ~WeakReferenceHelper();
81 WeakReferenceHelper & SAL_CALL operator = (
const WeakReferenceHelper & rWeakRef );
83 #if defined LIBO_INTERNAL_ONLY
84 WeakReferenceHelper & operator =(WeakReferenceHelper && other);
93 WeakReferenceHelper & SAL_CALL operator = (
94 const css::uno::Reference< css::uno::XInterface > & xInt );
96 #if defined LIBO_INTERNAL_ONLY
103 WeakReferenceHelper & operator = (
104 const css::uno::Reference< css::uno::XWeak > & xWeak );
113 {
return (
get() == rObj.
get()); }
119 css::uno::Reference< css::uno::XInterface > SAL_CALL
get()
const;
132 void SAL_CALL clear();
136 OWeakRefListener * m_pImpl;
151 template<
class interface_type >
178 const css::uno::Reference< interface_type > & xInt )
181 #if defined LIBO_INTERNAL_ONLY
189 const css::uno::Reference< css::uno::XWeak > & xWeak )
The WeakReferenceHelper holds a weak reference to an object.
Definition: weakref.hxx:36
WeakReference(const Reference< interface_type > &rRef)
Copy ctor.
Definition: weakref.hxx:165
static SAL_WARN_UNUSED_RESULT Reference< interface_type > query(const BaseReference &rRef)
Queries given interface reference for type interface_type.
Definition: Reference.hxx:353
WeakReferenceHelper & operator=(const WeakReferenceHelper &rWeakRef)
Releases this reference and takes over rWeakRef.
The WeakReference<> holds a weak reference to an object.
Definition: weakref.hxx:152
WeakReference()
Default ctor.
Definition: weakref.hxx:157
bool operator==(const Any &rAny, const C &value)
Template equality operator: compares set value of left side any to right side value.
Definition: Any.hxx:642
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:567
#define CPPUHELPER_DLLPUBLIC
Definition: cppuhelperdllapi.h:12
css::uno::Reference< css::uno::XInterface > get() const
Gets a hard reference to the object.
WeakReferenceHelper()
Default ctor.
Definition: weakref.hxx:41
Template reference class for interface type derived from BaseReference.
Definition: unotype.hxx:23