LibreOffice
LibreOffice 4.2 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
implbase10.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_IMPLBASE10_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE10_HXX
21 
23 #include <rtl/instance.hxx>
24 
25 namespace cppu
26 {
28 
29  struct class_data10
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[ 10 + 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 Impl >
39  struct ImplClassData10
40  {
41  class_data* operator ()()
42  {
43  static class_data10 s_cd =
44  {
45  10 +1, sal_False, sal_False,
46  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
47  {
48  { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 },
49  { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 },
50  { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 },
51  { { Ifc4::static_type }, ((sal_IntPtr)(Ifc4 *) (Impl *) 16) - 16 },
52  { { Ifc5::static_type }, ((sal_IntPtr)(Ifc5 *) (Impl *) 16) - 16 },
53  { { Ifc6::static_type }, ((sal_IntPtr)(Ifc6 *) (Impl *) 16) - 16 },
54  { { Ifc7::static_type }, ((sal_IntPtr)(Ifc7 *) (Impl *) 16) - 16 },
55  { { Ifc8::static_type }, ((sal_IntPtr)(Ifc8 *) (Impl *) 16) - 16 },
56  { { Ifc9::static_type }, ((sal_IntPtr)(Ifc9 *) (Impl *) 16) - 16 },
57  { { Ifc10::static_type }, ((sal_IntPtr)(Ifc10 *) (Impl *) 16) - 16 },
58  { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
59  }
60  };
61  return reinterpret_cast< class_data * >(&s_cd);
62  }
63  };
64 
66 
75  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
76  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper10
77  : public com::sun::star::lang::XTypeProvider
78  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
79  {
80  struct cd : public rtl::StaticAggregate< class_data, ImplClassData10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, ImplHelper10<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10> > > {};
81  public:
82  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
83  { return ImplHelper_query( rType, cd::get(), this ); }
84  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
85  { return ImplHelper_getTypes( cd::get() ); }
86  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
87  { return ImplHelper_getImplementationId( cd::get() ); }
88 
89 #if !defined _MSC_VER // public -> protected changes mangled names there
90  protected:
91 #endif
92  ~ImplHelper10() throw () {}
93  };
102  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
103  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper10
104  : public OWeakObject
105  , public com::sun::star::lang::XTypeProvider
106  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
107  {
108  struct cd : public rtl::StaticAggregate< class_data, ImplClassData10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, WeakImplHelper10<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10> > > {};
109  public:
110  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
111  { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
112  virtual void SAL_CALL acquire() throw ()
113  { OWeakObject::acquire(); }
114  virtual void SAL_CALL release() throw ()
115  { OWeakObject::release(); }
116  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
117  { return WeakImplHelper_getTypes( cd::get() ); }
118  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
119  { return ImplHelper_getImplementationId( cd::get() ); }
120  };
134  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
135  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper10
136  : public OWeakAggObject
137  , public com::sun::star::lang::XTypeProvider
138  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
139  {
140  struct cd : public rtl::StaticAggregate< class_data, ImplClassData10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, WeakAggImplHelper10<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10> > > {};
141  public:
142  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
143  { return OWeakAggObject::queryInterface( rType ); }
144  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
145  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
146  virtual void SAL_CALL acquire() throw ()
148  virtual void SAL_CALL release() throw ()
150  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
151  { return WeakAggImplHelper_getTypes( cd::get() ); }
152  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
153  { return ImplHelper_getImplementationId( cd::get() ); }
154  };
171  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
172  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper10
173  : public BaseClass
174  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
175  {
176  struct cd : public rtl::StaticAggregate< class_data, ImplClassData10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, ImplInheritanceHelper10<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10> > > {};
177  protected:
178  template< typename T1 >
179  explicit ImplInheritanceHelper10(T1 const & arg1): BaseClass(arg1) {}
180  template< typename T1, typename T2 >
181  ImplInheritanceHelper10(T1 const & arg1, T2 const & arg2):
182  BaseClass(arg1, arg2) {}
183  template< typename T1, typename T2, typename T3 >
185  T1 const & arg1, T2 const & arg2, T3 const & arg3):
186  BaseClass(arg1, arg2, arg3) {}
187  template< typename T1, typename T2, typename T3, typename T4 >
189  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
190  BaseClass(arg1, arg2, arg3, arg4) {}
191  template<
192  typename T1, typename T2, typename T3, typename T4, typename T5 >
194  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
195  T5 const & arg5):
196  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
197  template<
198  typename T1, typename T2, typename T3, typename T4, typename T5,
199  typename T6 >
201  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
202  T5 const & arg5, T6 const & arg6):
203  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
204  public:
206  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
207  {
208  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
209  if (aRet.hasValue())
210  return aRet;
211  return BaseClass::queryInterface( rType );
212  }
213  virtual void SAL_CALL acquire() throw ()
214  { BaseClass::acquire(); }
215  virtual void SAL_CALL release() throw ()
216  { BaseClass::release(); }
217  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
218  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
219  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
220  { return ImplHelper_getImplementationId( cd::get() ); }
221  };
239  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
240  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper10
241  : public BaseClass
242  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
243  {
244  struct cd : public rtl::StaticAggregate< class_data, ImplClassData10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, AggImplInheritanceHelper10<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10> > > {};
245  protected:
246  template< typename T1 >
247  explicit AggImplInheritanceHelper10(T1 const & arg1): BaseClass(arg1) {}
248  template< typename T1, typename T2 >
249  AggImplInheritanceHelper10(T1 const & arg1, T2 const & arg2):
250  BaseClass(arg1, arg2) {}
251  template< typename T1, typename T2, typename T3 >
253  T1 const & arg1, T2 const & arg2, T3 const & arg3):
254  BaseClass(arg1, arg2, arg3) {}
255  template< typename T1, typename T2, typename T3, typename T4 >
257  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
258  BaseClass(arg1, arg2, arg3, arg4) {}
259  template<
260  typename T1, typename T2, typename T3, typename T4, typename T5 >
262  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
263  T5 const & arg5):
264  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
265  template<
266  typename T1, typename T2, typename T3, typename T4, typename T5,
267  typename T6 >
269  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
270  T5 const & arg5, T6 const & arg6):
271  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
272  public:
274  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
275  { return BaseClass::queryInterface( rType ); }
276  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
277  {
278  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
279  if (aRet.hasValue())
280  return aRet;
281  return BaseClass::queryAggregation( rType );
282  }
283  virtual void SAL_CALL acquire() throw ()
284  { BaseClass::acquire(); }
285  virtual void SAL_CALL release() throw ()
286  { BaseClass::release(); }
287  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
288  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
289  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
290  { return ImplHelper_getImplementationId( cd::get() ); }
291  };
292 }
293 
294 #endif
295 
296 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void acquire()
Definition: implbase10.hxx:283
virtual void release()
Definition: implbase10.hxx:285
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase10.hxx:116
virtual void acquire()
increasing m_refCount
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase10.hxx:240
virtual com::sun::star::uno::Any queryAggregation(com::sun::star::uno::Type const &rType)
Definition: implbase10.hxx:276
ImplInheritanceHelper10(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase10.hxx:193
virtual void release()
If a delegator is set, then the delegators gets released.
Helper class for a late-initialized static aggregate, e.g.
Definition: instance.hxx:542
ImplInheritanceHelper10()
Definition: implbase10.hxx:205
virtual void release()
decreasing m_refCount
Definition: implbase10.hxx:114
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase10.hxx:172
AggImplInheritanceHelper10(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase10.hxx:261
C++ class representing an IDL meta type.
Definition: Type.h:55
~ImplHelper10()
Definition: implbase10.hxx:92
Base class to implement an UNO object supporting weak references, i.e.
Definition: weakagg.hxx:40
inline::com::sun::star::uno::Any queryInterface(const ::com::sun::star::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:39
AggImplInheritanceHelper10(T1 const &arg1)
Definition: implbase10.hxx:247
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase10.hxx:152
ImplInheritanceHelper10(T1 const &arg1)
Definition: implbase10.hxx:179
virtual void release()
If a delegator is set, then the delegators gets released.
Definition: implbase10.hxx:148
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase10.hxx:150
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase10.hxx:110
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:315
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase10.hxx:82
AggImplInheritanceHelper10(T1 const &arg1, T2 const &arg2)
Definition: implbase10.hxx:249
virtual void release()
Definition: implbase10.hxx:215
virtual void release()
decreasing m_refCount
virtual void acquire()
increasing m_refCount
Definition: implbase10.hxx:112
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase10.hxx:86
ImplInheritanceHelper10(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase10.hxx:200
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase10.hxx:135
AggImplInheritanceHelper10(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase10.hxx:252
virtual com::sun::star::uno::Any queryAggregation(com::sun::star::uno::Type const &rType)
Definition: implbase10.hxx:144
virtual ::com::sun::star::uno::Any queryInterface(const ::com::sun::star::uno::Type &rType)
If a delegator is set, then the delegator is queried for the demanded interface.
virtual void acquire()
If a delegator is set, then the delegators gets acquired.
Definition: implbase10.hxx:146
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase10.hxx:142
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase10.hxx:219
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase10.hxx:118
AggImplInheritanceHelper10()
Definition: implbase10.hxx:273
ImplInheritanceHelper10(T1 const &arg1, T2 const &arg2)
Definition: implbase10.hxx:181
C++ class representing an IDL any.
Definition: Any.h:46
virtual void acquire()
Definition: implbase10.hxx:213
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase10.hxx:84
unsigned char sal_Bool
Definition: types.h:46
sal_Bool hasValue() const
Tests if any contains a value.
Definition: Any.h:150
ImplInheritanceHelper10(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase10.hxx:184
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase10.hxx:287
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase10.hxx:217
virtual void acquire()
If a delegator is set, then the delegators gets acquired.
Base class to implement an UNO object supporting weak references, i.e.
Definition: weak.hxx:43
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase10.hxx:274
#define sal_False
Definition: types.h:47
AggImplInheritanceHelper10(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase10.hxx:256
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase10.hxx:103
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase10.hxx:289
signed char sal_Int8
Definition: types.h:51
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase10.hxx:206
ImplInheritanceHelper10(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase10.hxx:188
Implementation helper implementing interface com::sun::star::lang::XTypeProvider and method XInterfac...
Definition: implbase10.hxx:76
Template C++ class representing an IDL sequence.
Definition: unotype.hxx:33
AggImplInheritanceHelper10(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase10.hxx:268