LibreOffice Module comphelper (master) 1
Classes | Namespaces | Macros | Functions
servicehelper.hxx File Reference
#include <rtl/uuid.h>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/uno/Sequence.hxx>
Include dependency graph for servicehelper.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  comphelper::UnoIdInit
 
struct  comphelper::FallbackToGetSomethingOf< Base >
 
struct  comphelper::FallbackToGetSomethingOf< void >
 

Namespaces

namespace  comphelper
 

Macros

#define UNO3_GETIMPLEMENTATION_DECL(classname)
 the UNO3_GETIMPLEMENTATION_* macros implement a static helper function that gives access to your implementation for a given interface reference, if possible. More...
 
#define UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)
 
#define UNO3_GETIMPLEMENTATION_IMPL(classname)
 
#define UNO3_GETIMPLEMENTATION2_IMPL(classname, baseclass)
 

Functions

sal_Int64 comphelper::getSomething_cast (void *p)
 
template<class T >
T * comphelper::getSomething_cast (sal_Int64 n)
 
template<class T >
T * comphelper::getFromUnoTunnel (const css::uno::Reference< css::lang::XUnoTunnel > &xUT)
 
template<class T >
T * comphelper::getFromUnoTunnel (const css::uno::Reference< css::uno::XInterface > &xIface)
 
template<typename T >
bool comphelper::isUnoTunnelId (const css::uno::Sequence< sal_Int8 > &rId)
 
template<class T , class Base = void>
sal_Int64 comphelper::getSomethingImpl (const css::uno::Sequence< sal_Int8 > &rId, T *pThis, FallbackToGetSomethingOf< Base >={})
 

Macro Definition Documentation

◆ UNO3_GETIMPLEMENTATION2_IMPL

#define UNO3_GETIMPLEMENTATION2_IMPL (   classname,
  baseclass 
)
Value:
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
{ \
}
sal_Int64 getSomethingImpl(const css::uno::Sequence< sal_Int8 > &rId, T *pThis, FallbackToGetSomethingOf< Base >={})
#define UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)

Definition at line 132 of file servicehelper.hxx.

◆ UNO3_GETIMPLEMENTATION_BASE_IMPL

#define UNO3_GETIMPLEMENTATION_BASE_IMPL (   classname)
Value:
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() noexcept \
{ \
static const comphelper::UnoIdInit aId; \
return aId.getSeq(); \
}
const css::uno::Sequence< sal_Int8 > & getSeq() const

Definition at line 118 of file servicehelper.hxx.

◆ UNO3_GETIMPLEMENTATION_DECL

#define UNO3_GETIMPLEMENTATION_DECL (   classname)
Value:
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept; \
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
signed char sal_Int8

the UNO3_GETIMPLEMENTATION_* macros implement a static helper function that gives access to your implementation for a given interface reference, if possible.

Example: MyClass* pClass = comphelper::getFromUnoTunnel<MyClass>( xRef );

Usage: Put a UNO3_GETIMPLEMENTATION_DECL( classname ) inside your class definition and UNO3_GETIMPLEMENTATION_IMPL( classname ) inside your cxx file. Your class must inherit css::lang::XUnoTunnel and export it with queryInterface. Implementation of XUnoTunnel is done by this macro.

Definition at line 114 of file servicehelper.hxx.

◆ UNO3_GETIMPLEMENTATION_IMPL

#define UNO3_GETIMPLEMENTATION_IMPL (   classname)
Value:
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
{ \
return comphelper::getSomethingImpl(rId, this); \
}

Definition at line 125 of file servicehelper.hxx.