My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
implbase7.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org. If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 #ifndef _CPPUHELPER_IMPLBASE7_HXX_
29 #define _CPPUHELPER_IMPLBASE7_HXX_
30 
32 #include <rtl/instance.hxx>
33 
34 namespace cppu
35 {
37 
38  struct class_data7
39  {
40  sal_Int16 m_nTypes;
41  sal_Bool m_storedTypeRefs;
42  sal_Bool m_storedId;
43  sal_Int8 m_id[ 16 ];
44  type_entry m_typeEntries[ 7 + 1 ];
45  };
46 
47  template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Ifc7, typename Impl >
48  struct ImplClassData7
49  {
50  class_data* operator ()()
51  {
52  static class_data7 s_cd =
53  {
54  7 +1, sal_False, sal_False,
55  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
56  {
57  { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 },
58  { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 },
59  { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 },
60  { { Ifc4::static_type }, ((sal_IntPtr)(Ifc4 *) (Impl *) 16) - 16 },
61  { { Ifc5::static_type }, ((sal_IntPtr)(Ifc5 *) (Impl *) 16) - 16 },
62  { { Ifc6::static_type }, ((sal_IntPtr)(Ifc6 *) (Impl *) 16) - 16 },
63  { { Ifc7::static_type }, ((sal_IntPtr)(Ifc7 *) (Impl *) 16) - 16 },
64  { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
65  }
66  };
67  return reinterpret_cast< class_data * >(&s_cd);
68  }
69  };
70 
72 
81  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
82  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper7
83  : public com::sun::star::lang::XTypeProvider
84  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
85  {
86  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, ImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
87  public:
88  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
89  { return ImplHelper_query( rType, cd::get(), this ); }
90  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
91  { return ImplHelper_getTypes( cd::get() ); }
92  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
93  { return ImplHelper_getImplementationId( cd::get() ); }
94 
95 #if !defined _MSC_VER // public -> protected changes mangled names there
96  protected:
97 #endif
98  ~ImplHelper7() throw () {}
99  };
108  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
109  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper7
110  : public OWeakObject
111  , public com::sun::star::lang::XTypeProvider
112  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
113  {
114  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, WeakImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
115  public:
116  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
117  { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
118  virtual void SAL_CALL acquire() throw ()
119  { OWeakObject::acquire(); }
120  virtual void SAL_CALL release() throw ()
121  { OWeakObject::release(); }
122  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
123  { return WeakImplHelper_getTypes( cd::get() ); }
124  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
125  { return ImplHelper_getImplementationId( cd::get() ); }
126  };
140  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
141  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper7
142  : public OWeakAggObject
143  , public com::sun::star::lang::XTypeProvider
144  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
145  {
146  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, WeakAggImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
147  public:
148  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
149  { return OWeakAggObject::queryInterface( rType ); }
150  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
151  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
152  virtual void SAL_CALL acquire() throw ()
154  virtual void SAL_CALL release() throw ()
156  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
157  { return WeakAggImplHelper_getTypes( cd::get() ); }
158  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
159  { return ImplHelper_getImplementationId( cd::get() ); }
160  };
177  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
178  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper7
179  : public BaseClass
180  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
181  {
182  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, ImplInheritanceHelper7<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
183  protected:
184  template< typename T1 >
185  explicit ImplInheritanceHelper7(T1 const & arg1): BaseClass(arg1) {}
186  template< typename T1, typename T2 >
187  ImplInheritanceHelper7(T1 const & arg1, T2 const & arg2):
188  BaseClass(arg1, arg2) {}
189  template< typename T1, typename T2, typename T3 >
191  T1 const & arg1, T2 const & arg2, T3 const & arg3):
192  BaseClass(arg1, arg2, arg3) {}
193  template< typename T1, typename T2, typename T3, typename T4 >
195  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
196  BaseClass(arg1, arg2, arg3, arg4) {}
197  template<
198  typename T1, typename T2, typename T3, typename T4, typename T5 >
200  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
201  T5 const & arg5):
202  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
203  template<
204  typename T1, typename T2, typename T3, typename T4, typename T5,
205  typename T6 >
207  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
208  T5 const & arg5, T6 const & arg6):
209  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
210  public:
212  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
213  {
214  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
215  if (aRet.hasValue())
216  return aRet;
217  return BaseClass::queryInterface( rType );
218  }
219  virtual void SAL_CALL acquire() throw ()
220  { BaseClass::acquire(); }
221  virtual void SAL_CALL release() throw ()
222  { BaseClass::release(); }
223  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
224  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
225  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
226  { return ImplHelper_getImplementationId( cd::get() ); }
227  };
245  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
246  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper7
247  : public BaseClass
248  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
249  {
250  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, AggImplInheritanceHelper7<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
251  protected:
252  template< typename T1 >
253  explicit AggImplInheritanceHelper7(T1 const & arg1): BaseClass(arg1) {}
254  template< typename T1, typename T2 >
255  AggImplInheritanceHelper7(T1 const & arg1, T2 const & arg2):
256  BaseClass(arg1, arg2) {}
257  template< typename T1, typename T2, typename T3 >
259  T1 const & arg1, T2 const & arg2, T3 const & arg3):
260  BaseClass(arg1, arg2, arg3) {}
261  template< typename T1, typename T2, typename T3, typename T4 >
263  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
264  BaseClass(arg1, arg2, arg3, arg4) {}
265  template<
266  typename T1, typename T2, typename T3, typename T4, typename T5 >
268  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
269  T5 const & arg5):
270  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
271  template<
272  typename T1, typename T2, typename T3, typename T4, typename T5,
273  typename T6 >
275  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
276  T5 const & arg5, T6 const & arg6):
277  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
278  public:
280  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
281  { return BaseClass::queryInterface( rType ); }
282  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
283  {
284  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
285  if (aRet.hasValue())
286  return aRet;
287  return BaseClass::queryAggregation( rType );
288  }
289  virtual void SAL_CALL acquire() throw ()
290  { BaseClass::acquire(); }
291  virtual void SAL_CALL release() throw ()
292  { BaseClass::release(); }
293  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
294  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
295  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
296  { return ImplHelper_getImplementationId( cd::get() ); }
297  };
298 }
299 
300 #endif
301 
302 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */