UDK 3.2.7 C/C++ API Reference
cppuhelper/implbase_ex_post.hxx
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /*************************************************************************
00003  *
00004  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
00005  *
00006  * Copyright 2000, 2010 Oracle and/or its affiliates.
00007  *
00008  * OpenOffice.org - a multi-platform office productivity suite
00009  *
00010  * This file is part of OpenOffice.org.
00011  *
00012  * OpenOffice.org is free software: you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 3
00014  * only, as published by the Free Software Foundation.
00015  *
00016  * OpenOffice.org is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License version 3 for more details
00020  * (a copy is included in the LICENSE file that accompanied this code).
00021  *
00022  * You should have received a copy of the GNU Lesser General Public License
00023  * version 3 along with OpenOffice.org.  If not, see
00024  * <http://www.openoffice.org/license.html>
00025  * for a copy of the LGPLv3 License.
00026  *
00027  ************************************************************************/
00028 #ifndef _CPPUHELPER_IMPLBASE_EX_POST_HXX_
00029 #define _CPPUHELPER_IMPLBASE_EX_POST_HXX_
00030 
00032 
00033 #define __DEF_CLASS_DATA_INIT_EX( N, class_cast ) \
00034 { \
00035 N +1, sal_False, sal_False, \
00036 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \
00037 { \
00038 __IFC_EX_TYPE_INIT##N( class_cast ), \
00039 __IFC_EX_TYPE_INIT_NAME( class_cast, ::com::sun::star::lang::XTypeProvider ) \
00040 } \
00041 }
00042 
00043 #define __DEF_IMPLHELPER_EX( N ) \
00044 namespace cppu \
00045 { \
00046 struct class_data##N \
00047 { \
00048     sal_Int16 m_nTypes; \
00049     sal_Bool m_storedTypeRefs; \
00050     sal_Bool m_storedId; \
00051     sal_Int8 m_id[ 16 ]; \
00052     type_entry m_typeEntries[ N + 1 ]; \
00053 }; \
00054 template< __CLASS_IFC##N > \
00055 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper##N \
00056     : public ::com::sun::star::lang::XTypeProvider \
00057     , __PUBLIC_IFC##N \
00058 { \
00059     static class_data##N s_cd; \
00060 public: \
00061     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00062         { return ImplHelper_query( rType, (class_data *)&s_cd, this ); } \
00063     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00064         { return ImplHelper_getTypes( (class_data *)&s_cd ); } \
00065     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00066         { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
00067 }; \
00068 template< __CLASS_IFC##N > \
00069 class_data##N ImplHelper##N< __IFC##N >::s_cd = \
00070 __DEF_CLASS_DATA_INIT_EX( N, (ImplHelper##N< __IFC##N > *) ); \
00071 template< __CLASS_IFC##N > \
00072 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper##N \
00073     : public OWeakObject \
00074     , public ::com::sun::star::lang::XTypeProvider \
00075     , __PUBLIC_IFC##N \
00076 { \
00077     static class_data##N s_cd; \
00078 public: \
00079     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00080         { return WeakImplHelper_query( rType, (class_data *)&s_cd, this, (OWeakObject *)this ); } \
00081     virtual void SAL_CALL acquire() throw () \
00082         { OWeakObject::acquire(); } \
00083     virtual void SAL_CALL release() throw () \
00084         { OWeakObject::release(); } \
00085     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00086         { return WeakImplHelper_getTypes( (class_data *)&s_cd ); } \
00087     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00088         { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
00089 }; \
00090 template< __CLASS_IFC##N > \
00091 class_data##N WeakImplHelper##N< __IFC##N >::s_cd = \
00092 __DEF_CLASS_DATA_INIT_EX( N, (WeakImplHelper##N< __IFC##N > *) ); \
00093 template< __CLASS_IFC##N > \
00094 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper##N \
00095     : public OWeakAggObject \
00096     , public ::com::sun::star::lang::XTypeProvider \
00097     , __PUBLIC_IFC##N \
00098 { \
00099     static class_data##N s_cd; \
00100 public: \
00101     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00102         { return OWeakAggObject::queryInterface( rType ); } \
00103     virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00104         { return WeakAggImplHelper_queryAgg( rType, (class_data *)&s_cd, this, (OWeakAggObject *)this ); } \
00105     virtual void SAL_CALL acquire() throw () \
00106         { OWeakAggObject::acquire(); } \
00107     virtual void SAL_CALL release() throw () \
00108         { OWeakAggObject::release(); } \
00109     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00110         { return WeakAggImplHelper_getTypes( (class_data *)&s_cd ); } \
00111     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00112         { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
00113 }; \
00114 template< __CLASS_IFC##N > \
00115 class_data##N WeakAggImplHelper##N< __IFC##N >::s_cd = \
00116 __DEF_CLASS_DATA_INIT_EX( N, (WeakAggImplHelper##N< __IFC##N > *) ); \
00117 template< class BaseClass, __CLASS_IFC##N > \
00118 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper##N \
00119     : public BaseClass \
00120     , __PUBLIC_IFC##N \
00121 { \
00122     static class_data##N s_cd; \
00123 public: \
00124     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00125     { \
00126         ::com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, (class_data *)&s_cd, this ) ); \
00127         if (aRet.hasValue()) \
00128             return aRet; \
00129         return BaseClass::queryInterface( rType ); \
00130     } \
00131     virtual void SAL_CALL acquire() throw () \
00132         { BaseClass::acquire(); } \
00133     virtual void SAL_CALL release() throw () \
00134         { BaseClass::release(); } \
00135     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00136         { return ImplInhHelper_getTypes( (class_data *)&s_cd, BaseClass::getTypes() ); } \
00137     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00138         { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
00139 }; \
00140 template< class BaseClass, __CLASS_IFC##N > \
00141 class_data##N ImplInheritanceHelper##N< BaseClass, __IFC##N >::s_cd = \
00142 __DEF_CLASS_DATA_INIT_EX( N, (ImplInheritanceHelper##N< BaseClass, __IFC##N > *) ); \
00143 template< class BaseClass, __CLASS_IFC##N > \
00144 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper##N \
00145     : public BaseClass \
00146     , __PUBLIC_IFC##N \
00147 { \
00148     static class_data##N s_cd; \
00149 public: \
00150     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00151         { return BaseClass::queryInterface( rType ); } \
00152     virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00153     { \
00154         ::com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, (class_data *)&s_cd, this ) ); \
00155         if (aRet.hasValue()) \
00156             return aRet; \
00157         return BaseClass::queryAggregation( rType ); \
00158     } \
00159     virtual void SAL_CALL acquire() throw () \
00160         { BaseClass::acquire(); } \
00161     virtual void SAL_CALL release() throw () \
00162         { BaseClass::release(); } \
00163     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00164         { return ImplInhHelper_getTypes( (class_data *)&s_cd, BaseClass::getTypes() ); } \
00165     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00166         { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
00167 }; \
00168 template< class BaseClass, __CLASS_IFC##N > \
00169 class_data##N AggImplInheritanceHelper##N< BaseClass, __IFC##N >::s_cd = \
00170 __DEF_CLASS_DATA_INIT_EX( N, (AggImplInheritanceHelper##N< BaseClass, __IFC##N > *) ); \
00171 }
00172 
00173 #define __DEF_COMPIMPLHELPER_EX( N ) \
00174 namespace cppu \
00175 { \
00176 template< __CLASS_IFC##N > \
00177 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper##N \
00178     : public WeakComponentImplHelperBase \
00179     , public ::com::sun::star::lang::XTypeProvider \
00180     , __PUBLIC_IFC##N \
00181 { \
00182     static class_data##N s_cd; \
00183 public: \
00184     inline WeakComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
00185         : WeakComponentImplHelperBase( rMutex ) \
00186         {} \
00187     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00188         { return WeakComponentImplHelper_query( rType, (class_data *)&s_cd, this, (WeakComponentImplHelperBase *)this ); } \
00189     virtual void SAL_CALL acquire() throw () \
00190         { WeakComponentImplHelperBase::acquire(); } \
00191     virtual void SAL_CALL release() throw () \
00192         { WeakComponentImplHelperBase::release(); } \
00193     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00194         { return WeakComponentImplHelper_getTypes( (class_data *)&s_cd ); } \
00195     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00196         { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
00197 }; \
00198 template< __CLASS_IFC##N > \
00199 class_data##N WeakComponentImplHelper##N< __IFC##N >::s_cd = \
00200 __DEF_CLASS_DATA_INIT_EX( N, (WeakComponentImplHelper##N< __IFC##N > *) ); \
00201 template< __CLASS_IFC##N > \
00202 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper##N \
00203     : public WeakAggComponentImplHelperBase \
00204     , public ::com::sun::star::lang::XTypeProvider \
00205     , __PUBLIC_IFC##N \
00206 { \
00207     static class_data##N s_cd; \
00208 public: \
00209     inline WeakAggComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
00210         : WeakAggComponentImplHelperBase( rMutex ) \
00211         {} \
00212     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00213         { return WeakAggComponentImplHelperBase::queryInterface( rType ); } \
00214     virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00215         { return WeakAggComponentImplHelper_queryAgg( rType, (class_data *)&s_cd, this, (WeakAggComponentImplHelperBase *)this ); } \
00216     virtual void SAL_CALL acquire() throw () \
00217         { WeakAggComponentImplHelperBase::acquire(); } \
00218     virtual void SAL_CALL release() throw () \
00219         { WeakAggComponentImplHelperBase::release(); } \
00220     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00221         { return WeakAggComponentImplHelper_getTypes( (class_data *)&s_cd ); } \
00222     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00223         { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
00224 }; \
00225 template< __CLASS_IFC##N > \
00226 class_data##N WeakAggComponentImplHelper##N< __IFC##N >::s_cd = \
00227 __DEF_CLASS_DATA_INIT_EX( N, (WeakAggComponentImplHelper##N< __IFC##N > *) ); \
00228 }
00229 
00231 
00232 #endif
00233 
00234 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines