LibreOffice Module comphelper (master)  1
Public Member Functions | Protected Member Functions | List of all members
comphelper::OListenerContainerBase< ListenerClass, EventClass > Class Template Referenceabstract

is a specialization of OListenerContainer which saves you some additional type casts, by making the required listener and event types template arguments. More...

#include <listenernotification.hxx>

Inheritance diagram for comphelper::OListenerContainerBase< ListenerClass, EventClass >:
[legend]
Collaboration diagram for comphelper::OListenerContainerBase< ListenerClass, EventClass >:
[legend]

Public Member Functions

 OListenerContainerBase (::osl::Mutex &_rMutex)
 
void addTypedListener (const css::uno::Reference< ListenerClass > &_rxListener)
 
void removeTypedListener (const css::uno::Reference< ListenerClass > &_rxListener)
 
bool notify (const EventClass &_rEvent)
 
- Public Member Functions inherited from comphelper::OListenerContainer
void disposing (const css::lang::EventObject &_rEventSource)
 sends a XEventObject::disposing notification to all listeners, and clears the listener container More...
 
void clear ()
 clears the container without calling <member scope="css::lang">XEventListener::disposing</member> at the listeners More...
 
bool empty () const
 determines whether the listener container is currently empty More...
 
::std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2createIterator ()
 creates an iterator for looping through all registered listeners More...
 

Protected Member Functions

virtual bool implNotify (const css::uno::Reference< css::lang::XEventListener > &_rxListener, const css::lang::EventObject &_rEvent) override
 call a single listener More...
 
virtual bool implTypedNotify (const css::uno::Reference< ListenerClass > &_rxListener, const EventClass &_rEvent)=0
 
- Protected Member Functions inherited from comphelper::OListenerContainer
 OListenerContainer (::osl::Mutex &_rMutex)
 
virtual ~OListenerContainer ()
 
void impl_addListener (const css::uno::Reference< css::lang::XEventListener > &_rxListener)
 
void impl_removeListener (const css::uno::Reference< css::lang::XEventListener > &_rxListener)
 
bool impl_notify (const css::lang::EventObject &_rEvent)
 notifies all listeners of the given event, using THB's notification pattern More...
 

Detailed Description

template<class ListenerClass, class EventClass>
class comphelper::OListenerContainerBase< ListenerClass, EventClass >

is a specialization of OListenerContainer which saves you some additional type casts, by making the required listener and event types template arguments.

Definition at line 220 of file listenernotification.hxx.

Constructor & Destructor Documentation

template<class ListenerClass , class EventClass >
comphelper::OListenerContainerBase< ListenerClass, EventClass >::OListenerContainerBase ( ::osl::Mutex &  _rMutex)
inline

Definition at line 223 of file listenernotification.hxx.

Member Function Documentation

template<class ListenerClass , class EventClass >
void comphelper::OListenerContainerBase< ListenerClass, EventClass >::addTypedListener ( const css::uno::Reference< ListenerClass > &  _rxListener)
inline
template<class ListenerClass , class EventClass >
virtual bool comphelper::OListenerContainerBase< ListenerClass, EventClass >::implNotify ( const css::uno::Reference< css::lang::XEventListener > &  _rxListener,
const css::lang::EventObject &  _rEvent 
)
inlineoverrideprotectedvirtual

call a single listener

Exceptions
css::uno::Exceptionif the listener throws an exception during notification. Please don't catch any listener exceptions in your implementation of this method, simply let them pass to the caller.
Parameters
_rxListenerspecifies the listener to call. Is guaranteed to not be <NULL>
_rEventthe event to broadcast. This is the same as passed to <member>notify</member>, so if your base class knows the type passed into <member>notify</member>, it can safely assume that <arg>_rEvent</arg> is also of this type.
Returns
<TRUE> if the remaining listeners should be called, <FALSE> if the notification loop should be cancelled
See also
notify

Implements comphelper::OListenerContainer.

Definition at line 245 of file listenernotification.hxx.

References comphelper::OListenerContainerBase< ListenerClass, EventClass >::implTypedNotify().

template<class ListenerClass , class EventClass >
virtual bool comphelper::OListenerContainerBase< ListenerClass, EventClass >::implTypedNotify ( const css::uno::Reference< ListenerClass > &  _rxListener,
const EventClass &  _rEvent 
)
protectedpure virtual
template<class ListenerClass , class EventClass >
bool comphelper::OListenerContainerBase< ListenerClass, EventClass >::notify ( const EventClass &  _rEvent)
inline
template<class ListenerClass , class EventClass >
void comphelper::OListenerContainerBase< ListenerClass, EventClass >::removeTypedListener ( const css::uno::Reference< ListenerClass > &  _rxListener)
inline

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