LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
cppu::OMultiTypeInterfaceContainerHelper Class Reference

Specialized class for key type css::uno::Type, without explicit usage of STL symbols. More...

#include <interfacecontainer.h>

Public Types

typedef css::uno::Type keyType
 

Public Member Functions

 OMultiTypeInterfaceContainerHelper (::osl::Mutex &rMutex)
 Create a container of interface containers. More...
 
 ~OMultiTypeInterfaceContainerHelper ()
 Delete all containers. More...
 
css::uno::Sequence
< css::uno::Type > 
getContainedTypes () const
 Return all id's under which at least one interface is added. More...
 
OInterfaceContainerHelpergetContainer (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...
 

Static Public Member Functions

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

Detailed Description

Specialized class for key type css::uno::Type, without explicit usage of STL symbols.

Member Typedef Documentation

Constructor & Destructor Documentation

cppu::OMultiTypeInterfaceContainerHelper::OMultiTypeInterfaceContainerHelper ( ::osl::Mutex rMutex)

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.
cppu::OMultiTypeInterfaceContainerHelper::~OMultiTypeInterfaceContainerHelper ( )

Delete all containers.

Member Function Documentation

sal_Int32 cppu::OMultiTypeInterfaceContainerHelper::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.

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
void cppu::OMultiTypeInterfaceContainerHelper::clear ( )

Remove all elements of all containers.

Does not delete the container.

void cppu::OMultiTypeInterfaceContainerHelper::disposeAndClear ( const css::lang::EventObject &  rEvt)

Call disposing on all object in the container that support XEventListener.

Than clear the container.

css::uno::Sequence< css::uno::Type > cppu::OMultiTypeInterfaceContainerHelper::getContainedTypes ( ) const

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

OInterfaceContainerHelper* cppu::OMultiTypeInterfaceContainerHelper::getContainer ( const css::uno::Type &  rKey) const

Return the container created under this key.

Returns
the container created under this key. If the container was not created, null was returned.
static void cppu::OMultiTypeInterfaceContainerHelper::operator delete ( void *  pMem)
inlinestatic
static void cppu::OMultiTypeInterfaceContainerHelper::operator delete ( void *  ,
void *   
)
inlinestatic
static void* cppu::OMultiTypeInterfaceContainerHelper::operator new ( size_t  nSize)
inlinestatic
static void* cppu::OMultiTypeInterfaceContainerHelper::operator new ( size_t  ,
void *  pMem 
)
inlinestatic
sal_Int32 cppu::OMultiTypeInterfaceContainerHelper::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.

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 file: