LibreOffice Module comphelper (master) 1
|
A helper class to store interface references of different types. More...
#include <multiinterfacecontainer3.hxx>
Public Types | |
typedef key | keyType |
Public Member Functions | |
OMultiTypeInterfaceContainerHelperVar3 (::osl::Mutex &rMutex_) | |
Create a container of interface containers. More... | |
std::vector< key > | getContainedTypes () const |
Return all id's under which at least one interface is added. More... | |
bool | hasContainedTypes () const |
OInterfaceContainerHelper3< listener > * | getContainer (const key &rKey) const |
Return the container created under this key. More... | |
sal_Int32 | addInterface (const key &rKey, const css::uno::Reference< listener > &rListener) |
Inserts an element into the container with the specified key. More... | |
sal_Int32 | removeInterface (const key &rKey, const css::uno::Reference< listener > &rListener) |
Removes an element from the container with the specified key. More... | |
void | disposeAndClear (const css::lang::EventObject &rEvt) |
Call disposing on all references in the container, that support XEventListener. More... | |
void | clear () |
Remove all elements of all containers. More... | |
Private Types | |
typedef ::std::vector< std::pair< key, std::unique_ptr< OInterfaceContainerHelper3< listener > > > > | InterfaceMap |
Private Member Functions | |
InterfaceMap::const_iterator | find (const key &rKey) const |
OMultiTypeInterfaceContainerHelperVar3 (const OMultiTypeInterfaceContainerHelperVar3 &)=delete | |
OMultiTypeInterfaceContainerHelperVar3 & | operator= (const OMultiTypeInterfaceContainerHelperVar3 &)=delete |
Private Attributes | |
InterfaceMap | m_aMap |
::osl::Mutex & | rMutex |
A helper class to store interface references of different types.
This is a copy of the similar class at include/cppuhelper/interfacecontainer.h, but now uses the improved comphelper::InterfaceContainer3.
Definition at line 44 of file multiinterfacecontainer3.hxx.
|
private |
Definition at line 191 of file multiinterfacecontainer3.hxx.
typedef key comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::keyType |
Definition at line 187 of file multiinterfacecontainer3.hxx.
|
inline |
Create a container of interface containers.
rMutex | the mutex to protect multi thread access. The lifetime must be longer than the lifetime of this object. |
Definition at line 54 of file multiinterfacecontainer3.hxx.
|
privatedelete |
|
inline |
Inserts an element into the container with the specified key.
The position is not specified, thus it is not specified in which order events are fired.
rKey | the id of the container |
r | interface to be added; it is allowed, to insert null or the same interface more than once |
Definition at line 119 of file multiinterfacecontainer3.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::find(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::m_aMap, and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::rMutex.
|
inline |
Remove all elements of all containers.
Does not delete the container.
Definition at line 179 of file multiinterfacecontainer3.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::m_aMap, and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::rMutex.
|
inline |
Call disposing on all references in the container, that support XEventListener.
Then clears the container.
rEvt | the event object which is passed during disposing() call |
Definition at line 163 of file multiinterfacecontainer3.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::m_aMap, and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::rMutex.
|
inlineprivate |
Definition at line 195 of file multiinterfacecontainer3.hxx.
References end, equal(), and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::m_aMap.
Referenced by comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::addInterface(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::getContainer(), and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::removeInterface().
|
inline |
Return all id's under which at least one interface is added.
Definition at line 62 of file multiinterfacecontainer3.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::m_aMap, and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::rMutex.
|
inline |
Return the container created under this key.
The InterfaceContainerHelper exists until the whole MultiTypeContainer is destroyed.
Definition at line 91 of file multiinterfacecontainer3.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::find(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::m_aMap, and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::rMutex.
|
inline |
|
privatedelete |
|
inline |
Removes an element from the container with the specified key.
It uses interface equality to remove the interface.
rKey | the id of the container |
rxIFace | interface to be removed |
Definition at line 143 of file multiinterfacecontainer3.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::find(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::m_aMap, and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::rMutex.
|
private |
Definition at line 192 of file multiinterfacecontainer3.hxx.
Referenced by comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::addInterface(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::clear(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::disposeAndClear(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::find(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::getContainedTypes(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::getContainer(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::hasContainedTypes(), and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::removeInterface().
|
private |
Definition at line 193 of file multiinterfacecontainer3.hxx.
Referenced by comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::addInterface(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::clear(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::disposeAndClear(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::getContainedTypes(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::getContainer(), comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::hasContainedTypes(), and comphelper::OMultiTypeInterfaceContainerHelperVar3< listener, key, equalImpl >::removeInterface().