LibreOffice Module comphelper (master) 1
|
A helper class to store interface references of different types. More...
#include <multiinterfacecontainer4.hxx>
Public Types | |
typedef key | keyType |
Public Member Functions | |
OMultiTypeInterfaceContainerHelperVar4 () | |
std::vector< key > | getContainedTypes (std::unique_lock< std::mutex > &rGuard) const |
Return all id's under which at least one interface is added. More... | |
bool | hasContainedTypes (std::unique_lock< std::mutex > &rGuard) const |
OInterfaceContainerHelper4< listener > * | getContainer (std::unique_lock< std::mutex > &rGuard, const key &rKey) const |
Return the container created under this key. More... | |
sal_Int32 | addInterface (::std::unique_lock<::std::mutex > &rGuard, const key &rKey, const css::uno::Reference< listener > &rListener) |
Inserts an element into the container with the specified key. More... | |
sal_Int32 | removeInterface (::std::unique_lock<::std::mutex > &rGuard, const key &rKey, const css::uno::Reference< listener > &rListener) |
Removes an element from the container with the specified key. More... | |
void | disposeAndClear (std::unique_lock< std::mutex > &rGuard, const css::lang::EventObject &rEvt) |
Call disposing on all references in the container, that support XEventListener. More... | |
void | clear (std::unique_lock< std::mutex > &rGuard) |
Remove all elements of all containers. More... | |
Private Types | |
typedef ::std::vector< std::pair< key, std::unique_ptr< OInterfaceContainerHelper4< listener > > > > | InterfaceMap |
Private Member Functions | |
InterfaceMap::const_iterator | find (std::unique_lock< std::mutex > &rGuard, const key &rKey) const |
OMultiTypeInterfaceContainerHelperVar4 (const OMultiTypeInterfaceContainerHelperVar4 &)=delete | |
OMultiTypeInterfaceContainerHelperVar4 & | operator= (const OMultiTypeInterfaceContainerHelperVar4 &)=delete |
Private Attributes | |
InterfaceMap | m_aMap |
A helper class to store interface references of different types.
This is a copy of the code at include/comphelper/multiinterfacecontainer3.hxx, except that it (a) uses std::mutex instead of osl::Mutex and (b) does not store a reference to the mutex, but relies on the calling class to take a lock around using it.
Definition at line 39 of file multiinterfacecontainer4.hxx.
|
private |
Definition at line 185 of file multiinterfacecontainer4.hxx.
typedef key comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::keyType |
Definition at line 181 of file multiinterfacecontainer4.hxx.
|
inline |
Definition at line 42 of file multiinterfacecontainer4.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 97 of file multiinterfacecontainer4.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::find(), and comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::m_aMap.
|
inline |
Remove all elements of all containers.
Does not delete the container.
Definition at line 174 of file multiinterfacecontainer4.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::m_aMap.
|
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 135 of file multiinterfacecontainer4.hxx.
References comphelper::OInterfaceIteratorHelper4< ListenerT >::hasMoreElements(), comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::m_aMap, mutex, and comphelper::OInterfaceIteratorHelper4< ListenerT >::next().
Referenced by comphelper::OPropertySetHelper::disposing().
|
inlineprivate |
Definition at line 187 of file multiinterfacecontainer4.hxx.
References end, equal(), and comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::m_aMap.
Referenced by comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::addInterface(), comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::getContainer(), and comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::removeInterface().
|
inline |
Return all id's under which at least one interface is added.
Definition at line 46 of file multiinterfacecontainer4.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::m_aMap.
|
inline |
Return the container created under this key.
The InterfaceContainerHelper exists until the whole MultiTypeContainer is destroyed.
Definition at line 73 of file multiinterfacecontainer4.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::find(), and comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::m_aMap.
|
inline |
Definition at line 58 of file multiinterfacecontainer4.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::m_aMap.
|
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 119 of file multiinterfacecontainer4.hxx.
References comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::find(), and comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::m_aMap.
|
private |
Definition at line 186 of file multiinterfacecontainer4.hxx.
Referenced by comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::addInterface(), comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::clear(), comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::disposeAndClear(), comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::find(), comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::getContainedTypes(), comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::getContainer(), comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::hasContainedTypes(), and comphelper::OMultiTypeInterfaceContainerHelperVar4< key, listener, equalImpl >::removeInterface().