LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
implbase11.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_IMPLBASE11_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE11_HXX
21 
23 #include <rtl/instance.hxx>
24 
25 namespace cppu
26 {
28 
29  struct class_data11
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[ 11 + 1 ];
36  };
37 
38  template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Ifc7, typename Ifc8, typename Ifc9, typename Ifc10, typename Ifc11, typename Impl >
39  struct ImplClassData11
40  {
41  class_data* operator ()()
42  {
43  static class_data11 s_cd =
44  {
45  11 +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(Ifc9),
57  CPPUHELPER_DETAIL_TYPEENTRY(Ifc10),
58  CPPUHELPER_DETAIL_TYPEENTRY(Ifc11),
59  CPPUHELPER_DETAIL_TYPEENTRY(css::lang::XTypeProvider)
60  }
61  };
62  return reinterpret_cast< class_data * >(&s_cd);
63  }
64  };
65 
67 
76  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 >
77  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper11
78  : public css::lang::XTypeProvider
79  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11
80  {
81  struct cd : public rtl::StaticAggregate< class_data, ImplClassData11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, ImplHelper11<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11> > > {};
82  public:
83  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
84  { return ImplHelper_query( rType, cd::get(), this ); }
85  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
86  { return ImplHelper_getTypes( cd::get() ); }
87  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
88  { return ImplHelper_getImplementationId( cd::get() ); }
89 
90 #if !defined _MSC_VER // public -> protected changes mangled names there
91  protected:
92 #elif defined __clang__
93 #pragma clang diagnostic push
94 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
95 #endif
96  ~ImplHelper11() throw () {}
97 #if defined _MSC_VER && defined __clang__
98 #pragma clang diagnostic pop
99 #endif
100  };
109  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 >
110  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper11
111  : public OWeakObject
112  , public css::lang::XTypeProvider
113  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11
114  {
115  struct cd : public rtl::StaticAggregate< class_data, ImplClassData11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, WeakImplHelper11<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11> > > {};
116  public:
117  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
118  { return WeakImplHelper_query( rType, cd::get(), this, static_cast<OWeakObject *>(this) ); }
119  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
120  { OWeakObject::acquire(); }
121  virtual void SAL_CALL release() throw () SAL_OVERRIDE
122  { OWeakObject::release(); }
123  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
124  { return WeakImplHelper_getTypes( cd::get() ); }
125  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
126  { return ImplHelper_getImplementationId( cd::get() ); }
127  };
141  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 >
142  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper11
143  : public OWeakAggObject
144  , public css::lang::XTypeProvider
145  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11
146  {
147  struct cd : public rtl::StaticAggregate< class_data, ImplClassData11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, WeakAggImplHelper11<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11> > > {};
148  public:
149  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
150  { return OWeakAggObject::queryInterface( rType ); }
151  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
152  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, static_cast<OWeakAggObject *>(this) ); }
153  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
155  virtual void SAL_CALL release() throw () SAL_OVERRIDE
157  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
158  { return WeakAggImplHelper_getTypes( cd::get() ); }
159  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
160  { return ImplHelper_getImplementationId( cd::get() ); }
161  };
178  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 >
179  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper11
180  : public BaseClass
181  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11
182  {
183  struct cd : public rtl::StaticAggregate< class_data, ImplClassData11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, ImplInheritanceHelper11<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11> > > {};
184  protected:
185  template< typename T1 >
186  explicit ImplInheritanceHelper11(T1 const & arg1): BaseClass(arg1) {}
187  template< typename T1, typename T2 >
188  ImplInheritanceHelper11(T1 const & arg1, T2 const & arg2):
189  BaseClass(arg1, arg2) {}
190  template< typename T1, typename T2, typename T3 >
192  T1 const & arg1, T2 const & arg2, T3 const & arg3):
193  BaseClass(arg1, arg2, arg3) {}
194  template< typename T1, typename T2, typename T3, typename T4 >
196  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
197  BaseClass(arg1, arg2, arg3, arg4) {}
198  template<
199  typename T1, typename T2, typename T3, typename T4, typename T5 >
201  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
202  T5 const & arg5):
203  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
204  template<
205  typename T1, typename T2, typename T3, typename T4, typename T5,
206  typename T6 >
208  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
209  T5 const & arg5, T6 const & arg6):
210  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
211  public:
213  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
214  {
215  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
216  if (aRet.hasValue())
217  return aRet;
218  return BaseClass::queryInterface( rType );
219  }
220  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
221  { BaseClass::acquire(); }
222  virtual void SAL_CALL release() throw () SAL_OVERRIDE
223  { BaseClass::release(); }
224  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException) SAL_OVERRIDE
225  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
226  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException) SAL_OVERRIDE
227  { return ImplHelper_getImplementationId( cd::get() ); }
228  };
246  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 >
247  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper11
248  : public BaseClass
249  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11
250  {
251  struct cd : public rtl::StaticAggregate< class_data, ImplClassData11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, AggImplInheritanceHelper11<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11> > > {};
252  protected:
253  template< typename T1 >
254  explicit AggImplInheritanceHelper11(T1 const & arg1): BaseClass(arg1) {}
255  template< typename T1, typename T2 >
256  AggImplInheritanceHelper11(T1 const & arg1, T2 const & arg2):
257  BaseClass(arg1, arg2) {}
258  template< typename T1, typename T2, typename T3 >
260  T1 const & arg1, T2 const & arg2, T3 const & arg3):
261  BaseClass(arg1, arg2, arg3) {}
262  template< typename T1, typename T2, typename T3, typename T4 >
264  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
265  BaseClass(arg1, arg2, arg3, arg4) {}
266  template<
267  typename T1, typename T2, typename T3, typename T4, typename T5 >
269  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
270  T5 const & arg5):
271  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
272  template<
273  typename T1, typename T2, typename T3, typename T4, typename T5,
274  typename T6 >
276  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
277  T5 const & arg5, T6 const & arg6):
278  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
279  public:
281  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
282  { return BaseClass::queryInterface( rType ); }
283  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
284  {
285  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
286  if (aRet.hasValue())
287  return aRet;
288  return BaseClass::queryAggregation( rType );
289  }
290  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
291  { BaseClass::acquire(); }
292  virtual void SAL_CALL release() throw () SAL_OVERRIDE
293  { BaseClass::release(); }
294  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException) SAL_OVERRIDE
295  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
296  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException) SAL_OVERRIDE
297  { return ImplHelper_getImplementationId( cd::get() ); }
298  };
299 }
300 
301 #endif
302 
303 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ImplInheritanceHelper11(T1 const &arg1, T2 const &arg2)
Definition: implbase11.hxx:188
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase11.hxx:142
ImplInheritanceHelper11()
Definition: implbase11.hxx:212
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase11.hxx:283
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase11.hxx:87
Base class to implement an UNO object supporting weak references, i.e.
Definition: weak.hxx:43
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase11.hxx:159
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Basic queryInterface() implementation supporting com::sun::star::uno::XWeak and com::sun::star::uno::...
Definition: implbase11.hxx:117
virtual void release() SAL_OVERRIDE
Definition: implbase11.hxx:222
Implementation helper implementing interface css::lang::XTypeProvider and method XInterface::queryInt...
Definition: implbase11.hxx:77
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase11.hxx:125
Helper class for a late-initialized static aggregate, e.g.
Definition: instance.hxx:546
virtual void acquire() SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Called by the delegator or queryInterface.
Definition: implbase11.hxx:151
AggImplInheritanceHelper11(T1 const &arg1)
Definition: implbase11.hxx:254
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:39
virtual void acquire() SAL_OVERRIDE
increasing m_refCount
AggImplInheritanceHelper11(T1 const &arg1, T2 const &arg2)
Definition: implbase11.hxx:256
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase11.hxx:213
#define SAL_OVERRIDE
C++11 &quot;override&quot; feature.
Definition: types.h:423
Base class to implement an UNO object supporting weak references, i.e.
Definition: weakagg.hxx:41
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:48
virtual void release() SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
Definition: implbase11.hxx:155
virtual void acquire() SAL_OVERRIDE
Definition: implbase11.hxx:220
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase11.hxx:247
AggImplInheritanceHelper11(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase11.hxx:268
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase11.hxx:179
ImplInheritanceHelper11(T1 const &arg1)
Definition: implbase11.hxx:186
~ImplHelper11()
Definition: implbase11.hxx:96
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase11.hxx:85
virtual void release() SAL_OVERRIDE
decreasing m_refCount
Definition: implbase11.hxx:121
signed char sal_Int8
Definition: types.h:53
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:335
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase11.hxx:123
AggImplInheritanceHelper11(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase11.hxx:263
ImplInheritanceHelper11(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase11.hxx:207
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase11.hxx:110
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase11.hxx:226
virtual void release() SAL_OVERRIDE
decreasing m_refCount
ImplInheritanceHelper11(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase11.hxx:191
ImplInheritanceHelper11(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase11.hxx:200
ImplInheritanceHelper11(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase11.hxx:195
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
If a delegator is set, then the delegator is queried for the demanded interface.
Definition: implbase11.hxx:149
AggImplInheritanceHelper11(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase11.hxx:275
AggImplInheritanceHelper11()
Definition: implbase11.hxx:280
virtual void acquire() SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
Definition: implbase11.hxx:153
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase11.hxx:294
virtual void release() SAL_OVERRIDE
Definition: implbase11.hxx:292
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase11.hxx:296
virtual void acquire() SAL_OVERRIDE
Definition: implbase11.hxx:290
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase11.hxx:157
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase11.hxx:83
virtual void acquire() SAL_OVERRIDE
increasing m_refCount
Definition: implbase11.hxx:119
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase11.hxx:281
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase11.hxx:224
virtual void release() SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
AggImplInheritanceHelper11(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase11.hxx:259