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