LibreOffice Module chart2 (master) 1
|
Adapter that enables adding listeners as weak UNO references. More...
#include <WeakListenerAdapter.hxx>
Public Member Functions | |
WeakListenerAdapter (const css::uno::Reference< Listener > &xListener) | |
Protected Member Functions | |
virtual void SAL_CALL | disposing (const css::lang::EventObject &Source) override |
css::uno::Reference< Listener > | getListener () const |
Private Attributes | |
css::uno::WeakReference< Listener > | m_xListener |
Adapter that enables adding listeners as weak UNO references.
Thus, adding an object as listener to a broadcaster does not increase its reference count.
The helper class, of course, is held as hard reference at the broadcaster, but this should never be a problem as the adapter's life time depends on no other object.
Note that in order to remove an object as listener, you have to remove the same wrapper that you added, i.e., you should store the adapter as a member in the adapted class for later use.
Definition at line 42 of file WeakListenerAdapter.hxx.
|
inlineexplicit |
Definition at line 46 of file WeakListenerAdapter.hxx.
|
inlineoverrideprotectedvirtual |
Definition at line 52 of file WeakListenerAdapter.hxx.
References chart::WeakListenerAdapter< Listener >::m_xListener, and Source.
|
inlineprotected |
Definition at line 61 of file WeakListenerAdapter.hxx.
References chart::WeakListenerAdapter< Listener >::m_xListener.
|
private |
Definition at line 67 of file WeakListenerAdapter.hxx.
Referenced by chart::WeakListenerAdapter< Listener >::disposing(), and chart::WeakListenerAdapter< Listener >::getListener().