AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
implbase1.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_IMPLBASE1_HXX
4 #define INCLUDED_CPPUHELPER_IMPLBASE1_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_data1
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[ 1 + 1 ];
23  };
24 
25  template< typename Ifc1, typename Impl > struct SAL_WARN_UNUSED ImplClassData1
26  {
27  class_data* operator ()()
28  {
29  static class_data1 s_cd =
30  {
31  1 +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(css::lang::XTypeProvider)
36  }
37  };
38  return reinterpret_cast< class_data * >(&s_cd);
39  }
40  };
41 
43 
52  template< class Ifc1 >
53  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper1
54  : public css::lang::XTypeProvider
55  , public Ifc1
56  {
57  struct cd : public rtl::StaticAggregate< class_data, ImplClassData1 < Ifc1, ImplHelper1<Ifc1> > > {};
58  public:
59 #if defined LIBO_INTERNAL_ONLY
60  ImplHelper1() = default;
61  ImplHelper1(ImplHelper1 const &) = default;
62  ImplHelper1(ImplHelper1 &&) = default;
63  ImplHelper1 & operator =(ImplHelper1 const &) = default;
64  ImplHelper1 & operator =(ImplHelper1 &&) = default;
65 #endif
66 
67  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
68  { return ImplHelper_query( rType, cd::get(), this ); }
69  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
70  { return ImplHelper_getTypes( cd::get() ); }
71  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
72  { return ImplHelper_getImplementationId( cd::get() ); }
73 
74 #if !defined _MSC_VER // public -> protected changes mangled names there
75  protected:
76 #endif
78  };
91  template< class Ifc1 >
92  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE SAL_DLLPUBLIC_EXPORT WeakImplHelper1
93  : public OWeakObject
94  , public css::lang::XTypeProvider
95  , public Ifc1
96  {
97  struct cd : public rtl::StaticAggregate< class_data, ImplClassData1< Ifc1, WeakImplHelper1< Ifc1 > > > {};
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 >
124  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper1
125  : public OWeakAggObject
126  , public css::lang::XTypeProvider
127  , public Ifc1
128  {
129  struct cd : public rtl::StaticAggregate< class_data, ImplClassData1< Ifc1, WeakAggImplHelper1< Ifc1 > > > {};
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 >
161  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper1
162  : public BaseClass
163  , public Ifc1
164  {
165  struct cd : public rtl::StaticAggregate< class_data, ImplClassData1< Ifc1, ImplInheritanceHelper1< BaseClass, Ifc1 > > > {};
166  protected:
167  template< typename T1 >
168  explicit ImplInheritanceHelper1(T1 const & arg1): BaseClass(arg1) {}
169  template< typename T1, typename T2 >
170  ImplInheritanceHelper1(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 >
229  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper1
230  : public BaseClass
231  , public Ifc1
232  {
233  struct cd : public rtl::StaticAggregate< class_data, ImplClassData1< Ifc1, AggImplInheritanceHelper1< BaseClass, Ifc1 > > > {};
234  protected:
235  template< typename T1 >
236  explicit AggImplInheritanceHelper1(T1 const & arg1): BaseClass(arg1) {}
237  template< typename T1, typename T2 >
238  AggImplInheritanceHelper1(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: */
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
Definition: implbase1.hxx:274
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase1.hxx:141
ImplInheritanceHelper1(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase1.hxx:189
ImplInheritanceHelper1(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase1.hxx:182
AggImplInheritanceHelper1(T1 const &arg1, T2 const &arg2)
Definition: implbase1.hxx:238
unsigned char sal_Bool
Definition: types.h:18
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase1.hxx:107
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase1.hxx:92
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase1.hxx:208
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase1.hxx:265
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase1.hxx:263
AggImplInheritanceHelper1(T1 const &arg1)
Definition: implbase1.hxx:236
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
Definition: implbase1.hxx:202
AggImplInheritanceHelper1(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase1.hxx:257
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Called by the delegator or queryInterface.
Definition: implbase1.hxx:133
Base class to implement a UNO object supporting weak references, i.e.
Definition: weakagg.hxx:25
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
increasing m_refCount
Definition: implbase1.hxx:101
AggImplInheritanceHelper1()
Definition: implbase1.hxx:262
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase1.hxx:195
AggImplInheritanceHelper1(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase1.hxx:245
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase1.hxx:69
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: implbase1.hxx:67
ImplInheritanceHelper1(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase1.hxx:173
AggImplInheritanceHelper1(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase1.hxx:241
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase1.hxx:105
#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
~ImplHelper1() SAL_NOEXCEPT
Definition: implbase1.hxx:77
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
increasing m_refCount
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
Definition: implbase1.hxx:272
Helper class for a late-initialized static aggregate, e.g.
Definition: instance.hxx:528
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: implbase1.hxx:71
AggImplInheritanceHelper1(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase1.hxx:250
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface which...
Definition: implbase1.hxx:124
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: implbase1.hxx:278
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase1.hxx:206
#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
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
ImplInheritanceHelper1(T1 const &arg1)
Definition: implbase1.hxx:168
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 release() SAL_NOEXCEPT SAL_OVERRIDE
If a delegator is set, then the delegators gets released.
Definition: implbase1.hxx:137
ImplInheritanceHelper1()
Definition: implbase1.hxx:194
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.
Definition: implbase1.hxx:135
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase1.hxx:139
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: implbase1.hxx:131
signed char sal_Int8
Definition: types.h:23
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: implbase1.hxx:276
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
decreasing m_refCount
Definition: implbase1.hxx:103
Implementation helper implementing interface css::lang::XTypeProvider and method XInterface::queryInt...
Definition: implbase1.hxx:53
#define SAL_OVERRIDE
C++11 &quot;override&quot; feature.
Definition: types.h:371
ImplInheritanceHelper1(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase1.hxx:177
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
Definition: implbase1.hxx:204
Base class to implement a UNO object supporting weak references, i.e.
Definition: weak.hxx:27
ImplInheritanceHelper1(T1 const &arg1, T2 const &arg2)
Definition: implbase1.hxx:170
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: implbase1.hxx:99
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase1.hxx:229
Implementation helper implementing interfaces css::lang::XTypeProvider and css::uno::XInterface inher...
Definition: implbase1.hxx:161