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