LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
implbase6.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_IMPLBASE6_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE6_HXX
21 
23 #include <rtl/instance.hxx>
24 
25 namespace cppu
26 {
28 
29  struct class_data6
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[ 6 + 1 ];
36  };
37 
38  template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Impl >
39  struct ImplClassData6
40  {
41  class_data* operator ()()
42  {
43  static class_data6 s_cd =
44  {
45  6 +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(css::lang::XTypeProvider)
55  }
56  };
57  return reinterpret_cast< class_data * >(&s_cd);
58  }
59  };
60 
62 
71  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
72  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper6
73  : public css::lang::XTypeProvider
74  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
75  {
76  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, ImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
77  public:
78  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
79  { return ImplHelper_query( rType, cd::get(), this ); }
80  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
81  { return ImplHelper_getTypes( cd::get() ); }
82  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
83  { return ImplHelper_getImplementationId( cd::get() ); }
84 
85 #if !defined _MSC_VER // public -> protected changes mangled names there
86  protected:
87 #elif defined __clang__
88 #pragma clang diagnostic push
89 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
90 #endif
91  ~ImplHelper6() throw () {}
92 #if defined _MSC_VER && defined __clang__
93 #pragma clang diagnostic pop
94 #endif
95  };
104  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
105  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper6
106  : public OWeakObject
107  , public css::lang::XTypeProvider
108  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
109  {
110  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
111  public:
112  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
113  { return WeakImplHelper_query( rType, cd::get(), this, static_cast<OWeakObject *>(this) ); }
114  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
115  { OWeakObject::acquire(); }
116  virtual void SAL_CALL release() throw () SAL_OVERRIDE
117  { OWeakObject::release(); }
118  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
119  { return WeakImplHelper_getTypes( cd::get() ); }
120  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
121  { return ImplHelper_getImplementationId( cd::get() ); }
122  };
136  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
137  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper6
138  : public OWeakAggObject
139  , public css::lang::XTypeProvider
140  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
141  {
142  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakAggImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
143  public:
144  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
145  { return OWeakAggObject::queryInterface( rType ); }
146  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
147  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, static_cast<OWeakAggObject *>(this) ); }
148  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
150  virtual void SAL_CALL release() throw () SAL_OVERRIDE
152  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
153  { return WeakAggImplHelper_getTypes( cd::get() ); }
154  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
155  { return ImplHelper_getImplementationId( cd::get() ); }
156  };
173  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
174  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper6
175  : public BaseClass
176  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
177  {
178  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, ImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
179  protected:
180  template< typename T1 >
181  explicit ImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
182  template< typename T1, typename T2 >
183  ImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
184  BaseClass(arg1, arg2) {}
185  template< typename T1, typename T2, typename T3 >
187  T1 const & arg1, T2 const & arg2, T3 const & arg3):
188  BaseClass(arg1, arg2, arg3) {}
189  template< typename T1, typename T2, typename T3, typename T4 >
191  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
192  BaseClass(arg1, arg2, arg3, arg4) {}
193  template<
194  typename T1, typename T2, typename T3, typename T4, typename T5 >
196  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
197  T5 const & arg5):
198  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
199  template<
200  typename T1, typename T2, typename T3, typename T4, typename T5,
201  typename T6 >
203  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
204  T5 const & arg5, T6 const & arg6):
205  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
206  public:
208  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
209  {
210  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
211  if (aRet.hasValue())
212  return aRet;
213  return BaseClass::queryInterface( rType );
214  }
215  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
216  { BaseClass::acquire(); }
217  virtual void SAL_CALL release() throw () SAL_OVERRIDE
218  { BaseClass::release(); }
219  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
220  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
221  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
222  { return ImplHelper_getImplementationId( cd::get() ); }
223  };
241  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
242  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper6
243  : public BaseClass
244  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
245  {
246  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, AggImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
247  protected:
248  template< typename T1 >
249  explicit AggImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
250  template< typename T1, typename T2 >
251  AggImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
252  BaseClass(arg1, arg2) {}
253  template< typename T1, typename T2, typename T3 >
255  T1 const & arg1, T2 const & arg2, T3 const & arg3):
256  BaseClass(arg1, arg2, arg3) {}
257  template< typename T1, typename T2, typename T3, typename T4 >
259  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
260  BaseClass(arg1, arg2, arg3, arg4) {}
261  template<
262  typename T1, typename T2, typename T3, typename T4, typename T5 >
264  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
265  T5 const & arg5):
266  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
267  template<
268  typename T1, typename T2, typename T3, typename T4, typename T5,
269  typename T6 >
271  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
272  T5 const & arg5, T6 const & arg6):
273  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
274  public:
276  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
277  { return BaseClass::queryInterface( rType ); }
278  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
279  {
280  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
281  if (aRet.hasValue())
282  return aRet;
283  return BaseClass::queryAggregation( rType );
284  }
285  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
286  { BaseClass::acquire(); }
287  virtual void SAL_CALL release() throw () SAL_OVERRIDE
288  { BaseClass::release(); }
289  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException) SAL_OVERRIDE
290  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
291  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException) SAL_OVERRIDE
292  { return ImplHelper_getImplementationId( cd::get() ); }
293  };
294 }
295 
296 #endif
297 
298 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase6.hxx:154
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: implbase6.hxx:112
~ImplHelper6()
Definition: implbase6.hxx:91
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase6.hxx:105
Base class to implement an UNO object supporting weak references, i.e.
Definition: weak.hxx:43
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase6.hxx:208
virtual void release() SAL_OVERRIDE
Definition: implbase6.hxx:287
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase6.hxx:78
virtual void acquire() SAL_OVERRIDE
increasing m_refCount
Definition: implbase6.hxx:114
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 void acquire() SAL_OVERRIDE
Definition: implbase6.hxx:285
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase6.hxx:278
ImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase6.hxx:202
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:39
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase6.hxx:152
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase6.hxx:174
virtual void acquire() SAL_OVERRIDE
increasing m_refCount
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase6.hxx:276
ImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase6.hxx:190
#define SAL_OVERRIDE
C++11 &quot;override&quot; feature.
Definition: types.h:423
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase6.hxx:291
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
ImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase6.hxx:186
virtual void release() SAL_OVERRIDE
decreasing m_refCount
Definition: implbase6.hxx:116
AggImplInheritanceHelper6()
Definition: implbase6.hxx:275
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Called by the delegator or queryInterface.
Definition: implbase6.hxx:146
signed char sal_Int8
Definition: types.h:53
virtual void acquire() SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
Definition: implbase6.hxx:148
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:335
AggImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase6.hxx:263
virtual void release() SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
Definition: implbase6.hxx:150
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase6.hxx:82
virtual void release() SAL_OVERRIDE
decreasing m_refCount
AggImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase6.hxx:270
virtual void release() SAL_OVERRIDE
Definition: implbase6.hxx:217
AggImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase6.hxx:254
ImplInheritanceHelper6()
Definition: implbase6.hxx:207
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: implbase6.hxx:144
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase6.hxx:120
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase6.hxx:221
AggImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase6.hxx:258
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase6.hxx:242
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase6.hxx:289
AggImplInheritanceHelper6(T1 const &arg1)
Definition: implbase6.hxx:249
Implementation helper implementing interface css::lang::XTypeProvider and method XInterface::queryInt...
Definition: implbase6.hxx:72
ImplInheritanceHelper6(T1 const &arg1)
Definition: implbase6.hxx:181
virtual void acquire() SAL_OVERRIDE
Definition: implbase6.hxx:215
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase6.hxx:137
ImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase6.hxx:195
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase6.hxx:219
ImplInheritanceHelper6(T1 const &arg1, T2 const &arg2)
Definition: implbase6.hxx:183
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase6.hxx:118
virtual void release() SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase6.hxx:80
AggImplInheritanceHelper6(T1 const &arg1, T2 const &arg2)
Definition: implbase6.hxx:251