My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
implbase4.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_IMPLBASE4_HXX_
29 #define _CPPUHELPER_IMPLBASE4_HXX_
30 
32 #include <rtl/instance.hxx>
33 
34 namespace cppu
35 {
37 
38  struct class_data4
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[ 4 + 1 ];
45  };
46 
47  template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Impl >
48  struct ImplClassData4
49  {
50  class_data* operator ()()
51  {
52  static class_data4 s_cd =
53  {
54  4 +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  { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
62  }
63  };
64  return reinterpret_cast< class_data * >(&s_cd);
65  }
66  };
67 
69 
78  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 >
79  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper4
80  : public com::sun::star::lang::XTypeProvider
81  , public Ifc1, public Ifc2, public Ifc3, public Ifc4
82  {
83  struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, ImplHelper4<Ifc1, Ifc2, Ifc3, Ifc4> > > {};
84  public:
85  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
86  { return ImplHelper_query( rType, cd::get(), this ); }
87  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
88  { return ImplHelper_getTypes( cd::get() ); }
89  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
90  { return ImplHelper_getImplementationId( cd::get() ); }
91 
92 #if !defined _MSC_VER // public -> protected changes mangled names there
93  protected:
94 #endif
95  ~ImplHelper4() throw () {}
96  };
105  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 >
106  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper4
107  : public OWeakObject
108  , public com::sun::star::lang::XTypeProvider
109  , public Ifc1, public Ifc2, public Ifc3, public Ifc4
110  {
111  struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, WeakImplHelper4<Ifc1, Ifc2, Ifc3, Ifc4> > > {};
112  public:
113  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
114  { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
115  virtual void SAL_CALL acquire() throw ()
116  { OWeakObject::acquire(); }
117  virtual void SAL_CALL release() throw ()
118  { OWeakObject::release(); }
119  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
120  { return WeakImplHelper_getTypes( cd::get() ); }
121  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
122  { return ImplHelper_getImplementationId( cd::get() ); }
123  };
137  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 >
138  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper4
139  : public OWeakAggObject
140  , public com::sun::star::lang::XTypeProvider
141  , public Ifc1, public Ifc2, public Ifc3, public Ifc4
142  {
143  struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, WeakAggImplHelper4<Ifc1, Ifc2, Ifc3, Ifc4> > > {};
144  public:
145  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
146  { return OWeakAggObject::queryInterface( rType ); }
147  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
148  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
149  virtual void SAL_CALL acquire() throw ()
151  virtual void SAL_CALL release() throw ()
153  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
154  { return WeakAggImplHelper_getTypes( cd::get() ); }
155  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
156  { return ImplHelper_getImplementationId( cd::get() ); }
157  };
174  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4 >
175  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper4
176  : public BaseClass
177  , public Ifc1, public Ifc2, public Ifc3, public Ifc4
178  {
179  struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, ImplInheritanceHelper4<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4> > > {};
180  protected:
181  template< typename T1 >
182  explicit ImplInheritanceHelper4(T1 const & arg1): BaseClass(arg1) {}
183  template< typename T1, typename T2 >
184  ImplInheritanceHelper4(T1 const & arg1, T2 const & arg2):
185  BaseClass(arg1, arg2) {}
186  template< typename T1, typename T2, typename T3 >
188  T1 const & arg1, T2 const & arg2, T3 const & arg3):
189  BaseClass(arg1, arg2, arg3) {}
190  template< typename T1, typename T2, typename T3, typename T4 >
192  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
193  BaseClass(arg1, arg2, arg3, arg4) {}
194  template<
195  typename T1, typename T2, typename T3, typename T4, typename T5 >
197  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
198  T5 const & arg5):
199  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
200  template<
201  typename T1, typename T2, typename T3, typename T4, typename T5,
202  typename T6 >
204  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
205  T5 const & arg5, T6 const & arg6):
206  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
207  public:
209  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
210  {
211  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
212  if (aRet.hasValue())
213  return aRet;
214  return BaseClass::queryInterface( rType );
215  }
216  virtual void SAL_CALL acquire() throw ()
217  { BaseClass::acquire(); }
218  virtual void SAL_CALL release() throw ()
219  { BaseClass::release(); }
220  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
221  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
222  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
223  { return ImplHelper_getImplementationId( cd::get() ); }
224  };
242  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4 >
243  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper4
244  : public BaseClass
245  , public Ifc1, public Ifc2, public Ifc3, public Ifc4
246  {
247  struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, AggImplInheritanceHelper4<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4> > > {};
248  protected:
249  template< typename T1 >
250  explicit AggImplInheritanceHelper4(T1 const & arg1): BaseClass(arg1) {}
251  template< typename T1, typename T2 >
252  AggImplInheritanceHelper4(T1 const & arg1, T2 const & arg2):
253  BaseClass(arg1, arg2) {}
254  template< typename T1, typename T2, typename T3 >
256  T1 const & arg1, T2 const & arg2, T3 const & arg3):
257  BaseClass(arg1, arg2, arg3) {}
258  template< typename T1, typename T2, typename T3, typename T4 >
260  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
261  BaseClass(arg1, arg2, arg3, arg4) {}
262  template<
263  typename T1, typename T2, typename T3, typename T4, typename T5 >
265  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
266  T5 const & arg5):
267  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
268  template<
269  typename T1, typename T2, typename T3, typename T4, typename T5,
270  typename T6 >
272  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
273  T5 const & arg5, T6 const & arg6):
274  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
275  public:
277  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
278  { return BaseClass::queryInterface( rType ); }
279  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
280  {
281  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
282  if (aRet.hasValue())
283  return aRet;
284  return BaseClass::queryAggregation( rType );
285  }
286  virtual void SAL_CALL acquire() throw ()
287  { BaseClass::acquire(); }
288  virtual void SAL_CALL release() throw ()
289  { BaseClass::release(); }
290  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
291  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
292  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
293  { return ImplHelper_getImplementationId( cd::get() ); }
294  };
295 }
296 
297 #endif
298 
299 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */