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