00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _CPPUHELPER_COMPBASE_HXX_
00020 #define _CPPUHELPER_COMPBASE_HXX_
00021
00022 #include <cppuhelper/compbase_ex.hxx>
00023 #include <cppuhelper/implbase.hxx>
00024
00025
00026
00027
00028
00030
00031 #define __DEF_COMPIMPLHELPER_A( N ) \
00032 namespace cppu \
00033 { \
00034 template< __CLASS_IFC##N > \
00035 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper##N \
00036 : public ::cppu::WeakComponentImplHelperBase \
00037 , public ImplHelperBase##N< __IFC##N > \
00038 { \
00039 static ClassData##N s_aCD; \
00040 public: \
00041 WeakComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
00042 : WeakComponentImplHelperBase( rMutex ) \
00043 {} \
00044 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00045 { \
00046 ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase##N< __IFC##N > *)this ) ); \
00047 if (aRet.hasValue()) \
00048 return aRet; \
00049 return WeakComponentImplHelperBase::queryInterface( rType ); \
00050 } \
00051 virtual void SAL_CALL acquire() throw () \
00052 { WeakComponentImplHelperBase::acquire(); } \
00053 virtual void SAL_CALL release() throw () \
00054 { WeakComponentImplHelperBase::release(); } \
00055 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00056 { return getClassData( s_aCD ).getTypes(); } \
00057 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00058 { return getClassData( s_aCD ).getImplementationId(); } \
00059 }; \
00060 template< __CLASS_IFC##N > \
00061 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper##N \
00062 : public ::cppu::WeakAggComponentImplHelperBase \
00063 , public ImplHelperBase##N< __IFC##N > \
00064 { \
00065 static ClassData##N s_aCD; \
00066 public: \
00067 WeakAggComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
00068 : WeakAggComponentImplHelperBase( rMutex ) \
00069 {} \
00070 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00071 { return WeakAggComponentImplHelperBase::queryInterface( rType ); } \
00072 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00073 { \
00074 ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase##N< __IFC##N > *)this ) ); \
00075 if (aRet.hasValue()) \
00076 return aRet; \
00077 return WeakAggComponentImplHelperBase::queryAggregation( rType ); \
00078 } \
00079 virtual void SAL_CALL acquire() throw () \
00080 { WeakAggComponentImplHelperBase::acquire(); } \
00081 virtual void SAL_CALL release() throw () \
00082 { WeakAggComponentImplHelperBase::release(); } \
00083 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00084 { return getClassData( s_aCD ).getTypes(); } \
00085 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00086 { return getClassData( s_aCD ).getImplementationId(); } \
00087 };
00088
00089 #define __DEF_COMPIMPLHELPER_B( N ) \
00090 template< __CLASS_IFC##N > \
00091 ClassData##N WeakComponentImplHelper##N< __IFC##N >::s_aCD = ClassData##N( 4 ); \
00092 template< __CLASS_IFC##N > \
00093 ClassData##N WeakAggComponentImplHelper##N< __IFC##N >::s_aCD = ClassData##N( 3 );
00094
00095 #define __DEF_COMPIMPLHELPER_C( N ) \
00096 }
00097
00098 #define __DEF_COMPIMPLHELPER( N ) \
00099 __DEF_COMPIMPLHELPER_A( N ) \
00100 __DEF_COMPIMPLHELPER_B( N ) \
00101 __DEF_COMPIMPLHELPER_C( N )
00102
00104
00105 #endif
00106
00107