20#ifndef INCLUDED_CPPUHELPER_IMPLBASE_HXX
21#define INCLUDED_CPPUHELPER_IMPLBASE_HXX
28#include "com/sun/star/lang/XTypeProvider.hpp"
29#include "com/sun/star/uno/Any.h"
30#include "com/sun/star/uno/Sequence.hxx"
31#include "com/sun/star/uno/Type.h"
34#include "rtl/instance.hxx"
37#if defined LIBO_INTERNAL_ONLY
53template<std::
size_t N>
struct class_dataN {
58 type_entry m_typeEntries[
N + 1];
61template<
typename Impl,
typename... Ifc>
struct ImplClassData {
62 class_data * operator ()() {
63 static class_dataN<
sizeof... (Ifc)> s_cd = {
64 sizeof... (Ifc) + 1,
false,
false, {},
66 { { Ifc::static_type },
67 (
reinterpret_cast<sal_IntPtr
>(
68 static_cast<Ifc *
>(
reinterpret_cast<Impl *
>(16)))
71 CPPUHELPER_DETAIL_TYPEENTRY(css::lang::XTypeProvider)
74 return reinterpret_cast<class_data *
>(&s_cd);
90template<
typename... Ifc>
92 public OWeakObject,
public css::lang::XTypeProvider,
public Ifc...
96 class_data, detail::ImplClassData<WeakImplHelper, Ifc...>>
102 virtual ~WeakImplHelper()
override {}
105 WeakImplHelper(WeakImplHelper
const &) =
default;
106 WeakImplHelper(WeakImplHelper &&) =
default;
107 WeakImplHelper & operator =(WeakImplHelper
const &) =
default;
108 WeakImplHelper & operator =(WeakImplHelper &&) =
default;
110 css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & aType)
override
117 css::uno::Sequence<css::uno::Type> SAL_CALL getTypes()
override
120 css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId()
override
121 {
return css::uno::Sequence<sal_Int8>(); }
141template<
typename BaseClass,
typename... Ifc>
142class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper:
143 public BaseClass,
public Ifc...
146 rtl::StaticAggregate<
147 class_data, detail::ImplClassData<ImplInheritanceHelper, Ifc...>>
151 template<
typename...
Arg> ImplInheritanceHelper(Arg &&... arg):
155 virtual ~ImplInheritanceHelper() {}
158 ImplInheritanceHelper(ImplInheritanceHelper
const &) =
default;
159 ImplInheritanceHelper(ImplInheritanceHelper &&) =
default;
160 ImplInheritanceHelper & operator =(ImplInheritanceHelper
const &) =
default;
161 ImplInheritanceHelper & operator =(ImplInheritanceHelper &&) =
default;
163 css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & aType)
override
169 void SAL_CALL acquire() SAL_NOEXCEPT
override { BaseClass::acquire(); }
171 void SAL_CALL release() SAL_NOEXCEPT
override { BaseClass::release(); }
173 css::uno::Sequence<css::uno::Type> SAL_CALL getTypes()
override
176 css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId()
override
177 {
return css::uno::Sequence<sal_Int8>(); }
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
increasing m_refCount
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
decreasing m_refCount
Sequence< Type > SAL_CALL ImplInhHelper_getTypes(class_data *cd, Sequence< Type > const &rAddTypes)
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Any SAL_CALL WeakImplHelper_query(Type const &rType, class_data *cd, void *that, OWeakObject *pBase)
Sequence< Type > SAL_CALL WeakImplHelper_getTypes(class_data *cd)
Any SAL_CALL ImplHelper_queryNoXInterface(Type const &rType, class_data *cd, void *that)