AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
compbase2.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_COMPBASE2_HXX
4 #define INCLUDED_CPPUHELPER_COMPBASE2_HXX
5 
8 
9 namespace cppu
10 {
11 
26  template< class Ifc1, class Ifc2 >
27  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper2
28  : public WeakComponentImplHelperBase
29  , public css::lang::XTypeProvider
30  , public Ifc1, public Ifc2
31  {
32  struct cd : public rtl::StaticAggregate< class_data, ImplClassData2 < Ifc1, Ifc2, WeakComponentImplHelper2<Ifc1, Ifc2> > > {};
33  public:
35  : WeakComponentImplHelperBase( rMutex )
36  {}
37  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
38  { return WeakComponentImplHelper_query( rType, cd::get(), this, static_cast<WeakComponentImplHelperBase *>(this) ); }
39  virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
40  { WeakComponentImplHelperBase::acquire(); }
41  virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
42  { WeakComponentImplHelperBase::release(); }
43  virtual void SAL_CALL dispose() SAL_OVERRIDE
44  { WeakComponentImplHelperBase::dispose(); }
45  virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & xListener) SAL_OVERRIDE
46  { WeakComponentImplHelperBase::addEventListener(xListener); }
47  virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & xListener) SAL_OVERRIDE
48  { WeakComponentImplHelperBase::removeEventListener(xListener); }
49  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
50  { return WeakComponentImplHelper_getTypes( cd::get() ); }
51  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
52  { return ImplHelper_getImplementationId( cd::get() ); }
53  };
54 
64  template< class Ifc1, class Ifc2 >
65  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE PartialWeakComponentImplHelper2
66  : public WeakComponentImplHelperBase
67  , public css::lang::XTypeProvider
68  , public Ifc1, public Ifc2
69  {
70  struct cd : public rtl::StaticAggregate< class_data, ImplClassData2 < Ifc1, Ifc2, PartialWeakComponentImplHelper2<Ifc1, Ifc2> > > {};
71  public:
73  : WeakComponentImplHelperBase( rMutex )
74  {}
75  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
76  { return WeakComponentImplHelper_query( rType, cd::get(), this, static_cast<WeakComponentImplHelperBase *>(this) ); }
77  virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
78  { WeakComponentImplHelperBase::acquire(); }
79  virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
80  { WeakComponentImplHelperBase::release(); }
81  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
82  { return WeakComponentImplHelper_getTypes( cd::get() ); }
83  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
84  { return ImplHelper_getImplementationId( cd::get() ); }
85  };
86 
87 
105  template< class Ifc1, class Ifc2 >
106  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper2
107  : public WeakAggComponentImplHelperBase
108  , public css::lang::XTypeProvider
109  , public Ifc1, public Ifc2
110  {
111  struct cd : public rtl::StaticAggregate< class_data, ImplClassData2 < Ifc1, Ifc2, WeakAggComponentImplHelper2<Ifc1, Ifc2> > > {};
112  public:
114  : WeakAggComponentImplHelperBase( rMutex )
115  {}
116  virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE
118  virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) SAL_OVERRIDE
119  { return WeakAggComponentImplHelper_queryAgg( rType, cd::get(), this, static_cast<WeakAggComponentImplHelperBase *>(this) ); }
120  virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
121  { WeakAggComponentImplHelperBase::acquire(); }
122  virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
123  { WeakAggComponentImplHelperBase::release(); }
124  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
125  { return WeakAggComponentImplHelper_getTypes( cd::get() ); }
126  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
127  { return ImplHelper_getImplementationId( cd::get() ); }
128  };
129 }
130 
131 #endif
132 
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
Definition: compbase2.hxx:120
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: compbase2.hxx:75
Same as WeakComponentImplHelper2, except doesn&#39;t implement addEventListener, removeEventListener and ...
Definition: compbase2.hxx:65
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: compbase2.hxx:83
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
Definition: compbase2.hxx:122
virtual void dispose() SAL_OVERRIDE
Definition: compbase2.hxx:43
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
Definition: compbase2.hxx:41
virtual void addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) SAL_OVERRIDE
Definition: compbase2.hxx:45
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: compbase2.hxx:81
virtual css::uno::Any queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
Definition: compbase2.hxx:118
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: compbase2.hxx:51
Implementation helper supporting css::lang::XTypeProvider and css::lang::XComponent.
Definition: compbase2.hxx:106
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
Definition: compbase2.hxx:39
virtual void acquire() SAL_NOEXCEPT SAL_OVERRIDE
Definition: compbase2.hxx:77
PartialWeakComponentImplHelper2(::osl::Mutex &rMutex) SAL_NOEXCEPT
Definition: compbase2.hxx:72
Helper class for a late-initialized static aggregate, e.g.
Definition: instance.hxx:528
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: compbase2.hxx:49
virtual void release() SAL_NOEXCEPT SAL_OVERRIDE
Definition: compbase2.hxx:79
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:23
WeakAggComponentImplHelper2(::osl::Mutex &rMutex) SAL_NOEXCEPT
Definition: compbase2.hxx:113
Implementation helper supporting css::lang::XTypeProvider and css::lang::XComponent.
Definition: compbase2.hxx:27
#define SAL_NOEXCEPT
Macro for C++11 &quot;noexcept&quot; vs.
Definition: types.h:396
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: compbase2.hxx:37
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:274
A mutual exclusion synchronization object.
Definition: mutex.hxx:15
#define SAL_OVERRIDE
C++11 &quot;override&quot; feature.
Definition: types.h:371
WeakComponentImplHelper2(::osl::Mutex &rMutex) SAL_NOEXCEPT
Definition: compbase2.hxx:34
virtual css::uno::Sequence< css::uno::Type > getTypes() SAL_OVERRIDE
Definition: compbase2.hxx:124
virtual css::uno::Any queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
Definition: compbase2.hxx:116
virtual void removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) SAL_OVERRIDE
Definition: compbase2.hxx:47
virtual css::uno::Sequence< sal_Int8 > getImplementationId() SAL_OVERRIDE
Definition: compbase2.hxx:126