AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #ifndef INCLUDED_CPPUHELPER_IMPLBASE3_HXX
4 #define INCLUDED_CPPUHELPER_IMPLBASE3_HXX
5 
7 #include "rtl/instance.hxx"
8 #include "cppuhelper/weak.hxx"
9 #include "cppuhelper/weakagg.hxx"
10 #include "com/sun/star/lang/XTypeProvider.hpp"
11 
12 namespace cppu
13 {
15 
16  struct class_data3
17  {
18  sal_Int16 m_nTypes;
19  sal_Bool m_storedTypeRefs;
20  sal_Bool m_storedId;
21  sal_Int8 m_id[ 16 ];
22  type_entry m_typeEntries[ 3 + 1 ];
23  };
24 
25  template< typename Ifc1, typename Ifc2, typename Ifc3, typename Impl > struct SAL_WARN_UNUSED ImplClassData3
26  {
27  class_data* operator ()()
28  {
29  static class_data3 s_cd =
30  {
31  3 +1, false, false,
32  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
33  {
34  CPPUHELPER_DETAIL_TYPEENTRY(Ifc1),
35  CPPUHELPER_DETAIL_TYPEENTRY(Ifc2),
36  CPPUHELPER_DETAIL_TYPEENTRY(Ifc3),
37  CPPUHELPER_DETAIL_TYPEENTRY(css::lang::XTypeProvider)
38  }
39  };
40  return reinterpret_cast< class_data * >(&s_cd);
41  }
42  };
43 
45 
54  template< class Ifc1, class Ifc2, class Ifc3 >
55  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper3
56  : public css::lang::XTypeProvider
57  , public Ifc1, public Ifc2, public Ifc3
58  {
59  struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, ImplHelper3<Ifc1, Ifc2, Ifc3> > > {};
60  public:
61 #if defined LIBO_INTERNAL_ONLY
62  ImplHelper3() = default;
63  ImplHelper3(ImplHelper3 const &) = default;
64  ImplHelper3(ImplHelper3 &&) = default;
65  ImplHelper3 & operator =(ImplHelper3 const &) = default;
66  ImplHelper3 & operator =(ImplHelper3 &&) = default;
67 #endif
68 
69  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
70  { return ImplHelper_query( rType, cd::get(), this ); }
71  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
72  { return ImplHelper_getTypes( cd::get() ); }
73  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
74  { return ImplHelper_getImplementationId( cd::get() ); }
75 
76 #if !defined _MSC_VER // public -> protected changes mangled names there
77  protected:
78 #endif
80  };
89  template< class Ifc1, class Ifc2, class Ifc3 >
90  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper3
91  : public OWeakObject
92  , public css::lang::XTypeProvider
93  , public Ifc1, public Ifc2, public Ifc3
94  {
95  struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, WeakImplHelper3<Ifc1, Ifc2, Ifc3> > > {};
96  public:
97  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
98  { return WeakImplHelper_query( rType, cd::get(), this, static_cast<OWeakObject *>(this) ); }
99  virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
100  { OWeakObject::acquire(); }
101  virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
102  { OWeakObject::release(); }
103  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
104  { return WeakImplHelper_getTypes( cd::get() ); }
105  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
106  { return ImplHelper_getImplementationId( cd::get() ); }
107  };
121  template< class Ifc1, class Ifc2, class Ifc3 >
122  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper3
123  : public OWeakAggObject
124  , public css::lang::XTypeProvider
125  , public Ifc1, public Ifc2, public Ifc3
126  {
127  struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, WeakAggImplHelper3<Ifc1, Ifc2, Ifc3> > > {};
128  public:
129  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
130  { return OWeakAggObject::queryInterface( rType ); }
131  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) SAL_OVERRIDE
132  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, static_cast<OWeakAggObject *>(this) ); }
133  virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
135  virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
137  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
138  { return WeakAggImplHelper_getTypes( cd::get() ); }
139  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
140  { return ImplHelper_getImplementationId( cd::get() ); }
141  };
159  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3 >
160  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper3
161  : public BaseClass
162  , public Ifc1, public Ifc2, public Ifc3
163  {
164  struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, ImplInheritanceHelper3<BaseClass, Ifc1, Ifc2, Ifc3> > > {};
165  protected:
166  template< typename T1 >
167  explicit ImplInheritanceHelper3(T1 const & arg1): BaseClass(arg1) {}
168  template< typename T1, typename T2 >
169  ImplInheritanceHelper3(T1 const & arg1, T2 const & arg2):
170  BaseClass(arg1, arg2) {}
171  template< typename T1, typename T2, typename T3 >
173  T1 const & arg1, T2 const & arg2, T3 const & arg3):
174  BaseClass(arg1, arg2, arg3) {}
175  template< typename T1, typename T2, typename T3, typename T4 >
177  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
178  BaseClass(arg1, arg2, arg3, arg4) {}
179  template<
180  typename T1, typename T2, typename T3, typename T4, typename T5 >
182  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
183  T5 const & arg5):
184  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
185  template<
186  typename T1, typename T2, typename T3, typename T4, typename T5,
187  typename T6 >
189  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
190  T5 const & arg5, T6 const & arg6):
191  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
192  public:
194  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
195  {
196  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
197  if (aRet.hasValue())
198  return aRet;
199  return BaseClass::queryInterface( rType );
200  }
201  virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
202  { BaseClass::acquire(); }
203  virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
204  { BaseClass::release(); }
205  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
206  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
207  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
208  { return ImplHelper_getImplementationId( cd::get() ); }
209  };
227  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3 >
228  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper3
229  : public BaseClass
230  , public Ifc1, public Ifc2, public Ifc3
231  {
232  struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, AggImplInheritanceHelper3<BaseClass, Ifc1, Ifc2, Ifc3> > > {};
233  protected:
234  template< typename T1 >
235  explicit AggImplInheritanceHelper3(T1 const & arg1): BaseClass(arg1) {}
236  template< typename T1, typename T2 >
237  AggImplInheritanceHelper3(T1 const & arg1, T2 const & arg2):
238  BaseClass(arg1, arg2) {}
239  template< typename T1, typename T2, typename T3 >
241  T1 const & arg1, T2 const & arg2, T3 const & arg3):
242  BaseClass(arg1, arg2, arg3) {}
243  template< typename T1, typename T2, typename T3, typename T4 >
245  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
246  BaseClass(arg1, arg2, arg3, arg4) {}
247  template<
248  typename T1, typename T2, typename T3, typename T4, typename T5 >
250  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
251  T5 const & arg5):
252  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
253  template<
254  typename T1, typename T2, typename T3, typename T4, typename T5,
255  typename T6 >
257  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
258  T5 const & arg5, T6 const & arg6):
259  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
260  public:
262  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
263  { return BaseClass::queryInterface( rType ); }
264  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) SAL_OVERRIDE
265  {
266  css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
267  if (aRet.hasValue())
268  return aRet;
269  return BaseClass::queryAggregation( rType );
270  }
271  virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
272  { BaseClass::acquire(); }
273  virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
274  { BaseClass::release(); }
275  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
276  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
277  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
278  { return ImplHelper_getImplementationId( cd::get() ); }
279  };
280 }
281 
282 #endif
283 
284 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase3.hxx:249
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2)
Definition: implbase3.hxx:237
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
Definition: implbase3.hxx:203
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2)
Definition: implbase3.hxx:169
unsigned char sal_Bool
Definition: types.h:18
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase3.hxx:228
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
increasing m_refCount
Definition: implbase3.hxx:99
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
Definition: implbase3.hxx:135
AggImplInheritanceHelper3(T1 const &arg1)
Definition: implbase3.hxx:235
ImplInheritanceHelper3(T1 const &arg1)
Definition: implbase3.hxx:167
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase3.hxx:122
Base class to implement a UNO object supporting weak references, i.e.
Definition: weakagg.hxx:25
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:129
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase3.hxx:176
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase3.hxx:188
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase3.hxx:194
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase3.hxx:256
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
Definition: implbase3.hxx:201
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
decreasing m_refCount
Definition: implbase3.hxx:101
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase3.hxx:181
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase3.hxx:240
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:567
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
decreasing m_refCount
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Called by the delegator or queryInterface.
Definition: implbase3.hxx:131
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
increasing m_refCount
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:275
Implementation helper implementing interface css::lang::XTypeProvider and method XInterface::queryInt...
Definition: implbase3.hxx:55
Helper class for a late-initialized static aggregate, e.g.
Definition: instance.hxx:528
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
Definition: implbase3.hxx:271
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase3.hxx:262
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:205
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:23
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:139
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:207
#define SAL_NOEXCEPT
Macro for C++11 &quot;noexcept&quot; vs.
Definition: types.h:396
AggImplInheritanceHelper3()
Definition: implbase3.hxx:261
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:277
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:274
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
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.
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
Definition: implbase3.hxx:133
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase3.hxx:264
~ImplHelper3() SAL_NOEXCEPT
Definition: implbase3.hxx:79
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase3.hxx:160
ImplInheritanceHelper3()
Definition: implbase3.hxx:193
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
Definition: implbase3.hxx:273
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:103
signed char sal_Int8
Definition: types.h:23
#define SAL_OVERRIDE
C++11 &quot;override&quot; feature.
Definition: types.h:371
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase3.hxx:69
AggImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase3.hxx:244
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:71
Base class to implement a UNO object supporting weak references, i.e.
Definition: weak.hxx:27
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase3.hxx:137
ImplInheritanceHelper3(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase3.hxx:172
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Basic queryInterface() implementation supporting com::sun::star::uno::XWeak and com::sun::star::uno::...
Definition: implbase3.hxx:97
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase3.hxx:90
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:105
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase3.hxx:73