LibreOffice Module comphelper (master) 1
|
This is a copy of cppu::OMultiTypeInterfaceContainerHelper2 in include/cppuhelper/interfacecontainer.h, except that it uses comphelper::OInterfaceContainerHelper2, which is more efficient. More...
#include <multicontainer2.hxx>
Public Types | |
typedef css::uno::Type | keyType |
Public Member Functions | |
OMultiTypeInterfaceContainerHelper2 (::osl::Mutex &rMutex) | |
Create a container of interface containers. More... | |
~OMultiTypeInterfaceContainerHelper2 () | |
Delete all containers. More... | |
std::vector< css::uno::Type > | getContainedTypes () const |
Return all id's under which at least one interface is added. More... | |
OInterfaceContainerHelper2 * | getContainer (const css::uno::Type &rKey) const |
Return the container created under this key. More... | |
sal_Int32 | addInterface (const css::uno::Type &rKey, const css::uno::Reference< css::uno::XInterface > &r) |
Inserts an element into the container with the specified key. More... | |
sal_Int32 | removeInterface (const css::uno::Type &rKey, const css::uno::Reference< css::uno::XInterface > &rxIFace) |
Removes an element from the container with the specified key. More... | |
void | disposeAndClear (const css::lang::EventObject &rEvt) |
Call disposing on all object in the container that support XEventListener. More... | |
void | clear () |
Remove all elements of all containers. More... | |
Private Types | |
typedef std::vector< std::pair< css::uno::Type, std::unique_ptr< OInterfaceContainerHelper2 > > > | t_type2ptr |
Private Member Functions | |
t_type2ptr::iterator | findType (const css::uno::Type &rKey) |
t_type2ptr::const_iterator | findType (const css::uno::Type &rKey) const |
OMultiTypeInterfaceContainerHelper2 (const OMultiTypeInterfaceContainerHelper2 &)=delete | |
OMultiTypeInterfaceContainerHelper2 & | operator= (const OMultiTypeInterfaceContainerHelper2 &)=delete |
Private Attributes | |
t_type2ptr | m_aMap |
::osl::Mutex & | rMutex |
This is a copy of cppu::OMultiTypeInterfaceContainerHelper2 in include/cppuhelper/interfacecontainer.h, except that it uses comphelper::OInterfaceContainerHelper2, which is more efficient.
Definition at line 42 of file multicontainer2.hxx.
typedef css::uno::Type comphelper::OMultiTypeInterfaceContainerHelper2::keyType |
Definition at line 114 of file multicontainer2.hxx.
|
private |
Definition at line 118 of file multicontainer2.hxx.
comphelper::OMultiTypeInterfaceContainerHelper2::OMultiTypeInterfaceContainerHelper2 | ( | ::osl::Mutex & | rMutex | ) |
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. |
comphelper::OMultiTypeInterfaceContainerHelper2::~OMultiTypeInterfaceContainerHelper2 | ( | ) |
Delete all containers.
Definition at line 312 of file interfacecontainer2.cxx.
|
privatedelete |
sal_Int32 comphelper::OMultiTypeInterfaceContainerHelper2::addInterface | ( | const css::uno::Type & | rKey, |
const css::uno::Reference< css::uno::XInterface > & | r | ||
) |
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 353 of file interfacecontainer2.cxx.
References comphelper::OInterfaceContainerHelper2::addInterface(), findType(), m_aMap, and rMutex.
void comphelper::OMultiTypeInterfaceContainerHelper2::clear | ( | ) |
Remove all elements of all containers.
Does not delete the container.
Definition at line 410 of file interfacecontainer2.cxx.
void comphelper::OMultiTypeInterfaceContainerHelper2::disposeAndClear | ( | const css::lang::EventObject & | rEvt | ) |
Call disposing on all object in the container that support XEventListener.
Then clear the container.
Definition at line 382 of file interfacecontainer2.cxx.
|
private |
Referenced by addInterface(), getContainer(), and removeInterface().
|
private |
std::vector< css::uno::Type > comphelper::OMultiTypeInterfaceContainerHelper2::getContainedTypes | ( | ) | const |
Return all id's under which at least one interface is added.
Definition at line 316 of file interfacecontainer2.cxx.
OInterfaceContainerHelper2 * comphelper::OMultiTypeInterfaceContainerHelper2::getContainer | ( | const css::uno::Type & | rKey | ) | const |
Return the container created under this key.
Definition at line 343 of file interfacecontainer2.cxx.
References findType(), m_aMap, and rMutex.
|
privatedelete |
sal_Int32 comphelper::OMultiTypeInterfaceContainerHelper2::removeInterface | ( | const css::uno::Type & | rKey, |
const css::uno::Reference< css::uno::XInterface > & | rxIFace | ||
) |
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 367 of file interfacecontainer2.cxx.
References findType(), m_aMap, and rMutex.
|
private |
Definition at line 123 of file multicontainer2.hxx.
Referenced by addInterface(), clear(), disposeAndClear(), getContainedTypes(), getContainer(), and removeInterface().
|
private |
Definition at line 124 of file multicontainer2.hxx.
Referenced by addInterface(), clear(), disposeAndClear(), getContainedTypes(), getContainer(), and removeInterface().