LibreOffice Module cppuhelper (master) 1
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl > Class Template Reference

A helper class to store interface references of different types. More...

#include <interfacecontainer.h>

Public Types

typedef key keyType
 

Public Member Functions

 OMultiTypeInterfaceContainerHelperVar (::osl::Mutex &rMutex)
 Create a container of interface containers. More...
 
 ~OMultiTypeInterfaceContainerHelperVar ()
 Deletes all containers. More...
 
css::uno::Sequence< key > SAL_CALL getContainedTypes () const
 Return all id's under which at least one interface is added. More...
 
OInterfaceContainerHelper *SAL_CALL getContainer (const key &) const
 Return the container created under this key. More...
 
sal_Int32 SAL_CALL addInterface (const key &rKey, const css::uno::Reference< css::uno::XInterface > &r)
 Inserts an element into the container with the specified key. More...
 
sal_Int32 SAL_CALL removeInterface (const key &rKey, const css::uno::Reference< css::uno::XInterface > &rxIFace)
 Removes an element from the container with the specified key. More...
 
void SAL_CALL disposeAndClear (const css::lang::EventObject &rEvt)
 Call disposing on all references in the container, that support XEventListener. More...
 
void SAL_CALL clear ()
 Remove all elements of all containers. More...
 

Static Public Member Functions

static void *SAL_CALL operator new (size_t nSize)
 
static void SAL_CALL operator delete (void *pMem)
 
static void *SAL_CALL operator new (size_t, void *pMem)
 
static void SAL_CALL operator delete (void *, void *)
 

Private Types

typedef ::std::vector< std::pair< key, void * > > InterfaceMap
 

Private Member Functions

InterfaceMap::iterator find (const key &rKey) const
 
 OMultiTypeInterfaceContainerHelperVar (const OMultiTypeInterfaceContainerHelperVar &) SAL_DELETED_FUNCTION
 
OMultiTypeInterfaceContainerHelperVaroperator= (const OMultiTypeInterfaceContainerHelperVar &) SAL_DELETED_FUNCTION
 

Private Attributes

InterfaceMapm_pMap
 
::osl::Mutex & rMutex
 

Detailed Description

template<class key, class hashImpl = void, class equalImpl = std::equal_to<key>>
class cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >

A helper class to store interface references of different types.

See also
OInterfaceIteratorHelper
OInterfaceContainerHelper

Definition at line 315 of file interfacecontainer.h.

Member Typedef Documentation

◆ InterfaceMap

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
typedef ::std::vector< std::pair < key , void* > > cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::InterfaceMap
private

Definition at line 403 of file interfacecontainer.h.

◆ keyType

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
typedef key cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::keyType

Definition at line 401 of file interfacecontainer.h.

Constructor & Destructor Documentation

◆ OMultiTypeInterfaceContainerHelperVar() [1/2]

template<class key , class hashImpl , class equalImpl >
cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::OMultiTypeInterfaceContainerHelperVar ( ::osl::Mutex &  rMutex)
inline

Create a container of interface containers.

Parameters
rMutexthe mutex to protect multi thread access. The lifetime must be longer than the lifetime of this object.

Definition at line 37 of file interfacecontainer.hxx.

References cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::m_pMap.

◆ ~OMultiTypeInterfaceContainerHelperVar()

template<class key , class hashImpl , class equalImpl >
cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::~OMultiTypeInterfaceContainerHelperVar
inline

Deletes all containers.

Definition at line 45 of file interfacecontainer.hxx.

References end, and NULL.

◆ OMultiTypeInterfaceContainerHelperVar() [2/2]

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::OMultiTypeInterfaceContainerHelperVar ( const OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl > &  )
private

Member Function Documentation

◆ addInterface()

template<class key , class hashImpl , class equalImpl >
sal_Int32 cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::addInterface ( const key &  rKey,
const css::uno::Reference< css::uno::XInterface > &  r 
)
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.

Attention: \n
If you add the same interface more than once, then it will be added to the elements list more than once and thus if you want to remove that interface from the list, you have to call removeInterface() the same number of times. In the latter case, you will also get events fired more than once (if the interface is a listener interface).
Parameters
rKeythe id of the container
rinterface to be added; it is allowed, to insert null or the same interface more than once
Returns
the new count of elements in the container

Definition at line 106 of file interfacecontainer.hxx.

References cppu::OInterfaceContainerHelper::addInterface(), and find().

◆ clear()

template<class key , class hashImpl , class equalImpl >
void cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::clear
inline

Remove all elements of all containers.

Does not delete the container.

Definition at line 179 of file interfacecontainer.hxx.

References end.

◆ disposeAndClear()

template<class key , class hashImpl , class equalImpl >
void cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::disposeAndClear ( const css::lang::EventObject &  rEvt)
inline

Call disposing on all references in the container, that support XEventListener.

Then clears the container.

Parameters
rEvtthe event object which is passed during disposing() call

Definition at line 142 of file interfacecontainer.hxx.

References cppu::OInterfaceContainerHelper::disposeAndClear(), end, i, and NULL.

◆ find()

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
InterfaceMap::iterator cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::find ( const key &  rKey) const
inlineprivate

◆ getContainedTypes()

template<class key , class hashImpl , class equalImpl >
css::uno::Sequence< key > cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::getContainedTypes
inline

Return all id's under which at least one interface is added.

Definition at line 61 of file interfacecontainer.hxx.

References end, cppu::OInterfaceContainerHelper::getLength(), and i.

◆ getContainer()

template<class key , class hashImpl , class equalImpl >
OInterfaceContainerHelper * cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::getContainer ( const key &  rKey) const
inline

Return the container created under this key.

The InterfaceContainerHelper exists until the whole MultiTypeContainer is destroyed.

Returns
the container created under this key. If the container was not created, null was returned.

Definition at line 93 of file interfacecontainer.hxx.

References find(), and NULL.

◆ operator delete() [1/2]

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
static void SAL_CALL cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::operator delete ( void *  ,
void *   
)
inlinestatic

Definition at line 325 of file interfacecontainer.h.

◆ operator delete() [2/2]

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
static void SAL_CALL cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::operator delete ( void *  pMem)
inlinestatic

Definition at line 321 of file interfacecontainer.h.

◆ operator new() [1/2]

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
static void *SAL_CALL cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::operator new ( size_t  nSize)
inlinestatic

Definition at line 319 of file interfacecontainer.h.

◆ operator new() [2/2]

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
static void *SAL_CALL cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::operator new ( size_t  ,
void *  pMem 
)
inlinestatic

Definition at line 323 of file interfacecontainer.h.

◆ operator=()

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
OMultiTypeInterfaceContainerHelperVar & cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::operator= ( const OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl > &  )
private

◆ removeInterface()

template<class key , class hashImpl , class equalImpl >
sal_Int32 cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::removeInterface ( const key &  rKey,
const css::uno::Reference< css::uno::XInterface > &  rxIFace 
)
inline

Removes an element from the container with the specified key.

It uses interface equality to remove the interface.

Parameters
rKeythe id of the container
rxIFaceinterface to be removed
Returns
the new count of elements in the container

Definition at line 124 of file interfacecontainer.hxx.

References find().

Member Data Documentation

◆ m_pMap

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
InterfaceMap* cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::m_pMap
private

◆ rMutex

template<class key , class hashImpl = void, class equalImpl = std::equal_to<key>>
::osl::Mutex& cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::rMutex
private

Definition at line 405 of file interfacecontainer.h.


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