23#ifndef INCLUDED_CPPUHELPER_INTERFACECONTAINER_HXX
24#define INCLUDED_CPPUHELPER_INTERFACECONTAINER_HXX
36template<
class key ,
class hashImpl ,
class equalImpl >
44template<
class key ,
class hashImpl ,
class equalImpl >
47 typename InterfaceMap::iterator iter = m_pMap->begin();
48 typename InterfaceMap::iterator
end = m_pMap->end();
53 (*iter).second =
NULL;
60template<
class key ,
class hashImpl ,
class equalImpl >
63 ::osl::MutexGuard aGuard( rMutex );
64 typename InterfaceMap::size_type nSize = m_pMap->size();
67 css::uno::Sequence< key > aInterfaceTypes( nSize );
68 key * pArray = aInterfaceTypes.getArray();
70 typename InterfaceMap::iterator iter = m_pMap->begin();
71 typename InterfaceMap::iterator
end = m_pMap->end();
79 pArray[
i++] = (*iter).first;
84 aInterfaceTypes = css::uno::Sequence<key>( pArray,
i );
86 return aInterfaceTypes;
88 return css::uno::Sequence<key>();
92template<
class key ,
class hashImpl ,
class equalImpl >
94 const key & rKey )
const
96 ::osl::MutexGuard aGuard( rMutex );
98 typename InterfaceMap::iterator iter =
find( rKey );
99 if( iter != m_pMap->end() )
105template<
class key ,
class hashImpl ,
class equalImpl >
108 const css::uno::Reference< css::uno::XInterface > & rListener )
110 ::osl::MutexGuard aGuard( rMutex );
111 typename InterfaceMap::iterator iter =
find( rKey );
112 if( iter == m_pMap->end() )
115 m_pMap->push_back(std::pair<key, void*>(rKey, pLC));
123template<
class key ,
class hashImpl ,
class equalImpl >
126 const css::uno::Reference< css::uno::XInterface > & rListener )
128 ::osl::MutexGuard aGuard( rMutex );
131 typename InterfaceMap::iterator iter =
find( rKey );
133 if( iter != m_pMap->end() )
141template<
class key ,
class hashImpl ,
class equalImpl >
143 const css::lang::EventObject & rEvt )
145 typename InterfaceMap::size_type nSize = 0;
148 ::osl::MutexGuard aGuard( rMutex );
149 nSize = m_pMap->size();
153 ppListenerContainers =
new ppp[nSize];
155 typename InterfaceMap::iterator iter = m_pMap->begin();
156 typename InterfaceMap::iterator
end = m_pMap->end();
158 typename InterfaceMap::size_type
i = 0;
168 for(
typename InterfaceMap::size_type
i = 0;
i < nSize;
i++ )
170 if( ppListenerContainers[
i] )
174 delete [] ppListenerContainers;
178template<
class key ,
class hashImpl ,
class equalImpl >
181 ::osl::MutexGuard aGuard( rMutex );
182 typename InterfaceMap::iterator iter = m_pMap->begin();
183 typename InterfaceMap::iterator
end = m_pMap->end();
A container of interfaces.
sal_Int32 SAL_CALL getLength() const
Return the number of Elements in the container.
void SAL_CALL disposeAndClear(const css::lang::EventObject &rEvt)
Call disposing on all object in the container that support XEventListener.
sal_Int32 SAL_CALL addInterface(const css::uno::Reference< css::uno::XInterface > &rxIFace)
Inserts an element into the container.
~OMultiTypeInterfaceContainerHelperVar()
Deletes all containers.
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.
OInterfaceContainerHelper *SAL_CALL getContainer(const key &) const
Return the container created under this key.
void SAL_CALL clear()
Remove all elements of all containers.
void SAL_CALL disposeAndClear(const css::lang::EventObject &rEvt)
Call disposing on all references in the container, that support XEventListener.
::std::vector< std::pair< key, void * > > InterfaceMap
OMultiTypeInterfaceContainerHelperVar(::osl::Mutex &rMutex)
Create a container of interface containers.
css::uno::Sequence< key > SAL_CALL getContainedTypes() const
Return all id's under which at least one interface is added.
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.
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)