LibreOffice: cppuhelper/implbase3.hxx Source File

LibreOffice LibreOffice 5.1 SDK C/C++ API Reference

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 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19 #ifndef INCLUDED_CPPUHELPER_IMPLBASE3_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE3_HXX
21
22 #include <cppuhelper/implbase_ex.hxx>
23 #include <rtl/instance.hxx>
24
25 namespace cppu
26 {
28
29 struct class_data3
30 {
31 sal_Int16 m_nTypes;
32 sal_Bool m_storedTypeRefs;
33 sal_Bool m_storedId;
34 sal_Int8 m_id[ 16 ];
35 type_entry m_typeEntries[ 3 + 1 ];
36 };
37
38 template< typename Ifc1, typename Ifc2, typename Ifc3, typename Impl > struct ImplClassData3
39 {
40 class_data* operator ()()
41 {
42 static class_data3 s_cd =
43 {
44 3 +1, sal_False, sal_False,
45 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
46 {
47 CPPUHELPER_DETAIL_TYPEENTRY(Ifc1),
48 CPPUHELPER_DETAIL_TYPEENTRY(Ifc2),
49 CPPUHELPER_DETAIL_TYPEENTRY(Ifc3),
50 CPPUHELPER_DETAIL_TYPEENTRY(css::lang::XTypeProvider)
51 }
52 };
53 return reinterpret_cast< class_data * >(&s_cd);
54 }
55 };
56
58
67 template< class Ifc1, class Ifc2, class Ifc3 >
68 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper3
69 : public css::lang::XTypeProvider
70 , public Ifc1, public Ifc2, public Ifc3
71 {
72 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, ImplHelper3<Ifc1, Ifc2, Ifc3> > > {};
73 public:
74 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
75 { return ImplHelper_query( rType, cd::get(), this ); }
76 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
77 { return ImplHelper_getTypes( cd::get() ); }
78 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
79 { return ImplHelper_getImplementationId( cd::get() ); }
80
81 #if !defined _MSC_VER // public -> protected changes mangled names there
82 protected:
83 #endif
84 ~ImplHelper3() throw () {}
85 };
94 template< class Ifc1, class Ifc2, class Ifc3 >
95 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper3
96 : public OWeakObject
97 , public css::lang::XTypeProvider
98 , public Ifc1, public Ifc2, public Ifc3
99 {
100 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, WeakImplHelper3<Ifc1, Ifc2, Ifc3> > > {};
101 public:
102 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
103 { return WeakImplHelper_query( rType, cd::get(), this, static_cast<OWeakObject *>(this) ); }
104 virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
105 { OWeakObject::acquire(); }
106 virtual void SAL_CALL release() throw () SAL_OVERRIDE
107 { OWeakObject::release(); }
108 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
109 { return WeakImplHelper_getTypes( cd::get() ); }
110 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
111 { return ImplHelper_getImplementationId( cd::get() ); }
112 };
126 template< class Ifc1, class Ifc2, class Ifc3 >
127 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper3
128 : public OWeakAggObject
129 , public css::lang::XTypeProvider
130 , public Ifc1, public Ifc2, public Ifc3
131 {
132 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, WeakAggImplHelper3<Ifc1, Ifc2, Ifc3> > > {};
133 public:
134 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
135 { return OWeakAggObject::queryInterface( rType ); }
136 virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
137 { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, static_cast<OWeakAggObject *>(this) ); }
138 virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
139 { OWeakAggObject::acquire(); }
140 virtual void SAL_CALL release() throw () SAL_OVERRIDE
141 { OWeakAggObject::release(); }
142 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
143 { return WeakAggImplHelper_getTypes( cd::get() ); }
144 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
145 { return ImplHelper_getImplementationId( cd::get() ); }
146 };
164 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3 >
165 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper3
166 : public BaseClass
167 , public Ifc1, public Ifc2, public Ifc3
168 {
169 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, ImplInheritanceHelper3<BaseClass, Ifc1, Ifc2, Ifc3> > > {};
170 protected:
171 template< typename T1 >
172 explicit ImplInheritanceHelper3(T1 const & arg1): BaseClass(arg1) {}
173 template< typename T1, typename T2 >
174 ImplInheritanceHelper3(T1 const & arg1, T2 const & arg2):
175 BaseClass(arg1, arg2) {}
176 template< typename T1, typename T2, typename T3 >
177 ImplInheritanceHelper3(
178 T1 const & arg1, T2 const & arg2, T3 const & arg3):
179 BaseClass(arg1, arg2, arg3) {}
180 template< typename T1, typename T2, typename T3, typename T4 >
181 ImplInheritanceHelper3(
182 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
183 BaseClass(arg1, arg2, arg3, arg4) {}
184 template<
185 typename T1, typename T2, typename T3, typename T4, typename T5 >
186 ImplInheritanceHelper3(
187 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
188 T5 const & arg5):
189 BaseClass(arg1, arg2, arg3, arg4, arg5) {}
190 template<
191 typename T1, typename T2, typename T3, typename T4, typename T5,
192 typename T6 >
193 ImplInheritanceHelper3(
194 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
195 T5 const & arg5, T6 const & arg6):
196 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
197 public:
198 ImplInheritanceHelper3() {}
199 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
200 {
201 css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
202 if (aRet.hasValue())
203 return aRet;
204 return BaseClass::queryInterface( rType );
205 }
206 virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
207 { BaseClass::acquire(); }
208 virtual void SAL_CALL release() throw () SAL_OVERRIDE
209 { BaseClass::release(); }
210 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException) SAL_OVERRIDE
211 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
212 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException) SAL_OVERRIDE
213 { return ImplHelper_getImplementationId( cd::get() ); }
214 };
232 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3 >
233 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper3
234 : public BaseClass
235 , public Ifc1, public Ifc2, public Ifc3
236 {
237 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, AggImplInheritanceHelper3<BaseClass, Ifc1, Ifc2, Ifc3> > > {};
238 protected:
239 template< typename T1 >
240 explicit AggImplInheritanceHelper3(T1 const & arg1): BaseClass(arg1) {}
241 template< typename T1, typename T2 >
242 AggImplInheritanceHelper3(T1 const & arg1, T2 const & arg2):
243 BaseClass(arg1, arg2) {}
244 template< typename T1, typename T2, typename T3 >
245 AggImplInheritanceHelper3(
246 T1 const & arg1, T2 const & arg2, T3 const & arg3):
247 BaseClass(arg1, arg2, arg3) {}
248 template< typename T1, typename T2, typename T3, typename T4 >
249 AggImplInheritanceHelper3(
250 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
251 BaseClass(arg1, arg2, arg3, arg4) {}
252 template<
253 typename T1, typename T2, typename T3, typename T4, typename T5 >
254 AggImplInheritanceHelper3(
255 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
256 T5 const & arg5):
257 BaseClass(arg1, arg2, arg3, arg4, arg5) {}
258 template<
259 typename T1, typename T2, typename T3, typename T4, typename T5,
260 typename T6 >
261 AggImplInheritanceHelper3(
262 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
263 T5 const & arg5, T6 const & arg6):
264 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
265 public:
266 AggImplInheritanceHelper3() {}
267 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
268 { return BaseClass::queryInterface( rType ); }
269 virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) throw (css::uno::RuntimeException) SAL_OVERRIDE
270 {
271 css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
272 if (aRet.hasValue())
273 return aRet;
274 return BaseClass::queryAggregation( rType );
275 }
276 virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
277 { BaseClass::acquire(); }
278 virtual void SAL_CALL release() throw () SAL_OVERRIDE
279 { BaseClass::release(); }
280 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
281 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
282 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
283 { return ImplHelper_getImplementationId( cd::get() ); }
284 };
285 }
286
287 #endif
288
289 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
cppu::queryInterface
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:39
cppu::AggImplInheritanceHelper3::release
virtual void release() SAL_OVERRIDE
Definition: implbase3.hxx:278
SAL_OVERRIDE
#define SAL_OVERRIDE
C++11 "override" feature.
Definition: types.h:421
cppu::AggImplInheritanceHelper3::getTypes
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:280
cppu::WeakAggImplHelper3::release
virtual void release() SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
Definition: implbase3.hxx:140
SAL_NO_VTABLE
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:333
cppu::WeakImplHelper3::release
virtual void release() SAL_OVERRIDE
decreasing m_refCount
Definition: implbase3.hxx:106
cppu::ImplHelper3
Implementation helper implementing interface css::lang::XTypeProvider and method XInterface::queryInt...
Definition: implbase3.hxx:68
cppu::ImplHelper3::queryInterface
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase3.hxx:74
cppu::WeakImplHelper3::getImplementationId
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:110
cppu::ImplInheritanceHelper3::getTypes
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:210
cppu::AggImplInheritanceHelper3::AggImplInheritanceHelper3
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase3.hxx:249
cppu::WeakImplHelper3
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase3.hxx:95
cppu::ImplInheritanceHelper3::ImplInheritanceHelper3
ImplInheritanceHelper3(T1 const &arg1)
Definition: implbase3.hxx:172
sal_Int8
signed char sal_Int8
Definition: types.h:53
cppu::ImplInheritanceHelper3::ImplInheritanceHelper3
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase3.hxx:177
cppu::WeakAggImplHelper3::getTypes
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:142
cppu::WeakAggImplHelper3::getImplementationId
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:144
cppu::ImplInheritanceHelper3::ImplInheritanceHelper3
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase3.hxx:186
cppu::OWeakAggObject::queryInterface
virtual css::uno::Any queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
If a delegator is set, then the delegator is queried for the demanded interface.
sal_False
#define sal_False
Definition: types.h:49
cppu::ImplInheritanceHelper3::getImplementationId
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:212
cppu::WeakAggImplHelper3
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase3.hxx:127
cppu::WeakImplHelper3::queryInterface
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Basic queryInterface() implementation supporting ::sun::star::uno::XWeak and ::sun::star::uno::XInter...
Definition: implbase3.hxx:102
cppu::ImplHelper3::~ImplHelper3
~ImplHelper3()
Definition: implbase3.hxx:84
cppu::AggImplInheritanceHelper3::acquire
virtual void acquire() SAL_OVERRIDE
Definition: implbase3.hxx:276
cppu::ImplInheritanceHelper3::ImplInheritanceHelper3
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2)
Definition: implbase3.hxx:174
cppu::ImplInheritanceHelper3::ImplInheritanceHelper3
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase3.hxx:193
cppu::AggImplInheritanceHelper3::queryInterface
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase3.hxx:267
cppu::ImplInheritanceHelper3::queryInterface
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase3.hxx:199
cppu::AggImplInheritanceHelper3::queryAggregation
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase3.hxx:269
cppu::AggImplInheritanceHelper3::AggImplInheritanceHelper3
AggImplInheritanceHelper3()
Definition: implbase3.hxx:266
sal_Bool
unsigned char sal_Bool
Definition: types.h:48
cppu::OWeakObject::acquire
virtual void acquire() SAL_OVERRIDE
increasing m_refCount
cppu::ImplInheritanceHelper3::acquire
virtual void acquire() SAL_OVERRIDE
Definition: implbase3.hxx:206
cppu::ImplInheritanceHelper3::ImplInheritanceHelper3
ImplInheritanceHelper3()
Definition: implbase3.hxx:198
cppu::ImplInheritanceHelper3::ImplInheritanceHelper3
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase3.hxx:181
cppu::WeakImplHelper3::getTypes
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:108
cppu::AggImplInheritanceHelper3::AggImplInheritanceHelper3
AggImplInheritanceHelper3(T1 const &arg1)
Definition: implbase3.hxx:240
cppu::ImplInheritanceHelper3
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase3.hxx:165
cppu
Definition: Enterable.hxx:26
cppu::OWeakObject
Base class to implement an UNO object supporting weak references, i.e.
Definition: weak.hxx:43
cppu::AggImplInheritanceHelper3::AggImplInheritanceHelper3
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase3.hxx:261
implbase_ex.hxx
com::sun::star
Definition: types.h:389
cppu::AggImplInheritanceHelper3
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase3.hxx:233
cppu::ImplInheritanceHelper3::release
virtual void release() SAL_OVERRIDE
Definition: implbase3.hxx:208
cppu::WeakAggImplHelper3::queryAggregation
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Called by the delegator or queryInterface.
Definition: implbase3.hxx:136
cppu::OWeakAggObject::acquire
virtual void acquire() SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
cppu::AggImplInheritanceHelper3::getImplementationId
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:282
rtl::StaticAggregate
Helper class for a late-initialized static aggregate, e.g.
Definition: instance.hxx:546
instance.hxx
cppu::OWeakAggObject::release
virtual void release() SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
cppu::WeakAggImplHelper3::queryInterface
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
If a delegator is set, then the delegator is queried for the demanded interface.
Definition: implbase3.hxx:134
cppu::WeakAggImplHelper3::acquire
virtual void acquire() SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
Definition: implbase3.hxx:138
cppu::AggImplInheritanceHelper3::AggImplInheritanceHelper3
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase3.hxx:254
cppu::AggImplInheritanceHelper3::AggImplInheritanceHelper3
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase3.hxx:245
cppu::ImplHelper3::getImplementationId
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:78
cppu::ImplHelper3::getTypes
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:76
cppu::AggImplInheritanceHelper3::AggImplInheritanceHelper3
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2)
Definition: implbase3.hxx:242
cppu::OWeakObject::release
virtual void release() SAL_OVERRIDE
decreasing m_refCount
cppu::OWeakAggObject
Base class to implement an UNO object supporting weak references, i.e.
Definition: weakagg.hxx:41
cppu::WeakImplHelper3::acquire
virtual void acquire() SAL_OVERRIDE
increasing m_refCount
Definition: implbase3.hxx:104