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