AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
compbase_ex.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_COMPBASE_EX_HXX
4 #define INCLUDED_CPPUHELPER_COMPBASE_EX_HXX
5 
7 #include "com/sun/star/lang/XComponent.hpp"
9 #include "cppuhelper/weak.hxx"
10 #include "cppuhelper/weakagg.hxx"
11 
13 
14 namespace osl { class Mutex; }
15 namespace cppu { struct class_data; }
16 
17 namespace cppu
18 {
19 
23 class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakComponentImplHelperBase
24  : public ::cppu::OWeakObject
25  , public css::lang::XComponent
26 {
27 protected:
30  ::cppu::OBroadcastHelper rBHelper;
31 
34  virtual void SAL_CALL disposing();
35 
40  WeakComponentImplHelperBase( ::osl::Mutex & rMutex );
41 public:
44  virtual ~WeakComponentImplHelperBase() SAL_OVERRIDE;
45 
46  // these are here to force memory de/allocation to sal lib.
47  static void * SAL_CALL operator new( size_t nSize )
48  { return ::rtl_allocateMemory( nSize ); }
49  static void SAL_CALL operator delete( void * pMem )
50  { ::rtl_freeMemory( pMem ); }
51  static void * SAL_CALL operator new( size_t, void * pMem )
52  { return pMem; }
53  static void SAL_CALL operator delete( void *, void * )
54  {}
55 
56  virtual css::uno::Any SAL_CALL queryInterface(
57  css::uno::Type const & rType ) SAL_OVERRIDE;
58  virtual void SAL_CALL acquire()
60  virtual void SAL_CALL release()
61  SAL_NOEXCEPT SAL_OVERRIDE;
62  virtual void SAL_CALL dispose() SAL_OVERRIDE;
63  virtual void SAL_CALL addEventListener(
64  css::uno::Reference< css::lang::XEventListener > const & xListener ) SAL_OVERRIDE;
65  virtual void SAL_CALL removeEventListener(
66  css::uno::Reference< css::lang::XEventListener > const & xListener ) SAL_OVERRIDE;
67 };
68 
72 class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakAggComponentImplHelperBase
73  : public ::cppu::OWeakAggObject
74  , public css::lang::XComponent
75 {
76 protected:
77  ::cppu::OBroadcastHelper rBHelper;
78 
81  virtual void SAL_CALL disposing();
82 
83  WeakAggComponentImplHelperBase( ::osl::Mutex & rMutex );
84 public:
85  virtual ~WeakAggComponentImplHelperBase() SAL_OVERRIDE;
86 
87  // these are here to force memory de/allocation to sal lib.
88  static void * SAL_CALL operator new( size_t nSize )
89  { return ::rtl_allocateMemory( nSize ); }
90  static void SAL_CALL operator delete( void * pMem )
91  { ::rtl_freeMemory( pMem ); }
92  static void * SAL_CALL operator new( size_t, void * pMem )
93  { return pMem; }
94  static void SAL_CALL operator delete( void *, void * )
95  {}
96 
97  virtual css::uno::Any SAL_CALL queryInterface(
98  css::uno::Type const & rType ) SAL_OVERRIDE;
99  virtual css::uno::Any SAL_CALL queryAggregation(
100  css::uno::Type const & rType ) SAL_OVERRIDE;
101  virtual void SAL_CALL acquire()
102  SAL_NOEXCEPT SAL_OVERRIDE;
103  virtual void SAL_CALL release()
104  SAL_NOEXCEPT SAL_OVERRIDE;
105  virtual void SAL_CALL dispose() SAL_OVERRIDE;
106  virtual void SAL_CALL addEventListener(
107  css::uno::Reference< css::lang::XEventListener > const & xListener ) SAL_OVERRIDE;
108  virtual void SAL_CALL removeEventListener(
109  css::uno::Reference< css::lang::XEventListener > const & xListener ) SAL_OVERRIDE;
110 };
111 
114 CPPUHELPER_DLLPUBLIC css::uno::Any SAL_CALL WeakComponentImplHelper_query(
115  css::uno::Type const & rType,
116  class_data * cd,
117  void * that,
118  ::cppu::WeakComponentImplHelperBase * pBase );
121 CPPUHELPER_DLLPUBLIC css::uno::Sequence< css::uno::Type > SAL_CALL WeakComponentImplHelper_getTypes(
122  class_data * cd );
123 
126 CPPUHELPER_DLLPUBLIC css::uno::Any SAL_CALL WeakAggComponentImplHelper_queryAgg(
127  css::uno::Type const & rType,
128  class_data * cd,
129  void * that,
130  ::cppu::WeakAggComponentImplHelperBase * pBase );
133 CPPUHELPER_DLLPUBLIC css::uno::Sequence< css::uno::Type > SAL_CALL WeakAggComponentImplHelper_getTypes(
134  class_data * cd );
135 
136 }
137 
139 
140 #endif
141 
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
#define CPPUHELPER_DLLPUBLIC
Definition: cppuhelperdllapi.h:12
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:23
#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
A mutual exclusion synchronization object.
Definition: mutex.hxx:15
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
#define SAL_OVERRIDE
C++11 &quot;override&quot; feature.
Definition: types.h:371
This struct contains the standard variables of a broadcaster.
Definition: interfacecontainer.h:419
Base class to implement a UNO object supporting weak references, i.e.
Definition: weak.hxx:27