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