LibreOffice Module comphelper (master)  1
Classes | Namespaces | Macros | Functions
servicehelper.hxx File Reference
#include <rtl/uuid.h>
#include <rtl/instance.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/uno/Sequence.hxx>
Include dependency graph for servicehelper.hxx:

Go to the source code of this file.

Classes

class  UnoTunnelIdInit
 

Namespaces

 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

template<class T >
T * comphelper::getUnoTunnelImplementation (const css::uno::Reference< css::uno::XInterface > &xIface)
 
template<typename T >
bool isUnoTunnelId (const css::uno::Sequence< sal_Int8 > &rId)
 

Macro Definition Documentation

#define UNO3_GETIMPLEMENTATION2_IMPL (   classname,
  baseclass 
)
Value:
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
{ \
if( isUnoTunnelId<classname>(rId) ) \
{ \
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); \
} \
else \
{ \
return baseclass::getSomething( rId ); \
} \
}
#define UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)

Definition at line 100 of file servicehelper.hxx.

#define UNO3_GETIMPLEMENTATION_BASE_IMPL (   classname)
Value:
namespace \
{ \
class the##classname##UnoTunnelId : public rtl::Static< UnoTunnelIdInit, the##classname##UnoTunnelId> {}; \
} \
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() throw() \
{ \
return the##classname##UnoTunnelId::get().getSeq(); \
}

Definition at line 79 of file servicehelper.hxx.

#define UNO3_GETIMPLEMENTATION_DECL (   classname)
Value:
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); \
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::getUnoTunnelImplementation<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 75 of file servicehelper.hxx.

#define UNO3_GETIMPLEMENTATION_IMPL (   classname)
Value:
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
{ \
if( isUnoTunnelId<classname>(rId) ) \
{ \
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); \
} \
return 0; \
}
#define UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)

Definition at line 89 of file servicehelper.hxx.

Function Documentation

template<typename T >
bool isUnoTunnelId ( const css::uno::Sequence< sal_Int8 > &  rId)
inline

Definition at line 55 of file servicehelper.hxx.