19 #ifndef INCLUDED_CPPUHELPER_INTERFACECONTAINER_HXX
20 #define INCLUDED_CPPUHELPER_INTERFACECONTAINER_HXX
28 template<
class key ,
class hashImpl ,
class equalImpl >
33 m_pMap =
new InterfaceMap;
37 template<
class key ,
class hashImpl ,
class equalImpl >
41 typename InterfaceMap::iterator iter = m_pMap->begin();
42 typename InterfaceMap::iterator end = m_pMap->end();
54 template<
class key ,
class hashImpl ,
class equalImpl >
59 typename InterfaceMap::size_type nSize = m_pMap->size();
63 key * pArray = aInterfaceTypes.
getArray();
65 typename InterfaceMap::iterator iter = m_pMap->begin();
66 typename InterfaceMap::iterator end = m_pMap->end();
74 pArray[i++] = (*iter).first;
81 return aInterfaceTypes;
83 return ::com::sun::star::uno::Sequence<key>();
87 template<
class key ,
class hashImpl ,
class equalImpl >
93 typename InterfaceMap::iterator iter = find( rKey );
94 if( iter != m_pMap->end() )
100 template<
class key ,
class hashImpl ,
class equalImpl >
103 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rListener )
107 typename InterfaceMap::iterator iter = find( rKey );
108 if( iter == m_pMap->end() )
111 m_pMap->push_back(std::pair<key, void*>(rKey, pLC));
119 template<
class key ,
class hashImpl ,
class equalImpl >
122 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rListener )
128 typename InterfaceMap::iterator iter = find( rKey );
130 if( iter != m_pMap->end() )
138 template<
class key ,
class hashImpl ,
class equalImpl >
140 const ::com::sun::star::lang::EventObject & rEvt )
143 typename InterfaceMap::size_type nSize = 0;
147 nSize = m_pMap->size();
151 ppListenerContainers =
new ppp[nSize];
153 typename InterfaceMap::iterator iter = m_pMap->begin();
154 typename InterfaceMap::iterator end = m_pMap->end();
156 typename InterfaceMap::size_type i = 0;
166 for(
typename InterfaceMap::size_type i = 0; i < nSize; i++ )
168 if( ppListenerContainers[i] )
172 delete [] ppListenerContainers;
176 template<
class key ,
class hashImpl ,
class equalImpl >
180 typename InterfaceMap::iterator iter = m_pMap->begin();
181 typename InterfaceMap::iterator end = m_pMap->end();
sal_Int32 addInterface(const key &rKey, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &r)
Inserts an element into the container with the specified key.
Definition: interfacecontainer.hxx:101
sal_Int32 removeInterface(const key &rKey, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &rxIFace)
Removes an element from the container with the specified key.
Definition: interfacecontainer.hxx:120
void disposeAndClear(const ::com::sun::star::lang::EventObject &rEvt)
Call disposing on all references in the container, that support XEventListener.
Definition: interfacecontainer.hxx:139
OInterfaceContainerHelper * getContainer(const key &) const
Return the container created under this key.
Definition: interfacecontainer.hxx:88
inline::com::sun::star::uno::Sequence< key > getContainedTypes() const
Return all id's under which at least one interface is added.
Definition: interfacecontainer.hxx:55
void clear()
Remove all elements of all containers.
Definition: interfacecontainer.hxx:177
~OMultiTypeInterfaceContainerHelperVar()
Deletes all containers.
Definition: interfacecontainer.hxx:38
void disposeAndClear(const ::com::sun::star::lang::EventObject &rEvt)
Call disposing on all object in the container that support XEventListener.
A helper class for mutex objects and interfaces.
Definition: mutex.hxx:123
A container of interfaces.
Definition: interfacecontainer.h:114
OMultiTypeInterfaceContainerHelperVar(::osl::Mutex &rMutex)
Create a container of interface containers.
Definition: interfacecontainer.hxx:29
A mutual exclusion synchronization object.
Definition: mutex.hxx:32
E * getArray()
Gets a pointer to elements array for reading and writing.
Definition: Sequence.hxx:134
Template C++ class representing an IDL sequence.
Definition: unotype.hxx:33
sal_Int32 addInterface(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &rxIFace)
Inserts an element into the container.
#define SAL_THROW(exc)
Definition of function throw clause macros.
Definition: types.h:358