UDK 3.2.7 C/C++ API Reference
Public Types | Public Member Functions | Static Public Member Functions
cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl > Class Template Reference

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

#include <interfacecontainer.h>

List of all members.

Public Types

typedef key keyType

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

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

A helper class to store interface references of different types.

See also:
OInterfaceIteratorHelper
OInterfaceContainerHelper

Member Typedef Documentation

template<class key , class hashImpl , class equalImpl >
typedef key cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::keyType

Constructor & Destructor Documentation

template<class key , class hashImpl , class equalImpl >
cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::OMultiTypeInterfaceContainerHelperVar ( ::osl::Mutex rMutex) throw () [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.
template<class key , class hashImpl , class equalImpl >
cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::~OMultiTypeInterfaceContainerHelperVar ( ) throw () [inline]

Deletes all containers.


Member Function Documentation

template<class key , class hashImpl , class equalImpl >
sal_Int32 cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::addInterface ( const key &  rKey,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &  r 
) throw () [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:
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
template<class key , class hashImpl , class equalImpl >
void cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::clear ( ) throw () [inline]

Remove all elements of all containers.

Does not delete the container.

template<class key , class hashImpl , class equalImpl >
void cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::disposeAndClear ( const ::com::sun::star::lang::EventObject &  rEvt) throw () [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
template<class key , class hashImpl , class equalImpl >
com::sun::star::uno::Sequence< key > cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::getContainedTypes ( ) const throw () [inline]

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

template<class key , class hashImpl , class equalImpl >
OInterfaceContainerHelper * cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::getContainer ( const key &  rKey) const throw () [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.
template<class key , class hashImpl , class equalImpl >
static void cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::operator delete ( void *  pMem) throw () [inline, static]
template<class key , class hashImpl , class equalImpl >
static void cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::operator delete ( void *  ,
void *   
) throw () [inline, static]
template<class key , class hashImpl , class equalImpl >
static void* cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::operator new ( size_t  nSize) throw () [inline, static]
template<class key , class hashImpl , class equalImpl >
static void* cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::operator new ( size_t  ,
void *  pMem 
) throw () [inline, static]
template<class key , class hashImpl , class equalImpl >
sal_Int32 cppu::OMultiTypeInterfaceContainerHelperVar< key, hashImpl, equalImpl >::removeInterface ( const key &  rKey,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &  rxIFace 
) throw () [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

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines