LibreOffice
LibreOffice 5.1 SDK C/C++ API Reference
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, sal_False, sal_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 #endif
88  ~ImplHelper6() throw () {}
89  };
98  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
99  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper6
100  : public OWeakObject
101  , public css::lang::XTypeProvider
102  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
103  {
104  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
105  public:
106  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
107  { return WeakImplHelper_query( rType, cd::get(), this, static_cast<OWeakObject *>(this) ); }
108  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
109  { OWeakObject::acquire(); }
110  virtual void SAL_CALL release() throw () SAL_OVERRIDE
111  { OWeakObject::release(); }
112  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
113  { return WeakImplHelper_getTypes( cd::get() ); }
114  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
115  { return ImplHelper_getImplementationId( cd::get() ); }
116  };
130  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
131  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper6
132  : public OWeakAggObject
133  , public css::lang::XTypeProvider
134  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
135  {
136  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakAggImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
137  public:
138  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
139  { return OWeakAggObject::queryInterface( rType ); }
140  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
141  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, static_cast<OWeakAggObject *>(this) ); }
142  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
144  virtual void SAL_CALL release() throw () SAL_OVERRIDE
146  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
147  { return WeakAggImplHelper_getTypes( cd::get() ); }
148  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
149  { return ImplHelper_getImplementationId( cd::get() ); }
150  };
167  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
168  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper6
169  : public BaseClass
170  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
171  {
172  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, ImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
173  protected:
174  template< typename T1 >
175  explicit ImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
176  template< typename T1, typename T2 >
177  ImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
178  BaseClass(arg1, arg2) {}
179  template< typename T1, typename T2, typename T3 >
181  T1 const & arg1, T2 const & arg2, T3 const & arg3):
182  BaseClass(arg1, arg2, arg3) {}
183  template< typename T1, typename T2, typename T3, typename T4 >
185  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
186  BaseClass(arg1, arg2, arg3, arg4) {}
187  template<
188  typename T1, typename T2, typename T3, typename T4, typename T5 >
190  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
191  T5 const & arg5):
192  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
193  template<
194  typename T1, typename T2, typename T3, typename T4, typename T5,
195  typename T6 >
197  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
198  T5 const & arg5, T6 const & arg6):
199  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
200  public:
202  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
203  {
204  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
205  if (aRet.hasValue())
206  return aRet;
207  return BaseClass::queryInterface( rType );
208  }
209  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
210  { BaseClass::acquire(); }
211  virtual void SAL_CALL release() throw () SAL_OVERRIDE
212  { BaseClass::release(); }
213  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
214  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
215  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
216  { return ImplHelper_getImplementationId( cd::get() ); }
217  };
235  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
236  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper6
237  : public BaseClass
238  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
239  {
240  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, AggImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
241  protected:
242  template< typename T1 >
243  explicit AggImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
244  template< typename T1, typename T2 >
245  AggImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
246  BaseClass(arg1, arg2) {}
247  template< typename T1, typename T2, typename T3 >
249  T1 const & arg1, T2 const & arg2, T3 const & arg3):
250  BaseClass(arg1, arg2, arg3) {}
251  template< typename T1, typename T2, typename T3, typename T4 >
253  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
254  BaseClass(arg1, arg2, arg3, arg4) {}
255  template<
256  typename T1, typename T2, typename T3, typename T4, typename T5 >
258  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
259  T5 const & arg5):
260  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
261  template<
262  typename T1, typename T2, typename T3, typename T4, typename T5,
263  typename T6 >
265  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
266  T5 const & arg5, T6 const & arg6):
267  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
268  public:
270  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
271  { return BaseClass::queryInterface( rType ); }
272  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
273  {
274  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
275  if (aRet.hasValue())
276  return aRet;
277  return BaseClass::queryAggregation( rType );
278  }
279  virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
280  { BaseClass::acquire(); }
281  virtual void SAL_CALL release() throw () SAL_OVERRIDE
282  { BaseClass::release(); }
283  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException) SAL_OVERRIDE
284  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
285  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException) SAL_OVERRIDE
286  { return ImplHelper_getImplementationId( cd::get() ); }
287  };
288 }
289 
290 #endif
291 
292 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase6.hxx:148
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase6.hxx:106
~ImplHelper6()
Definition: implbase6.hxx:88
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase6.hxx:99
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:202
virtual void release() SAL_OVERRIDE
Definition: implbase6.hxx:281
Definition: Enterable.hxx:26
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:108
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:279
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase6.hxx:272
ImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase6.hxx:196
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:146
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase6.hxx:168
virtual void acquire() SAL_OVERRIDE
increasing m_refCount
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase6.hxx:270
ImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase6.hxx:184
#define SAL_OVERRIDE
C++11 "override" feature.
Definition: types.h:421
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase6.hxx:285
Base class to implement an UNO object supporting weak references, i.e.
Definition: weakagg.hxx:41
Definition: types.h:389
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:180
virtual void release() SAL_OVERRIDE
decreasing m_refCount
Definition: implbase6.hxx:110
AggImplInheritanceHelper6()
Definition: implbase6.hxx:269
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase6.hxx:140
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:142
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:333
AggImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase6.hxx:257
#define sal_False
Definition: types.h:49
virtual void release() SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
Definition: implbase6.hxx:144
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:264
virtual void release() SAL_OVERRIDE
Definition: implbase6.hxx:211
AggImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase6.hxx:248
ImplInheritanceHelper6()
Definition: implbase6.hxx:201
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase6.hxx:138
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase6.hxx:114
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase6.hxx:215
AggImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase6.hxx:252
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase6.hxx:236
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase6.hxx:283
AggImplInheritanceHelper6(T1 const &arg1)
Definition: implbase6.hxx:243
Implementation helper implementing interface css::lang::XTypeProvider and method XInterface::queryInt...
Definition: implbase6.hxx:72
ImplInheritanceHelper6(T1 const &arg1)
Definition: implbase6.hxx:175
virtual void acquire() SAL_OVERRIDE
Definition: implbase6.hxx:209
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase6.hxx:131
ImplInheritanceHelper6(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase6.hxx:189
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase6.hxx:213
ImplInheritanceHelper6(T1 const &arg1, T2 const &arg2)
Definition: implbase6.hxx:177
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase6.hxx:112
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:245