Branch data Line data Source code
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_IMPLBASE10_HXX_
29 : : #define _CPPUHELPER_IMPLBASE10_HXX_
30 : :
31 : : #include <cppuhelper/implbase_ex.hxx>
32 : : #include <rtl/instance.hxx>
33 : :
34 : : namespace cppu
35 : : {
36 : : /// @cond INTERNAL
37 : :
38 : : struct class_data10
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[ 10 + 1 ];
45 : : };
46 : :
47 : : template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Ifc7, typename Ifc8, typename Ifc9, typename Ifc10, typename Impl >
48 : : struct ImplClassData10
49 : : {
50 : 152 : class_data* operator ()()
51 : : {
52 : : static class_data10 s_cd =
53 : : {
54 : : 10 +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 : : { { Ifc8::static_type }, ((sal_IntPtr)(Ifc8 *) (Impl *) 16) - 16 },
65 : : { { Ifc9::static_type }, ((sal_IntPtr)(Ifc9 *) (Impl *) 16) - 16 },
66 : : { { Ifc10::static_type }, ((sal_IntPtr)(Ifc10 *) (Impl *) 16) - 16 },
67 : : { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
68 : : }
69 : : };
70 : 152 : return reinterpret_cast< class_data * >(&s_cd);
71 : : }
72 : : };
73 : :
74 : : /// @endcond
75 : :
76 : : /** Implementation helper implementing interface com::sun::star::lang::XTypeProvider
77 : : and method XInterface::queryInterface(), but no reference counting.
78 : :
79 : : @derive
80 : : Inherit from this class giving your interface(s) to be implemented as template argument(s).
81 : : Your sub class defines method implementations for these interface(s) including acquire()/
82 : : release() and delegates incoming queryInterface() calls to this base class.
83 : : */
84 : : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
85 : 952 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper10
86 : : : public com::sun::star::lang::XTypeProvider
87 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
88 : : {
89 : : 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> > > {};
90 : : public:
91 : 11151 : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
92 : 11151 : { return ImplHelper_query( rType, cd::get(), this ); }
93 : 2 : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
94 : 2 : { return ImplHelper_getTypes( cd::get() ); }
95 : 0 : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
96 : 0 : { return ImplHelper_getImplementationId( cd::get() ); }
97 : :
98 : : #if !defined _MSC_VER // public -> protected changes mangled names there
99 : : protected:
100 : : #endif
101 : 945 : ~ImplHelper10() throw () {}
102 : : };
103 : : /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
104 : : com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
105 : : (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakObject).
106 : :
107 : : @derive
108 : : Inherit from this class giving your interface(s) to be implemented as template argument(s).
109 : : Your sub class defines method implementations for these interface(s).
110 : : */
111 : : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
112 [ - + ]: 937 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper10
113 : : : public OWeakObject
114 : : , public com::sun::star::lang::XTypeProvider
115 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
116 : : {
117 : : 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> > > {};
118 : : public:
119 : 5433 : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
120 : 5433 : { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
121 : 21355 : virtual void SAL_CALL acquire() throw ()
122 : 21355 : { OWeakObject::acquire(); }
123 : 21352 : virtual void SAL_CALL release() throw ()
124 : 21352 : { OWeakObject::release(); }
125 : 0 : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
126 : 0 : { return WeakImplHelper_getTypes( cd::get() ); }
127 : 0 : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
128 : 0 : { return ImplHelper_getImplementationId( cd::get() ); }
129 : : };
130 : : /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
131 : : com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
132 : : (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakAggObject).
133 : : In addition, it supports also aggregation meaning object of this class can be aggregated
134 : : (com::sun::star::uno::XAggregation thru ::cppu::OWeakAggObject).
135 : : If a delegator is set (this object is aggregated), then incoming queryInterface()
136 : : calls are delegated to the delegator object. If the delegator does not support the
137 : : demanded interface, it calls queryAggregation() on its aggregated objects.
138 : :
139 : : @derive
140 : : Inherit from this class giving your interface(s) to be implemented as template argument(s).
141 : : Your sub class defines method implementations for these interface(s).
142 : : */
143 : : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
144 : : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper10
145 : : : public OWeakAggObject
146 : : , public com::sun::star::lang::XTypeProvider
147 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
148 : : {
149 : : 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> > > {};
150 : : public:
151 : : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
152 : : { return OWeakAggObject::queryInterface( rType ); }
153 : : virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
154 : : { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
155 : : virtual void SAL_CALL acquire() throw ()
156 : : { OWeakAggObject::acquire(); }
157 : : virtual void SAL_CALL release() throw ()
158 : : { OWeakAggObject::release(); }
159 : : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
160 : : { return WeakAggImplHelper_getTypes( cd::get() ); }
161 : : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
162 : : { return ImplHelper_getImplementationId( cd::get() ); }
163 : : };
164 : : /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
165 : : com::sun::star::uno::XInterface inherting from a BaseClass.
166 : : All acquire() and release() calls are delegated to the BaseClass. Upon queryInterface(),
167 : : if a demanded interface is not supported by this class directly, the request is
168 : : delegated to the BaseClass.
169 : :
170 : : @attention
171 : : The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface
172 : : and com::sun::star::lang::XTypeProvider are implemented properly. The
173 : : BaseClass must have at least one ctor that can be called with six or
174 : : fewer arguments, of which none is of non-const reference type.
175 : :
176 : : @derive
177 : : Inherit from this class giving your additional interface(s) to be implemented as
178 : : template argument(s). Your sub class defines method implementations for these interface(s).
179 : : */
180 : : template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
181 [ - + ]: 3932 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper10
182 : : : public BaseClass
183 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
184 : : {
185 : : 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> > > {};
186 : : protected:
187 : : template< typename T1 >
188 : : explicit ImplInheritanceHelper10(T1 const & arg1): BaseClass(arg1) {}
189 : : template< typename T1, typename T2 >
190 : : ImplInheritanceHelper10(T1 const & arg1, T2 const & arg2):
191 : : BaseClass(arg1, arg2) {}
192 : : template< typename T1, typename T2, typename T3 >
193 : : ImplInheritanceHelper10(
194 : : T1 const & arg1, T2 const & arg2, T3 const & arg3):
195 : : BaseClass(arg1, arg2, arg3) {}
196 : : template< typename T1, typename T2, typename T3, typename T4 >
197 : : ImplInheritanceHelper10(
198 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
199 : : BaseClass(arg1, arg2, arg3, arg4) {}
200 : : template<
201 : : typename T1, typename T2, typename T3, typename T4, typename T5 >
202 : : ImplInheritanceHelper10(
203 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
204 : : T5 const & arg5):
205 : : BaseClass(arg1, arg2, arg3, arg4, arg5) {}
206 : : template<
207 : : typename T1, typename T2, typename T3, typename T4, typename T5,
208 : : typename T6 >
209 : : ImplInheritanceHelper10(
210 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
211 : : T5 const & arg5, T6 const & arg6):
212 : : BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
213 : : public:
214 : 3932 : ImplInheritanceHelper10() {}
215 : 10962 : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
216 : : {
217 [ + - ][ + - ]: 10962 : com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
218 [ + + ]: 10962 : if (aRet.hasValue())
219 : 5922 : return aRet;
220 [ + - ]: 10962 : return BaseClass::queryInterface( rType );
221 : : }
222 : 45358 : virtual void SAL_CALL acquire() throw ()
223 : 45358 : { BaseClass::acquire(); }
224 : 45358 : virtual void SAL_CALL release() throw ()
225 : 45358 : { BaseClass::release(); }
226 : 0 : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
227 [ # # ][ # # ]: 0 : { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
228 : 0 : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
229 : 0 : { return ImplHelper_getImplementationId( cd::get() ); }
230 : : };
231 : : /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
232 : : com::sun::star::uno::XInterface inherting from a BaseClass.
233 : : All acquire(), release() and queryInterface() calls are delegated to the BaseClass.
234 : : Upon queryAggregation(), if a demanded interface is not supported by this class directly,
235 : : the request is delegated to the BaseClass.
236 : :
237 : : @attention
238 : : The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface,
239 : : com::sun::star::uno::XAggregation and com::sun::star::lang::XTypeProvider
240 : : are implemented properly. The BaseClass must have at least one ctor
241 : : that can be called with six or fewer arguments, of which none is of
242 : : non-const reference type.
243 : :
244 : : @derive
245 : : Inherit from this class giving your additional interface(s) to be implemented as
246 : : template argument(s). Your sub class defines method implementations for these interface(s).
247 : : */
248 : : template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
249 : : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper10
250 : : : public BaseClass
251 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
252 : : {
253 : : 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> > > {};
254 : : protected:
255 : : template< typename T1 >
256 : : explicit AggImplInheritanceHelper10(T1 const & arg1): BaseClass(arg1) {}
257 : : template< typename T1, typename T2 >
258 : : AggImplInheritanceHelper10(T1 const & arg1, T2 const & arg2):
259 : : BaseClass(arg1, arg2) {}
260 : : template< typename T1, typename T2, typename T3 >
261 : : AggImplInheritanceHelper10(
262 : : T1 const & arg1, T2 const & arg2, T3 const & arg3):
263 : : BaseClass(arg1, arg2, arg3) {}
264 : : template< typename T1, typename T2, typename T3, typename T4 >
265 : : AggImplInheritanceHelper10(
266 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
267 : : BaseClass(arg1, arg2, arg3, arg4) {}
268 : : template<
269 : : typename T1, typename T2, typename T3, typename T4, typename T5 >
270 : : AggImplInheritanceHelper10(
271 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
272 : : T5 const & arg5):
273 : : BaseClass(arg1, arg2, arg3, arg4, arg5) {}
274 : : template<
275 : : typename T1, typename T2, typename T3, typename T4, typename T5,
276 : : typename T6 >
277 : : AggImplInheritanceHelper10(
278 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
279 : : T5 const & arg5, T6 const & arg6):
280 : : BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
281 : : public:
282 : : AggImplInheritanceHelper10() {}
283 : : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
284 : : { return BaseClass::queryInterface( rType ); }
285 : : virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
286 : : {
287 : : com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
288 : : if (aRet.hasValue())
289 : : return aRet;
290 : : return BaseClass::queryAggregation( rType );
291 : : }
292 : : virtual void SAL_CALL acquire() throw ()
293 : : { BaseClass::acquire(); }
294 : : virtual void SAL_CALL release() throw ()
295 : : { BaseClass::release(); }
296 : : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
297 : : { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
298 : : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
299 : : { return ImplHelper_getImplementationId( cd::get() ); }
300 : : };
301 : : }
302 : :
303 : : #endif
304 : :
305 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|