LibreOffice
LibreOffice 6.0 SDK C/C++ API Reference
implbase8.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_CPPUHELPER_IMPLBASE8_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE8_HXX
21 
23 #include <rtl/instance.hxx>
24 
25 namespace cppu
26 {
28 
29  struct class_data8
30  {
31  sal_Int16 m_nTypes;
32  sal_Bool m_storedTypeRefs;
33  sal_Bool m_storedId;
34  sal_Int8 m_id[ 16 ];
35  type_entry m_typeEntries[ 8 + 1 ];
36  };
37 
38  template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Ifc7, typename Ifc8, typename Impl >
39  struct SAL_WARN_UNUSED ImplClassData8
40  {
41  class_data* operator ()()
42  {
43  static class_data8 s_cd =
44  {
45  8 +1, false, false,
46  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
47  {
48  CPPUHELPER_DETAIL_TYPEENTRY(Ifc1),
49  CPPUHELPER_DETAIL_TYPEENTRY(Ifc2),
50  CPPUHELPER_DETAIL_TYPEENTRY(Ifc3),
51  CPPUHELPER_DETAIL_TYPEENTRY(Ifc4),
52  CPPUHELPER_DETAIL_TYPEENTRY(Ifc5),
53  CPPUHELPER_DETAIL_TYPEENTRY(Ifc6),
54  CPPUHELPER_DETAIL_TYPEENTRY(Ifc7),
55  CPPUHELPER_DETAIL_TYPEENTRY(Ifc8),
56  CPPUHELPER_DETAIL_TYPEENTRY(css::lang::XTypeProvider)
57  }
58  };
59  return reinterpret_cast< class_data * >(&s_cd);
60  }
61  };
62 
64 
73  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 >
74  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper8
75  : public css::lang::XTypeProvider
76  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8
77  {
78  struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, ImplHelper8<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {};
79  public:
80  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
81  { return ImplHelper_query( rType, cd::get(), this ); }
82  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
83  { return ImplHelper_getTypes( cd::get() ); }
84  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
85  { return ImplHelper_getImplementationId( cd::get() ); }
86 
87 #if !defined _MSC_VER // public -> protected changes mangled names there
88  protected:
89 #elif defined __clang__
90 #pragma clang diagnostic push
91 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
92 #endif
93  ~ImplHelper8() throw () {}
94 #if defined _MSC_VER && defined __clang__
95 #pragma clang diagnostic pop
96 #endif
97  };
106  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 >
107  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper8
108  : public OWeakObject
109  , public css::lang::XTypeProvider
110  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8
111  {
112  struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, WeakImplHelper8<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {};
113  public:
114  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
115  { return WeakImplHelper_query( rType, cd::get(), this, static_cast<OWeakObject *>(this) ); }
116  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
117  { OWeakObject::acquire(); }
118  virtual void SAL_CALL release() throw () SAL_OVERRIDE
119  { OWeakObject::release(); }
120  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
121  { return WeakImplHelper_getTypes( cd::get() ); }
122  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
123  { return ImplHelper_getImplementationId( cd::get() ); }
124  };
138  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 >
139  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper8
140  : public OWeakAggObject
141  , public css::lang::XTypeProvider
142  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8
143  {
144  struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, WeakAggImplHelper8<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {};
145  public:
146  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
147  { return OWeakAggObject::queryInterface( rType ); }
148  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) SAL_OVERRIDE
149  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, static_cast<OWeakAggObject *>(this) ); }
150  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
152  virtual void SAL_CALL release() throw () SAL_OVERRIDE
154  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
155  { return WeakAggImplHelper_getTypes( cd::get() ); }
156  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
157  { return ImplHelper_getImplementationId( cd::get() ); }
158  };
175  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 >
176  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper8
177  : public BaseClass
178  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8
179  {
180  struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, ImplInheritanceHelper8<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {};
181  protected:
182  template< typename T1 >
183  explicit ImplInheritanceHelper8(T1 const & arg1): BaseClass(arg1) {}
184  template< typename T1, typename T2 >
185  ImplInheritanceHelper8(T1 const & arg1, T2 const & arg2):
186  BaseClass(arg1, arg2) {}
187  template< typename T1, typename T2, typename T3 >
189  T1 const & arg1, T2 const & arg2, T3 const & arg3):
190  BaseClass(arg1, arg2, arg3) {}
191  template< typename T1, typename T2, typename T3, typename T4 >
193  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
194  BaseClass(arg1, arg2, arg3, arg4) {}
195  template<
196  typename T1, typename T2, typename T3, typename T4, typename T5 >
198  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
199  T5 const & arg5):
200  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
201  template<
202  typename T1, typename T2, typename T3, typename T4, typename T5,
203  typename T6 >
205  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
206  T5 const & arg5, T6 const & arg6):
207  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
208  public:
210  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
211  {
212  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
213  if (aRet.hasValue())
214  return aRet;
215  return BaseClass::queryInterface( rType );
216  }
217  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
218  { BaseClass::acquire(); }
219  virtual void SAL_CALL release() throw () SAL_OVERRIDE
220  { BaseClass::release(); }
221  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
222  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
223  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
224  { return ImplHelper_getImplementationId( cd::get() ); }
225  };
243  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 >
244  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper8
245  : public BaseClass
246  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8
247  {
248  struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, AggImplInheritanceHelper8<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {};
249  protected:
250  template< typename T1 >
251  explicit AggImplInheritanceHelper8(T1 const & arg1): BaseClass(arg1) {}
252  template< typename T1, typename T2 >
253  AggImplInheritanceHelper8(T1 const & arg1, T2 const & arg2):
254  BaseClass(arg1, arg2) {}
255  template< typename T1, typename T2, typename T3 >
257  T1 const & arg1, T2 const & arg2, T3 const & arg3):
258  BaseClass(arg1, arg2, arg3) {}
259  template< typename T1, typename T2, typename T3, typename T4 >
261  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
262  BaseClass(arg1, arg2, arg3, arg4) {}
263  template<
264  typename T1, typename T2, typename T3, typename T4, typename T5 >
266  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
267  T5 const & arg5):
268  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
269  template<
270  typename T1, typename T2, typename T3, typename T4, typename T5,
271  typename T6 >
273  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
274  T5 const & arg5, T6 const & arg6):
275  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
276  public:
278  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
279  { return BaseClass::queryInterface( rType ); }
280  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) SAL_OVERRIDE
281  {
282  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
283  if (aRet.hasValue())
284  return aRet;
285  return BaseClass::queryAggregation( rType );
286  }
287  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
288  { BaseClass::acquire(); }
289  virtual void SAL_CALL release() throw () SAL_OVERRIDE
290  { BaseClass::release(); }
291  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
292  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
293  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
294  { return ImplHelper_getImplementationId( cd::get() ); }
295  };
296 }
297 
298 #endif
299 
300 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Implementation helper implementing interface css::lang::XTypeProvider and method XInterface::queryInt...
Definition: implbase8.hxx:74
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase8.hxx:223
virtual void release() SAL_OVERRIDE
decreasing m_refCount
Definition: implbase8.hxx:118
Base class to implement an UNO object supporting weak references, i.e.
Definition: weak.hxx:43
Definition: Enterable.hxx:26
AggImplInheritanceHelper8(T1 const &arg1, T2 const &arg2)
Definition: implbase8.hxx:253
Helper class for a late-initialized static aggregate, e.g.
Definition: instance.hxx:544
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase8.hxx:244
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:608
virtual void acquire() SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
ImplInheritanceHelper8()
Definition: implbase8.hxx:209
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase8.hxx:176
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:39
~ImplHelper8()
Definition: implbase8.hxx:93
virtual void acquire() SAL_OVERRIDE
increasing m_refCount
#define SAL_OVERRIDE
C++11 "override" feature.
Definition: types.h:415
ImplInheritanceHelper8(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase8.hxx:192
Base class to implement an UNO object supporting weak references, i.e.
Definition: weakagg.hxx:41
virtual void release() SAL_OVERRIDE
Definition: implbase8.hxx:289
ImplInheritanceHelper8(T1 const &arg1)
Definition: implbase8.hxx:183
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase8.hxx:114
virtual css::uno::Any queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
If a delegator is set, then the delegator is queried for the demanded interface.
unsigned char sal_Bool
Definition: types.h:39
ImplInheritanceHelper8(T1 const &arg1, T2 const &arg2)
Definition: implbase8.hxx:185
AggImplInheritanceHelper8(T1 const &arg1)
Definition: implbase8.hxx:251
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase8.hxx:293
AggImplInheritanceHelper8(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase8.hxx:265
virtual void acquire() SAL_OVERRIDE
Definition: implbase8.hxx:217
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase8.hxx:278
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase8.hxx:107
signed char sal_Int8
Definition: types.h:44
ImplInheritanceHelper8(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase8.hxx:204
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:317
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase8.hxx:82
AggImplInheritanceHelper8(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase8.hxx:272
virtual void release() SAL_OVERRIDE
decreasing m_refCount
AggImplInheritanceHelper8(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase8.hxx:260
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase8.hxx:291
virtual void acquire() SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
Definition: implbase8.hxx:150
virtual void acquire() SAL_OVERRIDE
increasing m_refCount
Definition: implbase8.hxx:116
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase8.hxx:154
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase8.hxx:84
virtual void acquire() SAL_OVERRIDE
Definition: implbase8.hxx:287
virtual void release() SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
Definition: implbase8.hxx:152
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase8.hxx:139
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase8.hxx:122
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase8.hxx:210
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase8.hxx:148
ImplInheritanceHelper8(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase8.hxx:188
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase8.hxx:120
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase8.hxx:146
AggImplInheritanceHelper8(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase8.hxx:256
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase8.hxx:221
AggImplInheritanceHelper8()
Definition: implbase8.hxx:277
ImplInheritanceHelper8(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase8.hxx:197
virtual void release() SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
virtual void release() SAL_OVERRIDE
Definition: implbase8.hxx:219
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase8.hxx:80
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase8.hxx:280
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase8.hxx:156