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