LibreOffice Module comphelper (master) 1
Protected Member Functions | List of all members
comphelper::OWeakListenerAdapter< BROADCASTER, LISTENER > Class Template Referenceabstract

yet another base for weak listener adapters, this time with some type safety More...

#include <weakeventlistener.hxx>

Inheritance diagram for comphelper::OWeakListenerAdapter< BROADCASTER, LISTENER >:
[legend]
Collaboration diagram for comphelper::OWeakListenerAdapter< BROADCASTER, LISTENER >:
[legend]

Protected Member Functions

 OWeakListenerAdapter (const css::uno::Reference< css::uno::XWeak > &_rxListener, const css::uno::Reference< BROADCASTER > &_rxBroadcaster)
 ctor More...
 
css::uno::Reference< LISTENER > getListener () const
 
virtual void SAL_CALL disposing (const css::lang::EventObject &Source) override
 
virtual void disposing (std::unique_lock< std::mutex > &rGuard) override=0
 Called by dispose for subclasses to do dispose() work. More...
 
- Protected Member Functions inherited from comphelper::WeakComponentImplHelperBase
void throwIfDisposed (std::unique_lock< std::mutex > &)
 
- Protected Member Functions inherited from cppu::OWeakObject
virtual ~OWeakObject () COVERITY_NOEXCEPT_FALSE
 
void disposeWeakConnectionPoint ()
 
- Protected Member Functions inherited from comphelper::OWeakListenerAdapterBase
css::uno::Reference< css::uno::XInterface > getListener () const
 
const css::uno::Reference< css::uno::XInterface > & getBroadcaster () const
 
void resetListener ()
 
 OWeakListenerAdapterBase (const css::uno::Reference< css::uno::XWeak > &_rxListener, css::uno::Reference< css::uno::XInterface > _xBroadcaster)
 
virtual ~OWeakListenerAdapterBase ()
 

Additional Inherited Members

- Public Member Functions inherited from comphelper::WeakComponentImplHelper< LISTENER >
virtual void SAL_CALL acquire () noexcept override
 
virtual void SAL_CALL release () noexcept override
 
virtual void SAL_CALL dispose () noexcept final override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelperBase
virtual ~WeakComponentImplHelperBase () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual void disposing (std::unique_lock< std::mutex > &)
 Called by dispose for subclasses to do dispose() work. More...
 
- Public Member Functions inherited from comphelper::UnoImplBase
virtual ~UnoImplBase ()
 
- Public Member Functions inherited from cppu::OWeakObject
 OWeakObject ()
 
 OWeakObject (const OWeakObject &)
 
OWeakObject &SAL_CALL operator= (const OWeakObject &)
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) SAL_OVERRIDE
 
virtual void SAL_CALL acquire () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual void SAL_CALL release () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter () SAL_OVERRIDE
 
SAL_CALL operator css::uno::Reference< css::uno::XInterface > ()
 
- Protected Attributes inherited from comphelper::WeakComponentImplHelperBase
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
 
- Protected Attributes inherited from comphelper::UnoImplBase
std::mutex m_aMutex
 
bool m_bDisposed = false
 
- Protected Attributes inherited from cppu::OWeakObject
oslInterlockedCount m_refCount
 

Detailed Description

template<class BROADCASTER, class LISTENER>
class comphelper::OWeakListenerAdapter< BROADCASTER, LISTENER >

yet another base for weak listener adapters, this time with some type safety

Note that derived classes need to overwrite all virtual methods of their interface except XEventListener::disposing, and forward it to their master listener.

Additionally, derived classes need to add themself as listener to the broadcaster, as this can't be done in a generic way

Definition at line 100 of file weakeventlistener.hxx.

Constructor & Destructor Documentation

◆ OWeakListenerAdapter()

template<class BROADCASTER , class LISTENER >
comphelper::OWeakListenerAdapter< BROADCASTER, LISTENER >::OWeakListenerAdapter ( const css::uno::Reference< css::uno::XWeak > &  _rxListener,
const css::uno::Reference< BROADCASTER > &  _rxBroadcaster 
)
protected

ctor

Note that derived classes still need to add themself as listener to the broadcaster, as this can't be done in a generic way

Member Function Documentation

◆ disposing() [1/2]

template<class BROADCASTER , class LISTENER >
void SAL_CALL comphelper::OWeakListenerAdapter< BROADCASTER, LISTENER >::disposing ( const css::lang::EventObject &  Source)
overrideprotectedvirtual

Definition at line 168 of file weakeventlistener.hxx.

◆ disposing() [2/2]

template<class BROADCASTER , class LISTENER >
virtual void comphelper::OWeakListenerAdapter< BROADCASTER, LISTENER >::disposing ( std::unique_lock< std::mutex > &  )
overrideprotectedpure virtual

Called by dispose for subclasses to do dispose() work.

The mutex is held when called, and subclasses can unlock() the guard if necessary.

Reimplemented from comphelper::WeakComponentImplHelperBase.

◆ getListener()

template<class BROADCASTER , class LISTENER >
css::uno::Reference< LISTENER > comphelper::OWeakListenerAdapter< BROADCASTER, LISTENER >::getListener ( ) const
inlineprotected

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