My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
implbase_ex_post.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org. If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 #ifndef _CPPUHELPER_IMPLBASE_EX_POST_HXX_
29 #define _CPPUHELPER_IMPLBASE_EX_POST_HXX_
30 
32 
33 #define __DEF_CLASS_DATA_INIT_EX( N, class_cast ) \
34 { \
35 N +1, sal_False, sal_False, \
36 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \
37 { \
38 __IFC_EX_TYPE_INIT##N( class_cast ), \
39 __IFC_EX_TYPE_INIT_NAME( class_cast, ::com::sun::star::lang::XTypeProvider ) \
40 } \
41 }
42 
43 #define __DEF_IMPLHELPER_EX( N ) \
44 namespace cppu \
45 { \
46 struct class_data##N \
47 { \
48  sal_Int16 m_nTypes; \
49  sal_Bool m_storedTypeRefs; \
50  sal_Bool m_storedId; \
51  sal_Int8 m_id[ 16 ]; \
52  type_entry m_typeEntries[ N + 1 ]; \
53 }; \
54 template< __CLASS_IFC##N > \
55 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper##N \
56  : public ::com::sun::star::lang::XTypeProvider \
57  , __PUBLIC_IFC##N \
58 { \
59  static class_data##N s_cd; \
60 public: \
61  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
62  { return ImplHelper_query( rType, (class_data *)&s_cd, this ); } \
63  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
64  { return ImplHelper_getTypes( (class_data *)&s_cd ); } \
65  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
66  { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
67 }; \
68 template< __CLASS_IFC##N > \
69 class_data##N ImplHelper##N< __IFC##N >::s_cd = \
70 __DEF_CLASS_DATA_INIT_EX( N, (ImplHelper##N< __IFC##N > *) ); \
71 template< __CLASS_IFC##N > \
72 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper##N \
73  : public OWeakObject \
74  , public ::com::sun::star::lang::XTypeProvider \
75  , __PUBLIC_IFC##N \
76 { \
77  static class_data##N s_cd; \
78 public: \
79  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
80  { return WeakImplHelper_query( rType, (class_data *)&s_cd, this, (OWeakObject *)this ); } \
81  virtual void SAL_CALL acquire() throw () \
82  { OWeakObject::acquire(); } \
83  virtual void SAL_CALL release() throw () \
84  { OWeakObject::release(); } \
85  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
86  { return WeakImplHelper_getTypes( (class_data *)&s_cd ); } \
87  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
88  { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
89 }; \
90 template< __CLASS_IFC##N > \
91 class_data##N WeakImplHelper##N< __IFC##N >::s_cd = \
92 __DEF_CLASS_DATA_INIT_EX( N, (WeakImplHelper##N< __IFC##N > *) ); \
93 template< __CLASS_IFC##N > \
94 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper##N \
95  : public OWeakAggObject \
96  , public ::com::sun::star::lang::XTypeProvider \
97  , __PUBLIC_IFC##N \
98 { \
99  static class_data##N s_cd; \
100 public: \
101  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
102  { return OWeakAggObject::queryInterface( rType ); } \
103  virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
104  { return WeakAggImplHelper_queryAgg( rType, (class_data *)&s_cd, this, (OWeakAggObject *)this ); } \
105  virtual void SAL_CALL acquire() throw () \
106  { OWeakAggObject::acquire(); } \
107  virtual void SAL_CALL release() throw () \
108  { OWeakAggObject::release(); } \
109  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
110  { return WeakAggImplHelper_getTypes( (class_data *)&s_cd ); } \
111  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
112  { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
113 }; \
114 template< __CLASS_IFC##N > \
115 class_data##N WeakAggImplHelper##N< __IFC##N >::s_cd = \
116 __DEF_CLASS_DATA_INIT_EX( N, (WeakAggImplHelper##N< __IFC##N > *) ); \
117 template< class BaseClass, __CLASS_IFC##N > \
118 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper##N \
119  : public BaseClass \
120  , __PUBLIC_IFC##N \
121 { \
122  static class_data##N s_cd; \
123 public: \
124  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
125  { \
126  ::com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, (class_data *)&s_cd, this ) ); \
127  if (aRet.hasValue()) \
128  return aRet; \
129  return BaseClass::queryInterface( rType ); \
130  } \
131  virtual void SAL_CALL acquire() throw () \
132  { BaseClass::acquire(); } \
133  virtual void SAL_CALL release() throw () \
134  { BaseClass::release(); } \
135  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
136  { return ImplInhHelper_getTypes( (class_data *)&s_cd, BaseClass::getTypes() ); } \
137  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
138  { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
139 }; \
140 template< class BaseClass, __CLASS_IFC##N > \
141 class_data##N ImplInheritanceHelper##N< BaseClass, __IFC##N >::s_cd = \
142 __DEF_CLASS_DATA_INIT_EX( N, (ImplInheritanceHelper##N< BaseClass, __IFC##N > *) ); \
143 template< class BaseClass, __CLASS_IFC##N > \
144 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper##N \
145  : public BaseClass \
146  , __PUBLIC_IFC##N \
147 { \
148  static class_data##N s_cd; \
149 public: \
150  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
151  { return BaseClass::queryInterface( rType ); } \
152  virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
153  { \
154  ::com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, (class_data *)&s_cd, this ) ); \
155  if (aRet.hasValue()) \
156  return aRet; \
157  return BaseClass::queryAggregation( rType ); \
158  } \
159  virtual void SAL_CALL acquire() throw () \
160  { BaseClass::acquire(); } \
161  virtual void SAL_CALL release() throw () \
162  { BaseClass::release(); } \
163  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
164  { return ImplInhHelper_getTypes( (class_data *)&s_cd, BaseClass::getTypes() ); } \
165  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
166  { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
167 }; \
168 template< class BaseClass, __CLASS_IFC##N > \
169 class_data##N AggImplInheritanceHelper##N< BaseClass, __IFC##N >::s_cd = \
170 __DEF_CLASS_DATA_INIT_EX( N, (AggImplInheritanceHelper##N< BaseClass, __IFC##N > *) ); \
171 }
172 
173 #define __DEF_COMPIMPLHELPER_EX( N ) \
174 namespace cppu \
175 { \
176 template< __CLASS_IFC##N > \
177 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper##N \
178  : public WeakComponentImplHelperBase \
179  , public ::com::sun::star::lang::XTypeProvider \
180  , __PUBLIC_IFC##N \
181 { \
182  static class_data##N s_cd; \
183 public: \
184  inline WeakComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
185  : WeakComponentImplHelperBase( rMutex ) \
186  {} \
187  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
188  { return WeakComponentImplHelper_query( rType, (class_data *)&s_cd, this, (WeakComponentImplHelperBase *)this ); } \
189  virtual void SAL_CALL acquire() throw () \
190  { WeakComponentImplHelperBase::acquire(); } \
191  virtual void SAL_CALL release() throw () \
192  { WeakComponentImplHelperBase::release(); } \
193  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
194  { return WeakComponentImplHelper_getTypes( (class_data *)&s_cd ); } \
195  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
196  { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
197 }; \
198 template< __CLASS_IFC##N > \
199 class_data##N WeakComponentImplHelper##N< __IFC##N >::s_cd = \
200 __DEF_CLASS_DATA_INIT_EX( N, (WeakComponentImplHelper##N< __IFC##N > *) ); \
201 template< __CLASS_IFC##N > \
202 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper##N \
203  : public WeakAggComponentImplHelperBase \
204  , public ::com::sun::star::lang::XTypeProvider \
205  , __PUBLIC_IFC##N \
206 { \
207  static class_data##N s_cd; \
208 public: \
209  inline WeakAggComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
210  : WeakAggComponentImplHelperBase( rMutex ) \
211  {} \
212  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
213  { return WeakAggComponentImplHelperBase::queryInterface( rType ); } \
214  virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
215  { return WeakAggComponentImplHelper_queryAgg( rType, (class_data *)&s_cd, this, (WeakAggComponentImplHelperBase *)this ); } \
216  virtual void SAL_CALL acquire() throw () \
217  { WeakAggComponentImplHelperBase::acquire(); } \
218  virtual void SAL_CALL release() throw () \
219  { WeakAggComponentImplHelperBase::release(); } \
220  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
221  { return WeakAggComponentImplHelper_getTypes( (class_data *)&s_cd ); } \
222  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
223  { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
224 }; \
225 template< __CLASS_IFC##N > \
226 class_data##N WeakAggComponentImplHelper##N< __IFC##N >::s_cd = \
227 __DEF_CLASS_DATA_INIT_EX( N, (WeakAggComponentImplHelper##N< __IFC##N > *) ); \
228 }
229 
231 
232 #endif
233 
234 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */