diff options
35 files changed, 1664 insertions, 3046 deletions
diff --git a/cppuhelper/inc/cppuhelper/compbase.hxx b/cppuhelper/inc/cppuhelper/compbase.hxx index 81dce204f..5d0c63a07 100644 --- a/cppuhelper/inc/cppuhelper/compbase.hxx +++ b/cppuhelper/inc/cppuhelper/compbase.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dbo $ $Date: 2001-08-27 10:00:48 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,120 +61,12 @@ #ifndef _CPPUHELPER_COMPBASE_HXX_ #define _CPPUHELPER_COMPBASE_HXX_ -#ifndef _OSL_DIAGNOSE_H_ -#include <osl/diagnose.h> +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -#ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_ -#include <cppuhelper/interfacecontainer.hxx> -#endif - -#include <com/sun/star/lang/XComponent.hpp> - -namespace cppu -{ - -/** Implementation helper base class for components. Inherits from ::cppu::OWeakObject and - ::com::sun::star::lang::XComponent. -*/ -class SAL_NO_VTABLE WeakComponentImplHelperBase - : public ::cppu::OWeakObject - , public ::com::sun::star::lang::XComponent -{ -protected: - /** boradcast helper for disposing events - */ - ::cppu::OBroadcastHelper rBHelper; - - /** this function is called upon disposing the component - */ - virtual void SAL_CALL disposing(); - - /** This is the one and only constructor that is called from derived implementations. - - @param rMutex mutex to sync upon disposing - */ - WeakComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW( () ); -public: - /** Destructor - */ - virtual ~WeakComponentImplHelperBase() SAL_THROW( () ); - - // these are here to force memory de/allocation to sal lib. - inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () ) - { return ::rtl_allocateMemory( nSize ); } - inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () ) - { ::rtl_freeMemory( pMem ); } - inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW( () ) - { return pMem; } - inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW( () ) - {} - - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( - ::com::sun::star::uno::Type const & rType ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire() - throw (); - virtual void SAL_CALL release() - throw (); - virtual void SAL_CALL dispose() - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addEventListener( - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeEventListener( - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) - throw (::com::sun::star::uno::RuntimeException); -}; - -class SAL_NO_VTABLE WeakAggComponentImplHelperBase - : public ::cppu::OWeakAggObject - , public ::com::sun::star::lang::XComponent -{ -protected: - ::cppu::OBroadcastHelper rBHelper; - - /** Is called upon disposing the component. - */ - virtual void SAL_CALL disposing(); - - WeakAggComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW( () ); -public: - virtual ~WeakAggComponentImplHelperBase() SAL_THROW( () ); - - // these are here to force memory de/allocation to sal lib. - inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () ) - { return ::rtl_allocateMemory( nSize ); } - inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () ) - { ::rtl_freeMemory( pMem ); } - inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW( () ) - { return pMem; } - inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW( () ) - {} - - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( - ::com::sun::star::uno::Type const & rType ) - throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( - ::com::sun::star::uno::Type const & rType ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire() - throw (); - virtual void SAL_CALL release() - throw (); - virtual void SAL_CALL dispose() - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addEventListener( - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeEventListener( - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) - throw (::com::sun::star::uno::RuntimeException); -}; - -} //================================================================================================== #define __DEF_COMPIMPLHELPER_A( N ) \ @@ -198,9 +90,9 @@ public: \ return WeakComponentImplHelperBase::queryInterface( rType ); \ } \ virtual void SAL_CALL acquire() throw () \ - { WeakComponentImplHelperBase::::acquire(); } \ + { WeakComponentImplHelperBase::acquire(); } \ virtual void SAL_CALL release() throw () \ - { WeakComponentImplHelperBase::::release(); } \ + { WeakComponentImplHelperBase::release(); } \ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \ { return getClassData( s_aCD ).getTypes(); } \ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \ diff --git a/cppuhelper/inc/cppuhelper/compbase1.hxx b/cppuhelper/inc/cppuhelper/compbase1.hxx index a9f176a3d..bab4e6a0e 100644 --- a/cppuhelper/inc/cppuhelper/compbase1.hxx +++ b/cppuhelper/inc/cppuhelper/compbase1.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase1.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE1_HXX_ #include <cppuhelper/implbase1.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 1 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1 > - class SAL_NO_VTABLE WeakComponentImplHelper1 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase1< Ifc1 > - { - static ClassData1 s_aCD; - public: - WeakComponentImplHelper1( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase1< Ifc1 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1 > - class SAL_NO_VTABLE WeakAggComponentImplHelper1 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase1< Ifc1 > - { - static ClassData1 s_aCD; - public: - WeakAggComponentImplHelper1( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase1< Ifc1 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1 > - ClassData1 WeakComponentImplHelper1< Ifc1 >::s_aCD = ClassData1( 4 ); - template< class Ifc1 > - ClassData1 WeakAggComponentImplHelper1< Ifc1 >::s_aCD = ClassData1( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 1 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase10.hxx b/cppuhelper/inc/cppuhelper/compbase10.hxx index a87d52695..a5919c40d 100644 --- a/cppuhelper/inc/cppuhelper/compbase10.hxx +++ b/cppuhelper/inc/cppuhelper/compbase10.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase10.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE10_HXX_ #include <cppuhelper/implbase10.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 10 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - class SAL_NO_VTABLE WeakComponentImplHelper10 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > - { - static ClassData10 s_aCD; - public: - WeakComponentImplHelper10( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - class SAL_NO_VTABLE WeakAggComponentImplHelper10 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > - { - static ClassData10 s_aCD; - public: - WeakAggComponentImplHelper10( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - ClassData10 WeakComponentImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >::s_aCD = ClassData10( 4 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - ClassData10 WeakAggComponentImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >::s_aCD = ClassData10( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 10 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase11.hxx b/cppuhelper/inc/cppuhelper/compbase11.hxx index fd3372067..4fefef3bd 100644 --- a/cppuhelper/inc/cppuhelper/compbase11.hxx +++ b/cppuhelper/inc/cppuhelper/compbase11.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase11.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE11_HXX_ #include <cppuhelper/implbase11.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 11 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - class SAL_NO_VTABLE WeakComponentImplHelper11 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > - { - static ClassData11 s_aCD; - public: - WeakComponentImplHelper11( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - class SAL_NO_VTABLE WeakAggComponentImplHelper11 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > - { - static ClassData11 s_aCD; - public: - WeakAggComponentImplHelper11( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - ClassData11 WeakComponentImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >::s_aCD = ClassData11( 4 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - ClassData11 WeakAggComponentImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >::s_aCD = ClassData11( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 11 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase12.hxx b/cppuhelper/inc/cppuhelper/compbase12.hxx index 87f0d9d22..89feb401c 100644 --- a/cppuhelper/inc/cppuhelper/compbase12.hxx +++ b/cppuhelper/inc/cppuhelper/compbase12.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase12.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE12_HXX_ #include <cppuhelper/implbase12.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 12 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - class SAL_NO_VTABLE WeakComponentImplHelper12 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > - { - static ClassData12 s_aCD; - public: - WeakComponentImplHelper12( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - class SAL_NO_VTABLE WeakAggComponentImplHelper12 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > - { - static ClassData12 s_aCD; - public: - WeakAggComponentImplHelper12( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - ClassData12 WeakComponentImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >::s_aCD = ClassData12( 4 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - ClassData12 WeakAggComponentImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >::s_aCD = ClassData12( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 12 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase2.hxx b/cppuhelper/inc/cppuhelper/compbase2.hxx index 849ce964e..f641c3118 100644 --- a/cppuhelper/inc/cppuhelper/compbase2.hxx +++ b/cppuhelper/inc/cppuhelper/compbase2.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase2.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,105 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE2_HXX_ #include <cppuhelper/implbase2.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 2 ) -*/ +#else /* ! MACOSX */ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2 > - class SAL_NO_VTABLE WeakComponentImplHelper2 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase2< Ifc1, Ifc2 > - { - static ClassData2 s_aCD; - public: - WeakComponentImplHelper2( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase2< Ifc1, Ifc2 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2 > - class SAL_NO_VTABLE WeakAggComponentImplHelper2 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase2< Ifc1, Ifc2 > - { - static ClassData2 s_aCD; - public: - WeakAggComponentImplHelper2( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase2< Ifc1, Ifc2 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - -#ifndef MACOSX - template< class Ifc1, class Ifc2 > - ClassData2 WeakComponentImplHelper2< Ifc1, Ifc2 >::s_aCD = ClassData2( 4 ); - template< class Ifc1, class Ifc2 > - ClassData2 WeakAggComponentImplHelper2< Ifc1, Ifc2 >::s_aCD = ClassData2( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 2 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase3.hxx b/cppuhelper/inc/cppuhelper/compbase3.hxx index 03e17bd64..de36bf1d5 100644 --- a/cppuhelper/inc/cppuhelper/compbase3.hxx +++ b/cppuhelper/inc/cppuhelper/compbase3.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase3.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE3_HXX_ #include <cppuhelper/implbase3.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 3 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3 > - class SAL_NO_VTABLE WeakComponentImplHelper3 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase3< Ifc1, Ifc2, Ifc3 > - { - static ClassData3 s_aCD; - public: - WeakComponentImplHelper3( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase3< Ifc1, Ifc2, Ifc3 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3 > - class SAL_NO_VTABLE WeakAggComponentImplHelper3 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase3< Ifc1, Ifc2, Ifc3 > - { - static ClassData3 s_aCD; - public: - WeakAggComponentImplHelper3( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase3< Ifc1, Ifc2, Ifc3 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3 > - ClassData3 WeakComponentImplHelper3< Ifc1, Ifc2, Ifc3 >::s_aCD = ClassData3( 4 ); - template< class Ifc1, class Ifc2, class Ifc3 > - ClassData3 WeakAggComponentImplHelper3< Ifc1, Ifc2, Ifc3 >::s_aCD = ClassData3( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 3 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase4.hxx b/cppuhelper/inc/cppuhelper/compbase4.hxx index 00efca047..9430070ac 100644 --- a/cppuhelper/inc/cppuhelper/compbase4.hxx +++ b/cppuhelper/inc/cppuhelper/compbase4.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase4.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE4_HXX_ #include <cppuhelper/implbase4.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 4 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - class SAL_NO_VTABLE WeakComponentImplHelper4 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > - { - static ClassData4 s_aCD; - public: - WeakComponentImplHelper4( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - class SAL_NO_VTABLE WeakAggComponentImplHelper4 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > - { - static ClassData4 s_aCD; - public: - WeakAggComponentImplHelper4( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - ClassData4 WeakComponentImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >::s_aCD = ClassData4( 4 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - ClassData4 WeakAggComponentImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >::s_aCD = ClassData4( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 4 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase5.hxx b/cppuhelper/inc/cppuhelper/compbase5.hxx index a7c8c6553..2ceebe8a5 100644 --- a/cppuhelper/inc/cppuhelper/compbase5.hxx +++ b/cppuhelper/inc/cppuhelper/compbase5.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase5.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE5_HXX_ #include <cppuhelper/implbase5.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 5 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - class SAL_NO_VTABLE WeakComponentImplHelper5 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > - { - static ClassData5 s_aCD; - public: - WeakComponentImplHelper5( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - class SAL_NO_VTABLE WeakAggComponentImplHelper5 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > - { - static ClassData5 s_aCD; - public: - WeakAggComponentImplHelper5( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - ClassData5 WeakComponentImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >::s_aCD = ClassData5( 4 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - ClassData5 WeakAggComponentImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >::s_aCD = ClassData5( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 5 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase6.hxx b/cppuhelper/inc/cppuhelper/compbase6.hxx index 51d479811..1827aa335 100644 --- a/cppuhelper/inc/cppuhelper/compbase6.hxx +++ b/cppuhelper/inc/cppuhelper/compbase6.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase6.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE6_HXX_ #include <cppuhelper/implbase6.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 6 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - class SAL_NO_VTABLE WeakComponentImplHelper6 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > - { - static ClassData6 s_aCD; - public: - WeakComponentImplHelper6( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - class SAL_NO_VTABLE WeakAggComponentImplHelper6 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > - { - static ClassData6 s_aCD; - public: - WeakAggComponentImplHelper6( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - ClassData6 WeakComponentImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >::s_aCD = ClassData6( 4 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - ClassData6 WeakAggComponentImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >::s_aCD = ClassData6( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 6 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase7.hxx b/cppuhelper/inc/cppuhelper/compbase7.hxx index 467d3ce85..060d23c5a 100644 --- a/cppuhelper/inc/cppuhelper/compbase7.hxx +++ b/cppuhelper/inc/cppuhelper/compbase7.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase7.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE7_HXX_ #include <cppuhelper/implbase7.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 7 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - class SAL_NO_VTABLE WeakComponentImplHelper7 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > - { - static ClassData7 s_aCD; - public: - WeakComponentImplHelper7( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - class SAL_NO_VTABLE WeakAggComponentImplHelper7 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > - { - static ClassData7 s_aCD; - public: - WeakAggComponentImplHelper7( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - ClassData7 WeakComponentImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >::s_aCD = ClassData7( 4 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - ClassData7 WeakAggComponentImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >::s_aCD = ClassData7( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 7 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase8.hxx b/cppuhelper/inc/cppuhelper/compbase8.hxx index 02f705307..67eb3fc3b 100644 --- a/cppuhelper/inc/cppuhelper/compbase8.hxx +++ b/cppuhelper/inc/cppuhelper/compbase8.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase8.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE8_HXX_ #include <cppuhelper/implbase8.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 8 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - class SAL_NO_VTABLE WeakComponentImplHelper8 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > - { - static ClassData8 s_aCD; - public: - WeakComponentImplHelper8( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - class SAL_NO_VTABLE WeakAggComponentImplHelper8 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > - { - static ClassData8 s_aCD; - public: - WeakAggComponentImplHelper8( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - ClassData8 WeakComponentImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >::s_aCD = ClassData8( 4 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - ClassData8 WeakAggComponentImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >::s_aCD = ClassData8( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 8 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase9.hxx b/cppuhelper/inc/cppuhelper/compbase9.hxx index 0bfdd7f4f..e4c2f580e 100644 --- a/cppuhelper/inc/cppuhelper/compbase9.hxx +++ b/cppuhelper/inc/cppuhelper/compbase9.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase9.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,104 +64,23 @@ #ifndef _CPPUHELPER_IMPLBASE9_HXX_ #include <cppuhelper/implbase9.hxx> #endif + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_COMPBASE_HXX_ #include <cppuhelper/compbase.hxx> #endif -/* __DEF_COMPIMPLHELPER( 9 ) -*/ -namespace cppu -{ - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - class SAL_NO_VTABLE WeakComponentImplHelper9 - : public ::cppu::WeakComponentImplHelperBase - , public ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > - { - static ClassData9 s_aCD; - public: - WeakComponentImplHelper9( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakComponentImplHelperBase::queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class unites ::cppu::ImplHelperBaseN<>, com.sun.star.lang.XComponent - and ::cppu::OWeakAggObject, thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - The template class expects a C++ mutex reference for synchronization in its ctor. - The com.sun.star.lang.XComponent implementation fires a final disposing() call - to the implementation when the component is to be disposed. So implement disposing() - when sub-classing. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggComponentImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - class SAL_NO_VTABLE WeakAggComponentImplHelper9 - : public ::cppu::WeakAggComponentImplHelperBase - , public ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > - { - static ClassData9 s_aCD; - public: - WeakAggComponentImplHelper9( ::osl::Mutex & rMutex ) SAL_THROW( () ) - : WeakAggComponentImplHelperBase( rMutex ) - {} - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return WeakAggComponentImplHelperBase::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > *)this ) ); - if (aRet.hasValue()) - return aRet; - return WeakAggComponentImplHelperBase::queryAggregation( rType ); - } - virtual void SAL_CALL acquire() throw () - { WeakAggComponentImplHelperBase::acquire(); } - virtual void SAL_CALL release() throw () - { WeakAggComponentImplHelperBase::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - ClassData9 WeakComponentImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >::s_aCD = ClassData9( 4 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - ClassData9 WeakAggComponentImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >::s_aCD = ClassData9( 3 ); +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> #endif -} +__DEF_COMPIMPLHELPER_EX( 9 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/compbase_ex.hxx b/cppuhelper/inc/cppuhelper/compbase_ex.hxx new file mode 100644 index 000000000..0065e6f1b --- /dev/null +++ b/cppuhelper/inc/cppuhelper/compbase_ex.hxx @@ -0,0 +1,214 @@ +/************************************************************************* + * + * $RCSfile: compbase_ex.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#define _CPPUHELPER_COMPBASE_EX_HXX_ + +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> +#endif +#ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_ +#include <cppuhelper/interfacecontainer.hxx> +#endif + +#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ +#include <com/sun/star/lang/XComponent.hpp> +#endif + + +namespace cppu +{ + +/** Implementation helper base class for components. Inherits from ::cppu::OWeakObject and + ::com::sun::star::lang::XComponent. +*/ +class SAL_NO_VTABLE WeakComponentImplHelperBase + : public ::cppu::OWeakObject + , public ::com::sun::star::lang::XComponent +{ +protected: + /** boradcast helper for disposing events + */ + ::cppu::OBroadcastHelper rBHelper; + + /** this function is called upon disposing the component + */ + virtual void SAL_CALL disposing(); + + /** This is the one and only constructor that is called from derived implementations. + + @param rMutex mutex to sync upon disposing + */ + WeakComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW( () ); +public: + /** Destructor + */ + virtual ~WeakComponentImplHelperBase() SAL_THROW( () ); + + // these are here to force memory de/allocation to sal lib. + inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () ) + { return ::rtl_allocateMemory( nSize ); } + inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () ) + { ::rtl_freeMemory( pMem ); } + inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW( () ) + { return pMem; } + inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW( () ) + {} + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() + throw (); + virtual void SAL_CALL release() + throw (); + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) + throw (::com::sun::star::uno::RuntimeException); +}; + +/** Implementation helper base class for components. Inherits from ::cppu::OWeakAggObject and + ::com::sun::star::lang::XComponent. +*/ +class SAL_NO_VTABLE WeakAggComponentImplHelperBase + : public ::cppu::OWeakAggObject + , public ::com::sun::star::lang::XComponent +{ +protected: + ::cppu::OBroadcastHelper rBHelper; + + /** Is called upon disposing the component. + */ + virtual void SAL_CALL disposing(); + + WeakAggComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW( () ); +public: + virtual ~WeakAggComponentImplHelperBase() SAL_THROW( () ); + + // these are here to force memory de/allocation to sal lib. + inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () ) + { return ::rtl_allocateMemory( nSize ); } + inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () ) + { ::rtl_freeMemory( pMem ); } + inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW( () ) + { return pMem; } + inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW( () ) + {} + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() + throw (); + virtual void SAL_CALL release() + throw (); + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) + throw (::com::sun::star::uno::RuntimeException); +}; + +/** WeakComponentImplHelper +*/ +::com::sun::star::uno::Any SAL_CALL WeakComponentImplHelper_query( + ::com::sun::star::uno::Type const & rType, + class_data * cd, + void * that, + ::cppu::WeakComponentImplHelperBase * pBase ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); +/** WeakComponentImplHelper +*/ +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakComponentImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); + +/** WeakAggComponentImplHelper +*/ +::com::sun::star::uno::Any SAL_CALL WeakAggComponentImplHelper_queryAgg( + ::com::sun::star::uno::Type const & rType, + class_data * cd, + void * that, + ::cppu::WeakAggComponentImplHelperBase * pBase ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); +/** WeakAggComponentImplHelper +*/ +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakAggComponentImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); + +} + +#endif diff --git a/cppuhelper/inc/cppuhelper/implbase1.hxx b/cppuhelper/inc/cppuhelper/implbase1.hxx index 4a5ed12e3..d5d8ddc1c 100644 --- a/cppuhelper/inc/cppuhelper/implbase1.hxx +++ b/cppuhelper/inc/cppuhelper/implbase1.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase1.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,154 +61,32 @@ #ifndef _CPPUHELPER_IMPLBASE1_HXX_ #define _CPPUHELPER_IMPLBASE1_HXX_ +#define __IFC1 Ifc1 +#define __CLASS_IFC1 class Ifc1 +#define __PUBLIC_IFC1 public Ifc1 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC1 Ifc1 -#define __CLASS_IFC1 class Ifc1 -#define __PUBLIC_IFC1 public Ifc1 __DEF_IMPLHELPER_PRE( 1 ) __IFC_WRITEOFFSET( 1 ) __DEF_IMPLHELPER_POST( 1 ) -*/ -namespace cppu -{ - struct ClassData1 : public ClassDataBase - { - Type_Offset arType2Offset[ 1 ]; - ClassData1( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1 > - class SAL_NO_VTABLE ImplHelperBase1 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1 > - class SAL_NO_VTABLE ImplHelper1 - : public ImplHelperBase1< Ifc1 > - { - static ClassData1 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase1< Ifc1 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1 > - class SAL_NO_VTABLE WeakImplHelper1 - : public ::cppu::OWeakObject - , public ImplHelperBase1< Ifc1 > - { - static ClassData1 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase1< Ifc1 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1 > - class SAL_NO_VTABLE WeakAggImplHelper1 - : public ::cppu::OWeakAggObject - , public ImplHelperBase1< Ifc1 > - { - static ClassData1 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase1< Ifc1 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1 > - ClassData1 ImplHelper1< Ifc1 >::s_aCD = ClassData1( 0 ); - template< class Ifc1 > - ClassData1 WeakImplHelper1< Ifc1 >::s_aCD = ClassData1( 1 ); - template< class Ifc1 > - ClassData1 WeakAggImplHelper1< Ifc1 >::s_aCD = ClassData1( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT1( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 1 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase10.hxx b/cppuhelper/inc/cppuhelper/implbase10.hxx index 29e8d3506..9b0fd8065 100644 --- a/cppuhelper/inc/cppuhelper/implbase10.hxx +++ b/cppuhelper/inc/cppuhelper/implbase10.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase10.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,174 +61,38 @@ #ifndef _CPPUHELPER_IMPLBASE10_HXX_ #define _CPPUHELPER_IMPLBASE10_HXX_ +#define __IFC10 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 +#define __CLASS_IFC10 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 +#define __PUBLIC_IFC10 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC10 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 -#define __CLASS_IFC10 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 -#define __PUBLIC_IFC10 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10 __DEF_IMPLHELPER_PRE( 10 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __IFC_WRITEOFFSET( 4 ) __IFC_WRITEOFFSET( 5 ) __IFC_WRITEOFFSET( 6 ) __IFC_WRITEOFFSET( 7 ) __IFC_WRITEOFFSET( 8 ) __IFC_WRITEOFFSET( 9 ) __IFC_WRITEOFFSET( 10 ) __DEF_IMPLHELPER_POST( 10 ) -*/ -namespace cppu -{ - struct ClassData10 : public ClassDataBase - { - Type_Offset arType2Offset[ 10 ]; - ClassData10( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - class SAL_NO_VTABLE ImplHelperBase10 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc4 > *)0 ), - (char *)(Ifc4 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc5 > *)0 ), - (char *)(Ifc5 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc6 > *)0 ), - (char *)(Ifc6 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc7 > *)0 ), - (char *)(Ifc7 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc8 > *)0 ), - (char *)(Ifc8 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc9 > *)0 ), - (char *)(Ifc9 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc10 > *)0 ), - (char *)(Ifc10 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - class SAL_NO_VTABLE ImplHelper10 - : public ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > - { - static ClassData10 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - class SAL_NO_VTABLE WeakImplHelper10 - : public ::cppu::OWeakObject - , public ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > - { - static ClassData10 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - class SAL_NO_VTABLE WeakAggImplHelper10 - : public ::cppu::OWeakAggObject - , public ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > - { - static ClassData10 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - ClassData10 ImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >::s_aCD = ClassData10( 0 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - ClassData10 WeakImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >::s_aCD = ClassData10( 1 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - ClassData10 WeakAggImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >::s_aCD = ClassData10( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT10( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ + __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \ + __IFC_EX_TYPE_INIT( class_cast, 7 ), __IFC_EX_TYPE_INIT( class_cast, 8 ), \ + __IFC_EX_TYPE_INIT( class_cast, 9 ), __IFC_EX_TYPE_INIT( class_cast, 10 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 10 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase11.hxx b/cppuhelper/inc/cppuhelper/implbase11.hxx index 8c88b4db8..81e3663b5 100644 --- a/cppuhelper/inc/cppuhelper/implbase11.hxx +++ b/cppuhelper/inc/cppuhelper/implbase11.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase11.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,176 +61,39 @@ #ifndef _CPPUHELPER_IMPLBASE11_HXX_ #define _CPPUHELPER_IMPLBASE11_HXX_ +#define __IFC11 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 +#define __CLASS_IFC11 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 +#define __PUBLIC_IFC11 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC11 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 -#define __CLASS_IFC11 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 -#define __PUBLIC_IFC11 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11 __DEF_IMPLHELPER_PRE( 11 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __IFC_WRITEOFFSET( 4 ) __IFC_WRITEOFFSET( 5 ) __IFC_WRITEOFFSET( 6 ) __IFC_WRITEOFFSET( 7 ) __IFC_WRITEOFFSET( 8 ) __IFC_WRITEOFFSET( 9 ) __IFC_WRITEOFFSET( 10 ) __IFC_WRITEOFFSET( 11 ) __DEF_IMPLHELPER_POST( 11 ) -*/ -namespace cppu -{ - struct ClassData11 : public ClassDataBase - { - Type_Offset arType2Offset[ 11 ]; - ClassData11( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - class SAL_NO_VTABLE ImplHelperBase11 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc4 > *)0 ), - (char *)(Ifc4 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc5 > *)0 ), - (char *)(Ifc5 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc6 > *)0 ), - (char *)(Ifc6 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc7 > *)0 ), - (char *)(Ifc7 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc8 > *)0 ), - (char *)(Ifc8 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc9 > *)0 ), - (char *)(Ifc9 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc10 > *)0 ), - (char *)(Ifc10 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc11 > *)0 ), - (char *)(Ifc11 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - class SAL_NO_VTABLE ImplHelper11 - : public ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > - { - static ClassData11 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - class SAL_NO_VTABLE WeakImplHelper11 - : public ::cppu::OWeakObject - , public ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > - { - static ClassData11 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - class SAL_NO_VTABLE WeakAggImplHelper11 - : public ::cppu::OWeakAggObject - , public ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > - { - static ClassData11 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - ClassData11 ImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >::s_aCD = ClassData11( 0 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - ClassData11 WeakImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >::s_aCD = ClassData11( 1 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - ClassData11 WeakAggImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >::s_aCD = ClassData11( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT11( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ + __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \ + __IFC_EX_TYPE_INIT( class_cast, 7 ), __IFC_EX_TYPE_INIT( class_cast, 8 ), \ + __IFC_EX_TYPE_INIT( class_cast, 9 ), __IFC_EX_TYPE_INIT( class_cast, 10 ), \ + __IFC_EX_TYPE_INIT( class_cast, 11 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 11 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase12.hxx b/cppuhelper/inc/cppuhelper/implbase12.hxx index f0eb91a5a..de375f54b 100644 --- a/cppuhelper/inc/cppuhelper/implbase12.hxx +++ b/cppuhelper/inc/cppuhelper/implbase12.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase12.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,178 +61,39 @@ #ifndef _CPPUHELPER_IMPLBASE12_HXX_ #define _CPPUHELPER_IMPLBASE12_HXX_ +#define __IFC12 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 +#define __CLASS_IFC12 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 +#define __PUBLIC_IFC12 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC12 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 -#define __CLASS_IFC12 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 -#define __PUBLIC_IFC12 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12 __DEF_IMPLHELPER_PRE( 12 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __IFC_WRITEOFFSET( 4 ) __IFC_WRITEOFFSET( 5 ) __IFC_WRITEOFFSET( 6 ) __IFC_WRITEOFFSET( 7 ) __IFC_WRITEOFFSET( 8 ) __IFC_WRITEOFFSET( 9 ) __IFC_WRITEOFFSET( 10 ) __IFC_WRITEOFFSET( 11 ) __IFC_WRITEOFFSET( 12 ) __DEF_IMPLHELPER_POST( 12 ) -*/ -namespace cppu -{ - struct ClassData12 : public ClassDataBase - { - Type_Offset arType2Offset[ 12 ]; - ClassData12( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - class SAL_NO_VTABLE ImplHelperBase12 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc4 > *)0 ), - (char *)(Ifc4 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc5 > *)0 ), - (char *)(Ifc5 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc6 > *)0 ), - (char *)(Ifc6 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc7 > *)0 ), - (char *)(Ifc7 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc8 > *)0 ), - (char *)(Ifc8 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc9 > *)0 ), - (char *)(Ifc9 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc10 > *)0 ), - (char *)(Ifc10 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc11 > *)0 ), - (char *)(Ifc11 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc12 > *)0 ), - (char *)(Ifc12 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - class SAL_NO_VTABLE ImplHelper12 - : public ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > - { - static ClassData12 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - class SAL_NO_VTABLE WeakImplHelper12 - : public ::cppu::OWeakObject - , public ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > - { - static ClassData12 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - class SAL_NO_VTABLE WeakAggImplHelper12 - : public ::cppu::OWeakAggObject - , public ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > - { - static ClassData12 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - ClassData12 ImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >::s_aCD = ClassData12( 0 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - ClassData12 WeakImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >::s_aCD = ClassData12( 1 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - ClassData12 WeakAggImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >::s_aCD = ClassData12( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT12( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ + __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \ + __IFC_EX_TYPE_INIT( class_cast, 7 ), __IFC_EX_TYPE_INIT( class_cast, 8 ), \ + __IFC_EX_TYPE_INIT( class_cast, 9 ), __IFC_EX_TYPE_INIT( class_cast, 10 ), \ + __IFC_EX_TYPE_INIT( class_cast, 11 ), __IFC_EX_TYPE_INIT( class_cast, 12 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 12 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase2.hxx b/cppuhelper/inc/cppuhelper/implbase2.hxx index 01ed7e783..2fdf144e5 100644 --- a/cppuhelper/inc/cppuhelper/implbase2.hxx +++ b/cppuhelper/inc/cppuhelper/implbase2.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase2.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,157 +61,32 @@ #ifndef _CPPUHELPER_IMPLBASE2_HXX_ #define _CPPUHELPER_IMPLBASE2_HXX_ +#define __IFC2 Ifc1, Ifc2 +#define __CLASS_IFC2 class Ifc1, class Ifc2 +#define __PUBLIC_IFC2 public Ifc1, public Ifc2 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC2 Ifc1, Ifc2 -#define __CLASS_IFC2 class Ifc1, class Ifc2 -#define __PUBLIC_IFC2 public Ifc1, public Ifc2 __DEF_IMPLHELPER_PRE( 2 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __DEF_IMPLHELPER_POST( 2 ) -*/ +#else /* ! MACOSX */ -namespace cppu -{ - struct ClassData2 : public ClassDataBase - { - Type_Offset arType2Offset[ 2 ]; - ClassData2( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2 > - class SAL_NO_VTABLE ImplHelperBase2 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2 > - class SAL_NO_VTABLE ImplHelper2 - : public ImplHelperBase2< Ifc1, Ifc2 > - { - static ClassData2 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase2< Ifc1, Ifc2 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2 > - class SAL_NO_VTABLE WeakImplHelper2 - : public ::cppu::OWeakObject - , public ImplHelperBase2< Ifc1, Ifc2 > - { - static ClassData2 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase2< Ifc1, Ifc2 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2 > - class SAL_NO_VTABLE WeakAggImplHelper2 - : public ::cppu::OWeakAggObject - , public ImplHelperBase2< Ifc1, Ifc2 > - { - static ClassData2 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase2< Ifc1, Ifc2 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - -#ifndef MACOSX - template< class Ifc1, class Ifc2 > - ClassData2 ImplHelper2< Ifc1, Ifc2 >::s_aCD = ClassData2( 0 ); - template< class Ifc1, class Ifc2 > - ClassData2 WeakImplHelper2< Ifc1, Ifc2 >::s_aCD = ClassData2( 1 ); - template< class Ifc1, class Ifc2 > - ClassData2 WeakAggImplHelper2< Ifc1, Ifc2 >::s_aCD = ClassData2( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT2( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 2 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase3.hxx b/cppuhelper/inc/cppuhelper/implbase3.hxx index dd81a6804..4965a0550 100644 --- a/cppuhelper/inc/cppuhelper/implbase3.hxx +++ b/cppuhelper/inc/cppuhelper/implbase3.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase3.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,158 +61,33 @@ #ifndef _CPPUHELPER_IMPLBASE3_HXX_ #define _CPPUHELPER_IMPLBASE3_HXX_ +#define __IFC3 Ifc1, Ifc2, Ifc3 +#define __CLASS_IFC3 class Ifc1, class Ifc2, class Ifc3 +#define __PUBLIC_IFC3 public Ifc1, public Ifc2, public Ifc3 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC3 Ifc1, Ifc2, Ifc3 -#define __CLASS_IFC3 class Ifc1, class Ifc2, class Ifc3 -#define __PUBLIC_IFC3 public Ifc1, public Ifc2, public Ifc3 __DEF_IMPLHELPER_PRE( 3 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __DEF_IMPLHELPER_POST( 3 ) -*/ -namespace cppu -{ - struct ClassData3 : public ClassDataBase - { - Type_Offset arType2Offset[ 3 ]; - ClassData3( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3 > - class SAL_NO_VTABLE ImplHelperBase3 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3 > - class SAL_NO_VTABLE ImplHelper3 - : public ImplHelperBase3< Ifc1, Ifc2, Ifc3 > - { - static ClassData3 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase3< Ifc1, Ifc2, Ifc3 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3 > - class SAL_NO_VTABLE WeakImplHelper3 - : public ::cppu::OWeakObject - , public ImplHelperBase3< Ifc1, Ifc2, Ifc3 > - { - static ClassData3 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase3< Ifc1, Ifc2, Ifc3 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3 > - class SAL_NO_VTABLE WeakAggImplHelper3 - : public ::cppu::OWeakAggObject - , public ImplHelperBase3< Ifc1, Ifc2, Ifc3 > - { - static ClassData3 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase3< Ifc1, Ifc2, Ifc3 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3 > - ClassData3 ImplHelper3< Ifc1, Ifc2, Ifc3 >::s_aCD = ClassData3( 0 ); - template< class Ifc1, class Ifc2, class Ifc3 > - ClassData3 WeakImplHelper3< Ifc1, Ifc2, Ifc3 >::s_aCD = ClassData3( 1 ); - template< class Ifc1, class Ifc2, class Ifc3 > - ClassData3 WeakAggImplHelper3< Ifc1, Ifc2, Ifc3 >::s_aCD = ClassData3( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT3( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 3 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase4.hxx b/cppuhelper/inc/cppuhelper/implbase4.hxx index 4dc60f52a..c51878b52 100644 --- a/cppuhelper/inc/cppuhelper/implbase4.hxx +++ b/cppuhelper/inc/cppuhelper/implbase4.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase4.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,160 +61,33 @@ #ifndef _CPPUHELPER_IMPLBASE4_HXX_ #define _CPPUHELPER_IMPLBASE4_HXX_ +#define __IFC4 Ifc1, Ifc2, Ifc3, Ifc4 +#define __CLASS_IFC4 class Ifc1, class Ifc2, class Ifc3, class Ifc4 +#define __PUBLIC_IFC4 public Ifc1, public Ifc2, public Ifc3, public Ifc4 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC4 Ifc1, Ifc2, Ifc3, Ifc4 -#define __CLASS_IFC4 class Ifc1, class Ifc2, class Ifc3, class Ifc4 -#define __PUBLIC_IFC4 public Ifc1, public Ifc2, public Ifc3, public Ifc4 __DEF_IMPLHELPER_PRE( 4 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __IFC_WRITEOFFSET( 4 ) __DEF_IMPLHELPER_POST( 4 ) -*/ -namespace cppu -{ - struct ClassData4 : public ClassDataBase - { - Type_Offset arType2Offset[ 4 ]; - ClassData4( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - class SAL_NO_VTABLE ImplHelperBase4 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3, public Ifc4 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc4 > *)0 ), - (char *)(Ifc4 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - class SAL_NO_VTABLE ImplHelper4 - : public ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > - { - static ClassData4 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - class SAL_NO_VTABLE WeakImplHelper4 - : public ::cppu::OWeakObject - , public ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > - { - static ClassData4 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - class SAL_NO_VTABLE WeakAggImplHelper4 - : public ::cppu::OWeakAggObject - , public ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > - { - static ClassData4 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase4< Ifc1, Ifc2, Ifc3, Ifc4 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - ClassData4 ImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >::s_aCD = ClassData4( 0 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - ClassData4 WeakImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >::s_aCD = ClassData4( 1 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - ClassData4 WeakAggImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >::s_aCD = ClassData4( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT4( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 4 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase5.hxx b/cppuhelper/inc/cppuhelper/implbase5.hxx index fb421b12c..818b50ed8 100644 --- a/cppuhelper/inc/cppuhelper/implbase5.hxx +++ b/cppuhelper/inc/cppuhelper/implbase5.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase5.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,163 +61,35 @@ #ifndef _CPPUHELPER_IMPLBASE5_HXX_ #define _CPPUHELPER_IMPLBASE5_HXX_ +#define __IFC5 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 +#define __CLASS_IFC5 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 +#define __PUBLIC_IFC5 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC5 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 -#define __CLASS_IFC5 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 -#define __PUBLIC_IFC5 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5 __DEF_IMPLHELPER_PRE( 5 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __IFC_WRITEOFFSET( 4 ) __IFC_WRITEOFFSET( 5 ) __DEF_IMPLHELPER_POST( 5 ) -*/ -namespace cppu -{ - struct ClassData5 : public ClassDataBase - { - Type_Offset arType2Offset[ 5 ]; - ClassData5( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - class SAL_NO_VTABLE ImplHelperBase5 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc4 > *)0 ), - (char *)(Ifc4 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc5 > *)0 ), - (char *)(Ifc5 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - class SAL_NO_VTABLE ImplHelper5 - : public ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > - { - static ClassData5 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - class SAL_NO_VTABLE WeakImplHelper5 - : public ::cppu::OWeakObject - , public ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > - { - static ClassData5 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - class SAL_NO_VTABLE WeakAggImplHelper5 - : public ::cppu::OWeakAggObject - , public ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > - { - static ClassData5 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - ClassData5 ImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >::s_aCD = ClassData5( 0 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - ClassData5 WeakImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >::s_aCD = ClassData5( 1 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - ClassData5 WeakAggImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >::s_aCD = ClassData5( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT5( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ + __IFC_EX_TYPE_INIT( class_cast, 5 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 5 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase6.hxx b/cppuhelper/inc/cppuhelper/implbase6.hxx index a43a9ea08..82ef69bb4 100644 --- a/cppuhelper/inc/cppuhelper/implbase6.hxx +++ b/cppuhelper/inc/cppuhelper/implbase6.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase6.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,165 +61,35 @@ #ifndef _CPPUHELPER_IMPLBASE6_HXX_ #define _CPPUHELPER_IMPLBASE6_HXX_ +#define __IFC6 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 +#define __CLASS_IFC6 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 +#define __PUBLIC_IFC6 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC6 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 -#define __CLASS_IFC6 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 -#define __PUBLIC_IFC6 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6 __DEF_IMPLHELPER_PRE( 6 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __IFC_WRITEOFFSET( 4 ) __IFC_WRITEOFFSET( 5 ) __IFC_WRITEOFFSET( 6 ) __DEF_IMPLHELPER_POST( 6 ) -*/ -namespace cppu -{ - struct ClassData6 : public ClassDataBase - { - Type_Offset arType2Offset[ 6 ]; - ClassData6( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - class SAL_NO_VTABLE ImplHelperBase6 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc4 > *)0 ), - (char *)(Ifc4 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc5 > *)0 ), - (char *)(Ifc5 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc6 > *)0 ), - (char *)(Ifc6 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - class SAL_NO_VTABLE ImplHelper6 - : public ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > - { - static ClassData6 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - class SAL_NO_VTABLE WeakImplHelper6 - : public ::cppu::OWeakObject - , public ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > - { - static ClassData6 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - class SAL_NO_VTABLE WeakAggImplHelper6 - : public ::cppu::OWeakAggObject - , public ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > - { - static ClassData6 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - ClassData6 ImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >::s_aCD = ClassData6( 0 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - ClassData6 WeakImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >::s_aCD = ClassData6( 1 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - ClassData6 WeakAggImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >::s_aCD = ClassData6( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT6( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ + __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 6 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase7.hxx b/cppuhelper/inc/cppuhelper/implbase7.hxx index ee0d1d108..38e680508 100644 --- a/cppuhelper/inc/cppuhelper/implbase7.hxx +++ b/cppuhelper/inc/cppuhelper/implbase7.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase7.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,167 +61,36 @@ #ifndef _CPPUHELPER_IMPLBASE7_HXX_ #define _CPPUHELPER_IMPLBASE7_HXX_ +#define __IFC7 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 +#define __CLASS_IFC7 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 +#define __PUBLIC_IFC7 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC7 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 -#define __CLASS_IFC7 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 -#define __PUBLIC_IFC7 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7 __DEF_IMPLHELPER_PRE( 7 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __IFC_WRITEOFFSET( 4 ) __IFC_WRITEOFFSET( 5 ) __IFC_WRITEOFFSET( 6 ) __IFC_WRITEOFFSET( 7 ) __DEF_IMPLHELPER_POST( 7 ) -*/ -namespace cppu -{ - struct ClassData7 : public ClassDataBase - { - Type_Offset arType2Offset[ 7 ]; - ClassData7( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - class SAL_NO_VTABLE ImplHelperBase7 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc4 > *)0 ), - (char *)(Ifc4 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc5 > *)0 ), - (char *)(Ifc5 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc6 > *)0 ), - (char *)(Ifc6 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc7 > *)0 ), - (char *)(Ifc7 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - class SAL_NO_VTABLE ImplHelper7 - : public ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > - { - static ClassData7 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - class SAL_NO_VTABLE WeakImplHelper7 - : public ::cppu::OWeakObject - , public ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > - { - static ClassData7 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - class SAL_NO_VTABLE WeakAggImplHelper7 - : public ::cppu::OWeakAggObject - , public ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > - { - static ClassData7 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - ClassData7 ImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >::s_aCD = ClassData7( 0 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - ClassData7 WeakImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >::s_aCD = ClassData7( 1 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - ClassData7 WeakAggImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >::s_aCD = ClassData7( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT7( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ + __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \ + __IFC_EX_TYPE_INIT( class_cast, 7 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 7 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase8.hxx b/cppuhelper/inc/cppuhelper/implbase8.hxx index d29ac74c5..b6cc62458 100644 --- a/cppuhelper/inc/cppuhelper/implbase8.hxx +++ b/cppuhelper/inc/cppuhelper/implbase8.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase8.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,169 +61,36 @@ #ifndef _CPPUHELPER_IMPLBASE8_HXX_ #define _CPPUHELPER_IMPLBASE8_HXX_ +#define __IFC8 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 +#define __CLASS_IFC8 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 +#define __PUBLIC_IFC8 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 + +#ifdef MACOSX /* use old impl helpers for macosx */ + #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC8 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 -#define __CLASS_IFC8 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 -#define __PUBLIC_IFC8 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 __DEF_IMPLHELPER_PRE( 8 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __IFC_WRITEOFFSET( 4 ) __IFC_WRITEOFFSET( 5 ) __IFC_WRITEOFFSET( 6 ) __IFC_WRITEOFFSET( 7 ) __IFC_WRITEOFFSET( 8 ) __DEF_IMPLHELPER_POST( 8 ) -*/ -namespace cppu -{ - struct ClassData8 : public ClassDataBase - { - Type_Offset arType2Offset[ 8 ]; - ClassData8( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - class SAL_NO_VTABLE ImplHelperBase8 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc4 > *)0 ), - (char *)(Ifc4 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc5 > *)0 ), - (char *)(Ifc5 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc6 > *)0 ), - (char *)(Ifc6 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc7 > *)0 ), - (char *)(Ifc7 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc8 > *)0 ), - (char *)(Ifc8 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - class SAL_NO_VTABLE ImplHelper8 - : public ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > - { - static ClassData8 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - class SAL_NO_VTABLE WeakImplHelper8 - : public ::cppu::OWeakObject - , public ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > - { - static ClassData8 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - class SAL_NO_VTABLE WeakAggImplHelper8 - : public ::cppu::OWeakAggObject - , public ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > - { - static ClassData8 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - ClassData8 ImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >::s_aCD = ClassData8( 0 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - ClassData8 WeakImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >::s_aCD = ClassData8( 1 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - ClassData8 WeakAggImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >::s_aCD = ClassData8( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT8( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ + __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \ + __IFC_EX_TYPE_INIT( class_cast, 7 ), __IFC_EX_TYPE_INIT( class_cast, 8 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 8 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase9.hxx b/cppuhelper/inc/cppuhelper/implbase9.hxx index a1c069d93..d369736b9 100644 --- a/cppuhelper/inc/cppuhelper/implbase9.hxx +++ b/cppuhelper/inc/cppuhelper/implbase9.hxx @@ -2,9 +2,9 @@ * * $RCSfile: implbase9.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dbo $ $Date: 2001-05-21 09:14:50 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,173 +61,38 @@ #ifndef _CPPUHELPER_IMPLBASE9_HXX_ #define _CPPUHELPER_IMPLBASE9_HXX_ +#define __IFC9 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 +#define __CLASS_IFC9 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 +#define __PUBLIC_IFC9 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9 + +#ifdef MACOSX /* use old impl helpers for macosx */ #ifndef _CPPUHELPER_IMPLBASE_HXX_ #include <cppuhelper/implbase.hxx> #endif -/* -#define __IFC9 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 -#define __CLASS_IFC9 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 -#define __PUBLIC_IFC9 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9 __DEF_IMPLHELPER_PRE( 9 ) __IFC_WRITEOFFSET( 1 ) __IFC_WRITEOFFSET( 2 ) __IFC_WRITEOFFSET( 3 ) __IFC_WRITEOFFSET( 4 ) __IFC_WRITEOFFSET( 5 ) __IFC_WRITEOFFSET( 6 ) __IFC_WRITEOFFSET( 7 ) __IFC_WRITEOFFSET( 8 ) __IFC_WRITEOFFSET( 9 ) __DEF_IMPLHELPER_POST( 9 ) -*/ -namespace cppu -{ - struct ClassData9 : public ClassDataBase - { - Type_Offset arType2Offset[ 9 ]; - ClassData9( sal_Int32 nClassCode ) SAL_THROW( () ) - : ClassDataBase( nClassCode ) - {} - }; - /** This template class serves as a base class for all subsequent implementation helper classes. - It inherits from given interfaces (template parameters) and com.sun.star.lang.XTypeProvider. - - Do not use this class directly, use - ImplHelperBaseN<>, - WeakImplHelperN<>, - WeakAggImplHelperN<> - WeakComponentImplHelperN<>, - WeakAggComponentImplHelperN<>. - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - class SAL_NO_VTABLE ImplHelperBase9 - : public ::com::sun::star::lang::XTypeProvider - , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9 - { - protected: - ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) - { - ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); - if (! rCD.bOffsetsInit) - { - ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); - if (! rCD.bOffsetsInit) - { - char * pBase = (char *)this; - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc1 > *)0 ), - (char *)(Ifc1 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc2 > *)0 ), - (char *)(Ifc2 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc3 > *)0 ), - (char *)(Ifc3 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc4 > *)0 ), - (char *)(Ifc4 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc5 > *)0 ), - (char *)(Ifc5 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc6 > *)0 ), - (char *)(Ifc6 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc7 > *)0 ), - (char *)(Ifc7 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc8 > *)0 ), - (char *)(Ifc8 *)this - pBase ); - rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< Ifc9 > *)0 ), - (char *)(Ifc9 *)this - pBase ); - rCD.bOffsetsInit = sal_True; - } - } - return rCD; - } - }; - /** This template class inherits from ImplHelperBaseN<> and implements - com.sun.star.uno.XInterface::queryInterface() and the com.sun.star.lang.XTypeProvider - interface. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::ImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - class SAL_NO_VTABLE ImplHelper9 - : public ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > - { - static ClassData9 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).query( rType, (ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > *)this ); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly, using the - ::cppu::WeakReference<> template class. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - class SAL_NO_VTABLE WeakImplHelper9 - : public ::cppu::OWeakObject - , public ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > - { - static ClassData9 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; - /** This template class inherits from ::cppu::ImplHelperBaseN<> and ::cppu::OWeakAggObject, - thus delegating life-cycle to that implementation. - Use this helper implementing an object, that can be held weakly using the - ::cppu::WeakReference<> template class and can be aggregated by other objects. - - All other virtual functions (inherited from given template parameter interfaces) - have to be implemented by sub-classing from the templated class, e.g. - class MyImpl : public ::cppu::WeakAggImplHelperN<> { ... }; - */ - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - class SAL_NO_VTABLE WeakAggImplHelper9 - : public ::cppu::OWeakAggObject - , public ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > - { - static ClassData9 s_aCD; - public: - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { return OWeakAggObject::queryInterface( rType ); } - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) - { - ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 > *)this ) ); - return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); - } - virtual void SAL_CALL acquire() throw () - { OWeakAggObject::acquire(); } - virtual void SAL_CALL release() throw () - { OWeakAggObject::release(); } - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getTypes(); } - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) - { return getClassData( s_aCD ).getImplementationId(); } - }; +#else /* ! MACOSX */ -#ifndef MACOSX - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - ClassData9 ImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >::s_aCD = ClassData9( 0 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - ClassData9 WeakImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >::s_aCD = ClassData9( 1 ); - template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - ClassData9 WeakAggImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >::s_aCD = ClassData9( 2 ); +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#include <cppuhelper/implbase_ex.hxx> #endif -} +#include <cppuhelper/implbase_ex_pre.hxx> +#define __IFC_EX_TYPE_INIT9( class_cast ) \ + __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ + __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ + __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \ + __IFC_EX_TYPE_INIT( class_cast, 7 ), __IFC_EX_TYPE_INIT( class_cast, 8 ), \ + __IFC_EX_TYPE_INIT( class_cast, 9 ) +#include <cppuhelper/implbase_ex_post.hxx> +__DEF_IMPLHELPER_EX( 9 ) + +#endif /* MACOSX */ #endif diff --git a/cppuhelper/inc/cppuhelper/implbase_ex.hxx b/cppuhelper/inc/cppuhelper/implbase_ex.hxx new file mode 100644 index 000000000..26a0c8c80 --- /dev/null +++ b/cppuhelper/inc/cppuhelper/implbase_ex.hxx @@ -0,0 +1,185 @@ +/************************************************************************* + * + * $RCSfile: implbase_ex.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CPPUHELPER_IMPLBASE_EX_HXX_ +#define _CPPUHELPER_IMPLBASE_EX_HXX_ + +#ifndef _CPPUHELPER_WEAK_HXX_ +#include <cppuhelper/weak.hxx> +#endif +#ifndef _CPPUHELPER_WEAKAGG_HXX_ +#include <cppuhelper/weakagg.hxx> +#endif + +#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_ +#include <com/sun/star/lang/XTypeProvider.hpp> +#endif + + +namespace cppu +{ + +/** function pointer signature for getCppuType +*/ +typedef ::com::sun::star::uno::Type const & (SAL_CALL * fptr_getCppuType)( void * ) SAL_THROW( () ); + +/** single type + object offset +*/ +struct type_entry +{ + /** the type_entry is initialized with function pointer to ::getCppuType() function first, + but holds an unacquired typelib_TypeDescriptionReference * after initialization, + thus reusing the memory. Flag class_data::m_storedTypeRefs + */ + union + { + fptr_getCppuType getCppuType; + typelib_TypeDescriptionReference * typeRef; + } m_type; + sal_Int32 m_offset; +}; + +/** identical dummy struct for casting class_dataN to class_data +*/ +struct class_data +{ + /** number of supported types in m_typeEntries + */ + sal_Int16 m_nTypes; + + /** determines whether m_typeEntries is initialized and carries unacquired type refs + */ + sal_Bool m_storedTypeRefs; + + /** determines whether an implementation id was created in m_id + */ + sal_Bool m_createdId; + + /** implementation id + */ + sal_Int8 m_id[ 16 ]; + + /** type, object offset + */ + type_entry m_typeEntries[ 1 ]; +}; + +/** ImplHelper +*/ +::com::sun::star::uno::Any SAL_CALL ImplHelper_query( + ::com::sun::star::uno::Type const & rType, + class_data * cd, + void * that ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); +/** ImplHelper +*/ +::com::sun::star::uno::Any SAL_CALL ImplHelper_queryNoXInterface( + ::com::sun::star::uno::Type const & rType, + class_data * cd, + void * that ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); +/** ImplHelper +*/ +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL ImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); +/** ImplHelper +*/ +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL ImplInhHelper_getTypes( + class_data * cd, + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > const & rAddTypes ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); +/** ImplHelper +*/ +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL ImplHelper_getImplementationId( + class_data * cd ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); + +/** WeakImplHelper +*/ +::com::sun::star::uno::Any SAL_CALL WeakImplHelper_query( + ::com::sun::star::uno::Type const & rType, + class_data * cd, + void * that, + ::cppu::OWeakObject * pBase ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); +/** WeakImplHelper +*/ +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); + +/** WeakAggImplHelper +*/ +::com::sun::star::uno::Any SAL_CALL WeakAggImplHelper_queryAgg( + ::com::sun::star::uno::Type const & rType, + class_data * cd, + void * that, + ::cppu::OWeakAggObject * pBase ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); +/** WeakAggImplHelper +*/ +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakAggImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (::com::sun::star::uno::RuntimeException) ); + +} + +#endif diff --git a/cppuhelper/inc/cppuhelper/implbase_ex_post.hxx b/cppuhelper/inc/cppuhelper/implbase_ex_post.hxx new file mode 100644 index 000000000..100f63fb1 --- /dev/null +++ b/cppuhelper/inc/cppuhelper/implbase_ex_post.hxx @@ -0,0 +1,262 @@ +/************************************************************************* + * + * $RCSfile: implbase_ex_post.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CPPUHELPER_IMPLBASE_EX_POST_HXX_ +#define _CPPUHELPER_IMPLBASE_EX_POST_HXX_ + + +#define __DEF_CLASS_DATA_INIT_EX( N, class_cast ) \ +{ \ +N +1, sal_False, sal_False, \ +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \ +{ \ +__IFC_EX_TYPE_INIT##N( class_cast ), \ +__IFC_EX_TYPE_INIT_NAME( class_cast, ::com::sun::star::lang::XTypeProvider ) \ +} \ +} + +#define __DEF_IMPLHELPER_EX( N ) \ +namespace cppu \ +{ \ +struct class_data##N \ +{ \ + sal_Int16 m_nTypes; \ + sal_Bool m_storedTypeRefs; \ + sal_Bool m_storedId; \ + sal_Int8 m_id[ 16 ]; \ + type_entry m_typeEntries[ N + 1 ]; \ +}; \ +template< __CLASS_IFC##N > \ +class SAL_NO_VTABLE ImplHelper##N \ + : public ::com::sun::star::lang::XTypeProvider \ + , __PUBLIC_IFC##N \ +{ \ + static class_data##N s_cd; \ +public: \ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { return ImplHelper_query( rType, (class_data *)&s_cd, this ); } \ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplHelper_getTypes( (class_data *)&s_cd ); } \ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \ +}; \ +template< __CLASS_IFC##N > \ +class_data##N ImplHelper##N< __IFC##N >::s_cd = \ +__DEF_CLASS_DATA_INIT_EX( N, (ImplHelper##N< __IFC##N > *) ); \ +template< __CLASS_IFC##N > \ +class SAL_NO_VTABLE WeakImplHelper##N \ + : public OWeakObject \ + , public ::com::sun::star::lang::XTypeProvider \ + , __PUBLIC_IFC##N \ +{ \ + static class_data##N s_cd; \ +public: \ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { return WeakImplHelper_query( rType, (class_data *)&s_cd, this, (OWeakObject *)this ); } \ + virtual void SAL_CALL acquire() throw () \ + { OWeakObject::acquire(); } \ + virtual void SAL_CALL release() throw () \ + { OWeakObject::release(); } \ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \ + { return WeakImplHelper_getTypes( (class_data *)&s_cd ); } \ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \ +}; \ +template< __CLASS_IFC##N > \ +class_data##N WeakImplHelper##N< __IFC##N >::s_cd = \ +__DEF_CLASS_DATA_INIT_EX( N, (WeakImplHelper##N< __IFC##N > *) ); \ +template< __CLASS_IFC##N > \ +class SAL_NO_VTABLE WeakAggImplHelper##N \ + : public OWeakAggObject \ + , public ::com::sun::star::lang::XTypeProvider \ + , __PUBLIC_IFC##N \ +{ \ + static class_data##N s_cd; \ +public: \ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { return OWeakAggObject::queryInterface( rType ); } \ + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { return WeakAggImplHelper_queryAgg( rType, (class_data *)&s_cd, this, (OWeakAggObject *)this ); } \ + virtual void SAL_CALL acquire() throw () \ + { OWeakAggObject::acquire(); } \ + virtual void SAL_CALL release() throw () \ + { OWeakAggObject::release(); } \ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \ + { return WeakAggImplHelper_getTypes( (class_data *)&s_cd ); } \ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \ +}; \ +template< __CLASS_IFC##N > \ +class_data##N WeakAggImplHelper##N< __IFC##N >::s_cd = \ +__DEF_CLASS_DATA_INIT_EX( N, (WeakAggImplHelper##N< __IFC##N > *) ); \ +template< class BaseClass, __CLASS_IFC##N > \ +class SAL_NO_VTABLE ImplInheritanceHelper##N \ + : public BaseClass \ + , __PUBLIC_IFC##N \ +{ \ + static class_data##N s_cd; \ +public: \ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { \ + ::com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, (class_data *)&s_cd, this ) ); \ + if (aRet.hasValue()) \ + return aRet; \ + return BaseClass::queryInterface( rType ); \ + } \ + virtual void SAL_CALL acquire() throw () \ + { BaseClass::acquire(); } \ + virtual void SAL_CALL release() throw () \ + { BaseClass::release(); } \ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplInhHelper_getTypes( (class_data *)&s_cd, BaseClass::getTypes() ); } \ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \ +}; \ +template< class BaseClass, __CLASS_IFC##N > \ +class_data##N ImplInheritanceHelper##N< BaseClass, __IFC##N >::s_cd = \ +__DEF_CLASS_DATA_INIT_EX( N, (ImplInheritanceHelper##N< BaseClass, __IFC##N > *) ); \ +template< class BaseClass, __CLASS_IFC##N > \ +class SAL_NO_VTABLE AggImplInheritanceHelper##N \ + : public BaseClass \ + , __PUBLIC_IFC##N \ +{ \ + static class_data##N s_cd; \ +public: \ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { return BaseClass::queryInterface( rType ); } \ + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { \ + ::com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, (class_data *)&s_cd, this ) ); \ + if (aRet.hasValue()) \ + return aRet; \ + return BaseClass::queryAggregation( rType ); \ + } \ + virtual void SAL_CALL acquire() throw () \ + { BaseClass::acquire(); } \ + virtual void SAL_CALL release() throw () \ + { BaseClass::release(); } \ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplInhHelper_getTypes( (class_data *)&s_cd, BaseClass::getTypes() ); } \ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \ +}; \ +template< class BaseClass, __CLASS_IFC##N > \ +class_data##N AggImplInheritanceHelper##N< BaseClass, __IFC##N >::s_cd = \ +__DEF_CLASS_DATA_INIT_EX( N, (AggImplInheritanceHelper##N< BaseClass, __IFC##N > *) ); \ +} + +#define __DEF_COMPIMPLHELPER_EX( N ) \ +namespace cppu \ +{ \ +template< __CLASS_IFC##N > \ +class SAL_NO_VTABLE WeakComponentImplHelper##N \ + : public WeakComponentImplHelperBase \ + , public ::com::sun::star::lang::XTypeProvider \ + , __PUBLIC_IFC##N \ +{ \ + static class_data##N s_cd; \ +public: \ + inline WeakComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW( () ) \ + : WeakComponentImplHelperBase( rMutex ) \ + {} \ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { return WeakComponentImplHelper_query( rType, (class_data *)&s_cd, this, (WeakComponentImplHelperBase *)this ); } \ + virtual void SAL_CALL acquire() throw () \ + { WeakComponentImplHelperBase::acquire(); } \ + virtual void SAL_CALL release() throw () \ + { WeakComponentImplHelperBase::release(); } \ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \ + { return WeakComponentImplHelper_getTypes( (class_data *)&s_cd ); } \ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \ +}; \ +template< __CLASS_IFC##N > \ +class_data##N WeakComponentImplHelper##N< __IFC##N >::s_cd = \ +__DEF_CLASS_DATA_INIT_EX( N, (WeakComponentImplHelper##N< __IFC##N > *) ); \ +template< __CLASS_IFC##N > \ +class SAL_NO_VTABLE WeakAggComponentImplHelper##N \ + : public WeakAggComponentImplHelperBase \ + , public ::com::sun::star::lang::XTypeProvider \ + , __PUBLIC_IFC##N \ +{ \ + static class_data##N s_cd; \ +public: \ + inline WeakAggComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW( () ) \ + : WeakAggComponentImplHelperBase( rMutex ) \ + {} \ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { return WeakAggComponentImplHelperBase::queryInterface( rType ); } \ + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \ + { return WeakAggComponentImplHelper_queryAgg( rType, (class_data *)&s_cd, this, (WeakAggComponentImplHelperBase *)this ); } \ + virtual void SAL_CALL acquire() throw () \ + { WeakAggComponentImplHelperBase::acquire(); } \ + virtual void SAL_CALL release() throw () \ + { WeakAggComponentImplHelperBase::release(); } \ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \ + { return WeakAggComponentImplHelper_getTypes( (class_data *)&s_cd ); } \ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \ + { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \ +}; \ +template< __CLASS_IFC##N > \ +class_data##N WeakAggComponentImplHelper##N< __IFC##N >::s_cd = \ +__DEF_CLASS_DATA_INIT_EX( N, (WeakAggComponentImplHelper##N< __IFC##N > *) ); \ +} + +#endif diff --git a/cppuhelper/inc/cppuhelper/implbase_ex_pre.hxx b/cppuhelper/inc/cppuhelper/implbase_ex_pre.hxx new file mode 100644 index 000000000..c71875587 --- /dev/null +++ b/cppuhelper/inc/cppuhelper/implbase_ex_pre.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * $RCSfile: implbase_ex_pre.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CPPUHELPER_IMPLBASE_EX_PRE_HXX_ +#define _CPPUHELPER_IMPLBASE_EX_PRE_HXX_ + +#define __IFC_EX_TYPE_INIT_NAME( class_cast, ifc_name ) \ +{ (::cppu::fptr_getCppuType)(::com::sun::star::uno::Type const & (SAL_CALL *)( ::com::sun::star::uno::Reference< ifc_name > const * ))&getCppuType, \ +((sal_Int32)(ifc_name *) class_cast 16) - 16 } + +#define __IFC_EX_TYPE_INIT( class_cast, N ) __IFC_EX_TYPE_INIT_NAME( class_cast, Ifc##N ) + +#endif diff --git a/cppuhelper/prj/d.lst b/cppuhelper/prj/d.lst index d11dfd9ca..38f954c03 100644 --- a/cppuhelper/prj/d.lst +++ b/cppuhelper/prj/d.lst @@ -1,6 +1,9 @@ mkdir: %_DEST%\inc%_EXT%\cppuhelper ..\inc\cppuhelper\implbase.hxx %_DEST%\inc%_EXT%\cppuhelper\implbase.hxx +..\inc\cppuhelper\implbase_ex.hxx %_DEST%\inc%_EXT%\cppuhelper\implbase_ex.hxx +..\inc\cppuhelper\implbase_ex_pre.hxx %_DEST%\inc%_EXT%\cppuhelper\implbase_ex_pre.hxx +..\inc\cppuhelper\implbase_ex_post.hxx %_DEST%\inc%_EXT%\cppuhelper\implbase_ex_post.hxx ..\inc\cppuhelper\implbase1.hxx %_DEST%\inc%_EXT%\cppuhelper\implbase1.hxx ..\inc\cppuhelper\implbase2.hxx %_DEST%\inc%_EXT%\cppuhelper\implbase2.hxx ..\inc\cppuhelper\implbase3.hxx %_DEST%\inc%_EXT%\cppuhelper\implbase3.hxx @@ -15,6 +18,7 @@ mkdir: %_DEST%\inc%_EXT%\cppuhelper ..\inc\cppuhelper\implbase12.hxx %_DEST%\inc%_EXT%\cppuhelper\implbase12.hxx ..\inc\cppuhelper\compbase.hxx %_DEST%\inc%_EXT%\cppuhelper\compbase.hxx +..\inc\cppuhelper\compbase_ex.hxx %_DEST%\inc%_EXT%\cppuhelper\compbase_ex.hxx ..\inc\cppuhelper\compbase1.hxx %_DEST%\inc%_EXT%\cppuhelper\compbase1.hxx ..\inc\cppuhelper\compbase2.hxx %_DEST%\inc%_EXT%\cppuhelper\compbase2.hxx ..\inc\cppuhelper\compbase3.hxx %_DEST%\inc%_EXT%\cppuhelper\compbase3.hxx diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map index 0f05e4fcc..46f0247e3 100755 --- a/cppuhelper/source/cc5_solaris_sparc.map +++ b/cppuhelper/source/cc5_solaris_sparc.map @@ -231,6 +231,19 @@ __1cDcomDsunEstarIregistrycG__RTTI__1nDcomDsunEstarIregistryYInvalidRegistryExce __1cDcomDsunEstarIregistrycU__RTTI__1nDcomDsunEstarIregistrybLCannotRegisterImplementationException__; __1cEcppuZcomponent_writeInfoHelper6Fpv1pkn0ATImplementationEntry__C_; __1cEcppubAcomponent_getFactoryHelper6Fpkcpv3pkn0ATImplementationEntry__3_; +__1cEcppuQImplHelper_query6FrknDcomDsunEstarDunoEType_pn0AKclass_data_pv_n0EDAny__; +__1cEcppuUWeakImplHelper_query6FrknDcomDsunEstarDunoEType_pn0AKclass_data_pvpn0ALOWeakObject__n0EDAny__; +__1cEcppubAWeakAggImplHelper_queryAgg6FrknDcomDsunEstarDunoEType_pn0AKclass_data_pvpn0AOOWeakAggObject__n0EDAny__; +__1cEcppubCImplHelper_queryNoXInterface6FrknDcomDsunEstarDunoEType_pn0AKclass_data_pv_n0EDAny__; +__1cEcppubDWeakComponentImplHelper_query6FrknDcomDsunEstarDunoEType_pn0AKclass_data_pvpn0AbBWeakComponentImplHelperBase__n0EDAny__; +__1cEcppubJWeakAggComponentImplHelper_queryAgg6FrknDcomDsunEstarDunoEType_pn0AKclass_data_pvpn0AbEWeakAggComponentImplHelperBase__n0EDAny__; +__1cEcppuTImplHelper_getTypes6Fpn0AKclass_data__nDcomDsunEstarDunoISequence4n0FEType____; +__1cEcppuWImplInhHelper_getTypes6Fpn0AKclass_data_rknDcomDsunEstarDunoISequence4n0FEType____7_; +__1cEcppuXWeakImplHelper_getTypes6Fpn0AKclass_data__nDcomDsunEstarDunoISequence4n0FEType____; +__1cEcppubAWeakAggImplHelper_getTypes6Fpn0AKclass_data__nDcomDsunEstarDunoISequence4n0FEType____; +__1cEcppubGWeakComponentImplHelper_getTypes6Fpn0AKclass_data__nDcomDsunEstarDunoISequence4n0FEType____; +__1cEcppubJWeakAggComponentImplHelper_getTypes6Fpn0AKclass_data__nDcomDsunEstarDunoISequence4n0FEType____; +__1cEcppubEImplHelper_getImplementationId6Fpn0AKclass_data__nDcomDsunEstarDunoISequence4CW___; __1cEcppubOdefaultBootstrap_InitialComponentContext6FrknDrtlIOUString__nDcomDsunEstarDunoJReference4n0GRXComponentContext____; local: *; diff --git a/cppuhelper/source/implbase_ex.cxx b/cppuhelper/source/implbase_ex.cxx new file mode 100644 index 000000000..7fc8e5eb2 --- /dev/null +++ b/cppuhelper/source/implbase_ex.cxx @@ -0,0 +1,451 @@ +/************************************************************************* + * + * $RCSfile: implbase_ex.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:09 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifdef SOLARIS +#include <alloca.h> +#elif defined MACOSX +#include <sys/malloc.h> +#else +#include <malloc.h> +#endif +#include <memory.h> + +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif + +#ifndef _RTL_BYTESEQ_HXX_ +#include <rtl/byteseq.hxx> +#endif +#ifndef _RTL_USTRBUF_HXX_ +#include <rtl/ustrbuf.hxx> +#endif +#ifndef _RTL_UUID_H_ +#include <rtl/uuid.h> +#endif + +#ifndef _CPPUHELPER_COMPBASE_EX_HXX_ +#include <cppuhelper/compbase_ex.hxx> +#endif + + +using namespace ::cppu; +using namespace ::osl; +using namespace ::rtl; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; + +namespace cppu +{ + +/** Shared mutex for implementation helper initialization. + Not for public use. +*/ +::osl::Mutex & SAL_CALL getImplHelperInitMutex(void) SAL_THROW( () ); + +//-------------------------------------------------------------------------------------------------- +static inline bool isXInterface( rtl_uString * pStr ) SAL_THROW( () ) +{ + return (((OUString const *)&pStr)->equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.uno.XInterface") ) != sal_False); +} +//-------------------------------------------------------------------------------------------------- +static inline void * makeInterface( sal_Int32 nOffset, void * that ) SAL_THROW( () ) +{ + return (((char *)that) + nOffset); +} +//-------------------------------------------------------------------------------------------------- +static inline bool __td_equals( + typelib_TypeDescriptionReference * pTDR1, typelib_TypeDescriptionReference * pTDR2 ) + SAL_THROW( () ) +{ + return ((pTDR1 == pTDR2) || + ((OUString const *)&pTDR1->pTypeName)->equals( *(OUString const *)&pTDR2->pTypeName ) != sal_False); +} +//-------------------------------------------------------------------------------------------------- +static inline type_entry * __getTypeEntries( class_data * cd ) + SAL_THROW( (RuntimeException) ) +{ + type_entry * pEntries = cd->m_typeEntries; + if (! cd->m_storedTypeRefs) // not inited? + { + MutexGuard guard( getImplHelperInitMutex() ); + if (! cd->m_storedTypeRefs) // not inited? + { + // get all types + for ( sal_Int32 n = cd->m_nTypes; n--; ) + { + type_entry * pEntry = &pEntries[ n ]; + Type const & rType = (*pEntry->m_type.getCppuType)( 0 ); + OSL_ENSURE( rType.getTypeClass() == TypeClass_INTERFACE, "### wrong helper init: expected interface!" ); + if (rType.getTypeClass() != TypeClass_INTERFACE) + { + OUStringBuffer buf( 48 ); + buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("type \"") ); + buf.append( rType.getTypeName() ); + buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" is no interface type!") ); + OUString msg( buf.makeStringAndClear() ); +#ifdef _DEBUG + OString str( OUStringToOString( msg, RTL_TEXTENCODING_ASCII_US ) ); + OSL_ENSURE( 0, str.getStr() ); +#endif + throw RuntimeException( msg, Reference< XInterface >() ); + } + // ref is statically held by getCppuType() + pEntry->m_type.typeRef = rType.getTypeLibType(); + } + cd->m_storedTypeRefs = sal_True; + } + } + return pEntries; +} +//-------------------------------------------------------------------------------------------------- +static inline void __fillTypes( Type * types, class_data * cd ) + SAL_THROW( (RuntimeException) ) +{ + type_entry * pEntries = __getTypeEntries( cd ); + for ( sal_Int32 n = cd->m_nTypes; n--; ) + { + types[ n ] = pEntries[ n ].m_type.typeRef; + } +} +//-------------------------------------------------------------------------------------------------- +static inline void * __queryDeepNoXInterface( + typelib_TypeDescriptionReference * pDemandedTDR, class_data * cd, void * that ) + SAL_THROW( (RuntimeException) ) +{ + type_entry * pEntries = __getTypeEntries( cd ); + sal_Int32 nTypes = cd->m_nTypes; + for ( sal_Int32 n = 0; n < nTypes; ++n ) + { + typelib_TypeDescriptionReference * pTDR = pEntries[ n ].m_type.typeRef; + if (__td_equals( pTDR, pDemandedTDR )) // try top interface without getting td + { + return makeInterface( pEntries[ n ].m_offset, that ); + } + else + { + typelib_TypeDescription * pTD = 0; + TYPELIB_DANGER_GET( &pTD, pTDR ); + if (pTD) + { + // exclude top (already tested) and bottom (XInterface) interface + typelib_InterfaceTypeDescription * pITD = + ((typelib_InterfaceTypeDescription *)pTD)->pBaseTypeDescription; + while (pITD && pITD->pBaseTypeDescription) + { + if (__td_equals( (typelib_TypeDescriptionReference *)pITD, pDemandedTDR )) + { + return makeInterface( pEntries[ n ].m_offset, that ); + } + pITD = pITD->pBaseTypeDescription; + } + + TYPELIB_DANGER_RELEASE( pTD ); + } + else + { + OUStringBuffer buf( 64 ); + buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("cannot get type description for type \"") ); + buf.append( pTDR->pTypeName ); + buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") ); + OUString msg( buf.makeStringAndClear() ); +#ifdef _DEBUG + OString str( OUStringToOString( msg, RTL_TEXTENCODING_ASCII_US ) ); + OSL_ENSURE( 0, str.getStr() ); +#endif + throw RuntimeException( msg, Reference< XInterface >() ); + } + } + } + return 0; +} + +// ImplHelper +//================================================================================================== +Any SAL_CALL ImplHelper_query( + Type const & rType, class_data * cd, void * that ) + SAL_THROW( (RuntimeException) ) +{ + OSL_ENSURE( rType.getTypeClass() == TypeClass_INTERFACE, "### not querying for interface!" ); + typelib_TypeDescriptionReference * pTDR = rType.getTypeLibType(); + + void * p; + // shortcut for XInterface + if (isXInterface( pTDR->pTypeName )) + { + // take first one + p = makeInterface( cd->m_typeEntries[ 0 ].m_offset, that ); + } + else + { + p = __queryDeepNoXInterface( pTDR, cd, that ); + if (! p) + { + return Any(); + } + } + return Any( &p, pTDR ); +} +//================================================================================================== +Any SAL_CALL ImplHelper_queryNoXInterface( + Type const & rType, class_data * cd, void * that ) + SAL_THROW( (RuntimeException) ) +{ + OSL_ENSURE( rType.getTypeClass() == TypeClass_INTERFACE, "### not querying for interface!" ); + typelib_TypeDescriptionReference * pTDR = rType.getTypeLibType(); + + void * p = __queryDeepNoXInterface( pTDR, cd, that ); + if (p) + { + return Any( &p, pTDR ); + } + else + { + return Any(); + } +} +//================================================================================================== +Sequence< sal_Int8 > SAL_CALL ImplHelper_getImplementationId( class_data * cd ) + SAL_THROW( (RuntimeException) ) +{ + if (! cd->m_createdId) + { + sal_uInt8 * id = (sal_uInt8 *)alloca( 16 ); + ::rtl_createUuid( (sal_uInt8 *)id, 0, sal_True ); + + MutexGuard guard( getImplHelperInitMutex() ); + if (! cd->m_createdId) + { + memcpy( cd->m_id, id, 16 ); + cd->m_createdId = sal_True; + } + } + + sal_Sequence * seq = 0; + ::rtl_byte_sequence_constructFromArray( &seq, cd->m_id, 16 ); + return Sequence< sal_Int8 >( seq, SAL_NO_ACQUIRE ); +} +//================================================================================================== +Sequence< Type > SAL_CALL ImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (RuntimeException) ) +{ + Sequence< Type > types( cd->m_nTypes ); + Type * pTypes = types.getArray(); + __fillTypes( pTypes, cd ); + return types; +} +//================================================================================================== +Sequence< Type > SAL_CALL ImplInhHelper_getTypes( + class_data * cd, Sequence< Type > const & rAddTypes ) + SAL_THROW( (RuntimeException) ) +{ + sal_Int32 nImplTypes = cd->m_nTypes; + sal_Int32 nAddTypes = rAddTypes.getLength(); + Sequence< Type > types( nImplTypes + nAddTypes ); + Type * pTypes = types.getArray(); + __fillTypes( pTypes, cd ); + // append base types + Type const * pAddTypes = rAddTypes.getConstArray(); + while (nAddTypes--) + { + pTypes[ nImplTypes + nAddTypes ] = pAddTypes[ nAddTypes ]; + } + return types; +} + +// WeakImplHelper +//================================================================================================== +Any SAL_CALL WeakImplHelper_query( + Type const & rType, class_data * cd, void * that, OWeakObject * pBase ) + SAL_THROW( (RuntimeException) ) +{ + OSL_ENSURE( rType.getTypeClass() == TypeClass_INTERFACE, "### not querying for interface!" ); + typelib_TypeDescriptionReference * pTDR = rType.getTypeLibType(); + + // shortcut XInterface to OWeakObject + if (! isXInterface( pTDR->pTypeName )) + { + void * p = __queryDeepNoXInterface( pTDR, cd, that ); + if (p) + { + return Any( &p, pTDR ); + } + } + return pBase->OWeakObject::queryInterface( rType ); +} +//================================================================================================== +Sequence< Type > SAL_CALL WeakImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (RuntimeException) ) +{ + sal_Int32 nTypes = cd->m_nTypes; + Sequence< Type > types( nTypes +1 ); + Type * pTypes = types.getArray(); + __fillTypes( pTypes, cd ); + pTypes[ nTypes ] = ::getCppuType( (Reference< XWeak > const *)0 ); + return types; +} + +// WeakAggImplHelper +//================================================================================================== +Any SAL_CALL WeakAggImplHelper_queryAgg( + Type const & rType, class_data * cd, void * that, OWeakAggObject * pBase ) + SAL_THROW( (RuntimeException) ) +{ + OSL_ENSURE( rType.getTypeClass() == TypeClass_INTERFACE, "### not querying for interface!" ); + typelib_TypeDescriptionReference * pTDR = rType.getTypeLibType(); + + // shortcut XInterface to OWeakAggObject + if (! isXInterface( pTDR->pTypeName )) + { + void * p = __queryDeepNoXInterface( pTDR, cd, that ); + if (p) + { + return Any( &p, pTDR ); + } + } + return pBase->OWeakAggObject::queryAggregation( rType ); +} +//================================================================================================== +Sequence< Type > SAL_CALL WeakAggImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (RuntimeException) ) +{ + sal_Int32 nTypes = cd->m_nTypes; + Sequence< Type > types( nTypes +2 ); + Type * pTypes = types.getArray(); + __fillTypes( pTypes, cd ); + pTypes[ nTypes++ ] = ::getCppuType( (Reference< XWeak > const *)0 ); + pTypes[ nTypes ] = ::getCppuType( (const Reference< XAggregation > *)0 ); + return types; +} + +// WeakComponentImplHelper +//================================================================================================== +Any SAL_CALL WeakComponentImplHelper_query( + Type const & rType, class_data * cd, void * that, WeakComponentImplHelperBase * pBase ) + SAL_THROW( (RuntimeException) ) +{ + OSL_ENSURE( rType.getTypeClass() == TypeClass_INTERFACE, "### not querying for interface!" ); + typelib_TypeDescriptionReference * pTDR = rType.getTypeLibType(); + + // shortcut XInterface to WeakComponentImplHelperBase + if (! isXInterface( pTDR->pTypeName )) + { + void * p = __queryDeepNoXInterface( pTDR, cd, that ); + if (p) + { + return Any( &p, pTDR ); + } + } + return pBase->WeakComponentImplHelperBase::queryInterface( rType ); +} +//================================================================================================== +Sequence< Type > SAL_CALL WeakComponentImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (RuntimeException) ) +{ + sal_Int32 nTypes = cd->m_nTypes; + Sequence< Type > types( nTypes +2 ); + Type * pTypes = types.getArray(); + __fillTypes( pTypes, cd ); + pTypes[ nTypes++ ] = ::getCppuType( (Reference< XWeak > const *)0 ); + pTypes[ nTypes ] = ::getCppuType( (Reference< lang::XComponent > const *)0 ); + return types; +} + +// WeakAggComponentImplHelper +//================================================================================================== +Any SAL_CALL WeakAggComponentImplHelper_queryAgg( + Type const & rType, class_data * cd, void * that, WeakAggComponentImplHelperBase * pBase ) + SAL_THROW( (RuntimeException) ) +{ + OSL_ENSURE( rType.getTypeClass() == TypeClass_INTERFACE, "### not querying for interface!" ); + typelib_TypeDescriptionReference * pTDR = rType.getTypeLibType(); + + // shortcut XInterface to WeakAggComponentImplHelperBase + if (! isXInterface( pTDR->pTypeName )) + { + void * p = __queryDeepNoXInterface( pTDR, cd, that ); + if (p) + { + return Any( &p, pTDR ); + } + } + return pBase->WeakAggComponentImplHelperBase::queryAggregation( rType ); +} +//================================================================================================== +Sequence< Type > SAL_CALL WeakAggComponentImplHelper_getTypes( + class_data * cd ) + SAL_THROW( (RuntimeException) ) +{ + sal_Int32 nTypes = cd->m_nTypes; + Sequence< Type > types( nTypes +3 ); + Type * pTypes = types.getArray(); + __fillTypes( pTypes, cd ); + pTypes[ nTypes++ ] = ::getCppuType( (Reference< XWeak > const *)0 ); + pTypes[ nTypes++ ] = ::getCppuType( (const Reference< XAggregation > *)0 ); + pTypes[ nTypes ] = ::getCppuType( (const Reference< lang::XComponent > *)0 ); + return types; +} + +} diff --git a/cppuhelper/source/makefile.mk b/cppuhelper/source/makefile.mk index c9c84a8fa..2edd6491f 100644 --- a/cppuhelper/source/makefile.mk +++ b/cppuhelper/source/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.16 $ +# $Revision: 1.17 $ # -# last change: $Author: jbu $ $Date: 2001-06-22 16:03:49 $ +# last change: $Author: dbo $ $Date: 2001-09-04 09:03:09 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -131,6 +131,7 @@ SLOFILES= \ $(SLO)$/exc_thrower.obj \ $(SLO)$/servicefactory.obj \ $(SLO)$/implbase.obj \ + $(SLO)$/implbase_ex.obj \ $(SLO)$/propshlp.obj \ $(SLO)$/weak.obj \ $(SLO)$/interfacecontainer.obj \ @@ -160,7 +161,8 @@ SHL1VERSIONMAP=msvc_win32_intel.map .ELIF "$(OS)$(CPU)$(COM)"=="SOLARISSC52" SHL1VERSIONMAP=cc5_solaris_sparc.map .ELIF "$(OS)$(CPU)$(COM)"=="SOLARISIC52" -SHL1VERSIONMAP=cc5_solaris_intel.map +# use same map for cc solaris +SHL1VERSIONMAP=cc5_solaris_sparc.map .ELIF "$(OS)$(CPU)$(COM)"=="LINUXIGCC" SHL1VERSIONMAP=gcc2_linux_intel.map .ENDIF diff --git a/cppuhelper/source/msvc_win32_intel.map b/cppuhelper/source/msvc_win32_intel.map index 344ef950b..b6b41c68b 100644 --- a/cppuhelper/source/msvc_win32_intel.map +++ b/cppuhelper/source/msvc_win32_intel.map @@ -178,6 +178,19 @@ component_getDescriptionFunc ?addListener@?$OBroadcastHelperVar@VOMultiTypeInterfaceContainerHelper@cppu@@VType@uno@star@sun@com@@@cppu@@QAEXABVType@uno@star@sun@com@@ABV?$Reference@VXInterface@uno@star@sun@com@@@4567@@Z ?component_writeInfoHelper@cppu@@YAEPAX0QBUImplementationEntry@1@@Z ?component_getFactoryHelper@cppu@@YAPAXPBDPAX1QBUImplementationEntry@1@@Z +?ImplHelper_query@cppu@@YA?AVAny@uno@star@sun@com@@ABVType@3456@PAUclass_data@1@PAX@Z +?ImplHelper_queryNoXInterface@cppu@@YA?AVAny@uno@star@sun@com@@ABVType@3456@PAUclass_data@1@PAX@Z +?ImplHelper_getTypes@cppu@@YA?AV?$Sequence@VType@uno@star@sun@com@@@uno@star@sun@com@@PAUclass_data@1@@Z +?ImplInhHelper_getTypes@cppu@@YA?AV?$Sequence@VType@uno@star@sun@com@@@uno@star@sun@com@@PAUclass_data@1@ABV23456@@Z +?ImplHelper_getImplementationId@cppu@@YA?AV?$Sequence@C@uno@star@sun@com@@PAUclass_data@1@@Z +?WeakImplHelper_query@cppu@@YA?AVAny@uno@star@sun@com@@ABVType@3456@PAUclass_data@1@PAXPAVOWeakObject@1@@Z +?WeakImplHelper_getTypes@cppu@@YA?AV?$Sequence@VType@uno@star@sun@com@@@uno@star@sun@com@@PAUclass_data@1@@Z +?WeakAggImplHelper_queryAgg@cppu@@YA?AVAny@uno@star@sun@com@@ABVType@3456@PAUclass_data@1@PAXPAVOWeakAggObject@1@@Z +?WeakAggComponentImplHelper_getTypes@cppu@@YA?AV?$Sequence@VType@uno@star@sun@com@@@uno@star@sun@com@@PAUclass_data@1@@Z +?WeakComponentImplHelper_query@cppu@@YA?AVAny@uno@star@sun@com@@ABVType@3456@PAUclass_data@1@PAXPAVWeakComponentImplHelperBase@1@@Z +?WeakAggImplHelper_getTypes@cppu@@YA?AV?$Sequence@VType@uno@star@sun@com@@@uno@star@sun@com@@PAUclass_data@1@@Z +?WeakAggComponentImplHelper_queryAgg@cppu@@YA?AVAny@uno@star@sun@com@@ABVType@3456@PAUclass_data@1@PAXPAVWeakAggComponentImplHelperBase@1@@Z +?WeakComponentImplHelper_getTypes@cppu@@YA?AV?$Sequence@VType@uno@star@sun@com@@@uno@star@sun@com@@PAUclass_data@1@@Z ?defaultBootstrap_InitialComponentContext@cppu@@YA?AV?$Reference@VXComponentContext@uno@star@sun@com@@@uno@star@sun@com@@ABVOUString@rtl@@@Z local: *; diff --git a/cppuhelper/test/testimplhelper.cxx b/cppuhelper/test/testimplhelper.cxx index fb6780716..f8ce09d4f 100644 --- a/cppuhelper/test/testimplhelper.cxx +++ b/cppuhelper/test/testimplhelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: testimplhelper.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dbo $ $Date: 2001-08-31 09:12:21 $ + * last change: $Author: dbo $ $Date: 2001-09-04 09:03:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,6 +59,8 @@ * ************************************************************************/ +#include <stdio.h> + #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase3.hxx> @@ -107,8 +109,8 @@ using namespace test; using namespace rtl; using namespace osl; using namespace cppu; +using namespace com::sun::star; using namespace com::sun::star::uno; -using namespace com::sun::star::lang; //================================================================================================== struct TestImpl : public ImplHelper4< CA, DBA, FE, G > @@ -322,6 +324,21 @@ static bool isIn( Sequence< Type > const & rTypes, char const * name ) //================================================================================================== static void dotest( const Reference< XInterface > & xOriginal ) { + Reference< lang::XTypeProvider > xTP( xOriginal, UNO_QUERY ); + Sequence< sal_Int8 > id( xTP->getImplementationId() ); + Sequence< Type > types( xTP->getTypes() ); + ::fprintf( stderr, "> supported types: " ); + long n = 0; + for ( ; n < types.getLength(); ++n ) + { + OString str( OUStringToOString( types[ n ].getTypeName(), RTL_TEXTENCODING_ASCII_US ) ); + ::fprintf( stderr, (n < (types.getLength()-1)) ? "%s, " : "%s; type-id=\n", str.getStr() ); + } + for ( n = 0; n < 16; ++n ) + { + ::fprintf( stderr, n < 15 ? "%x " : "%x \n", id[ n ] ); + } + Reference< A > xa( xOriginal, UNO_QUERY ); OSL_ENSURE( xa->a().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("a") ), "### A failed!" ); Reference< BA > xba( xa, UNO_QUERY ); @@ -343,7 +360,7 @@ static void dotest( const Reference< XInterface > & xOriginal ) OSL_ENSURE( xg->a().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("a") ), "### G failed!" ); // type provider - Reference< XTypeProvider > xProv( xg, UNO_QUERY ); + Reference< lang::XTypeProvider > xProv( xg, UNO_QUERY ); Sequence< Type > aTypes( xProv->getTypes() ); // CA, DBA, FE, G, XTypeProvider @@ -358,7 +375,7 @@ static void dotest( const Reference< XInterface > & xOriginal ) { OSL_ASSERT( isIn( aTypes, "com.sun.star.uno.XWeak") ); } - Reference< XComponent > xComp( xg, UNO_QUERY ); + Reference< lang::XComponent > xComp( xg, UNO_QUERY ); if (xComp.is()) { OSL_ASSERT( isIn( aTypes, "com.sun.star.lang.XComponent") ); @@ -384,20 +401,40 @@ static void dotest( const Reference< XInterface > & xOriginal ) } //================================================================================================== -void test_ImplHelper( const Reference< XMultiServiceFactory > & xSF ) +void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & xSF ) { - Reference< XInterface > xImpl( (XTypeProvider *)new TestImpl() ); + Reference< XInterface > xImpl( (lang::XTypeProvider *)new TestImpl() ); + Reference< lang::XTypeProvider > xTP1( xImpl, UNO_QUERY ); Reference< XInterface > xWeakImpl( (OWeakObject *)new TestWeakImpl() ); + Reference< lang::XTypeProvider > xTP2( xWeakImpl, UNO_QUERY ); Reference< XInterface > xWeakAggImpl( (OWeakObject *)new TestWeakAggImpl() ); + Reference< lang::XTypeProvider > xTP3( xWeakAggImpl, UNO_QUERY ); Reference< XInterface > xWeakComponentImpl( (OWeakObject *)new TestWeakComponentImpl() ); + Reference< lang::XTypeProvider > xTP4( xWeakComponentImpl, UNO_QUERY ); Reference< XInterface > xWeakAggComponentImpl( (OWeakObject *)new TestWeakAggComponentImpl() ); + Reference< lang::XTypeProvider > xTP5( xWeakAggComponentImpl, UNO_QUERY ); + // + OSL_ASSERT( + xTP1->getImplementationId() != xTP2->getImplementationId() && + xTP1->getImplementationId() != xTP3->getImplementationId() && + xTP1->getImplementationId() != xTP4->getImplementationId() && + xTP1->getImplementationId() != xTP5->getImplementationId() && + xTP2->getImplementationId() != xTP3->getImplementationId() && + xTP2->getImplementationId() != xTP4->getImplementationId() && + xTP2->getImplementationId() != xTP5->getImplementationId() && + xTP3->getImplementationId() != xTP4->getImplementationId() && + xTP3->getImplementationId() != xTP5->getImplementationId() && + xTP4->getImplementationId() != xTP5->getImplementationId() ); + // + dotest( xImpl ); dotest( xWeakImpl ); dotest( xWeakAggImpl ); dotest( xWeakComponentImpl ); dotest( xWeakAggComponentImpl ); - // + xWeakImpl = (OWeakObject *)new TestImplInh(); + Reference< lang::XTypeProvider > xTP6( xWeakImpl, UNO_QUERY ); dotest( xWeakImpl ); Reference< H > xH( xWeakImpl, UNO_QUERY ); Reference< I > xI( xH, UNO_QUERY ); @@ -405,11 +442,27 @@ void test_ImplHelper( const Reference< XMultiServiceFactory > & xSF ) OSL_ASSERT( xI->i().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("i") ) ); xWeakAggImpl = (OWeakObject *)new TestAggImplInh(); + Reference< lang::XTypeProvider > xTP7( xWeakAggImpl, UNO_QUERY ); dotest( xWeakAggImpl ); xH.set( xWeakAggImpl, UNO_QUERY ); xI.set( xH, UNO_QUERY ); OSL_ASSERT( xH->h().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("h2") ) ); OSL_ASSERT( xI->i().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("i2") ) ); + + // + OSL_ASSERT( + xTP6->getImplementationId() != xTP1->getImplementationId() && + xTP6->getImplementationId() != xTP2->getImplementationId() && + xTP6->getImplementationId() != xTP3->getImplementationId() && + xTP6->getImplementationId() != xTP4->getImplementationId() && + xTP6->getImplementationId() != xTP5->getImplementationId() && + xTP6->getImplementationId() != xTP7->getImplementationId() && + xTP7->getImplementationId() != xTP1->getImplementationId() && + xTP7->getImplementationId() != xTP2->getImplementationId() && + xTP7->getImplementationId() != xTP3->getImplementationId() && + xTP7->getImplementationId() != xTP4->getImplementationId() && + xTP7->getImplementationId() != xTP5->getImplementationId() ); + // // exception helper test try @@ -426,7 +479,7 @@ void test_ImplHelper( const Reference< XMultiServiceFactory > & xSF ) throwException( makeAny( Exception( OUString( RTL_CONSTASCII_USTRINGPARAM("exc") ), rExc.Context ) ) ); } - catch (IllegalAccessException &) + catch (lang::IllegalAccessException &) { OSL_ENSURE( sal_False, "### unexpected IllegalAccessException exception caught!" ); } @@ -436,10 +489,10 @@ void test_ImplHelper( const Reference< XMultiServiceFactory > & xSF ) "### unexpected exception content!" ); try { - throwException( makeAny( IllegalAccessException( + throwException( makeAny( lang::IllegalAccessException( OUString( RTL_CONSTASCII_USTRINGPARAM("axxess exc") ), rExc.Context ) ) ); } - catch (IllegalAccessException & rExc) + catch (lang::IllegalAccessException & rExc) { OSL_ENSURE( rExc.Message.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("axxess exc") ) && rExc.Context == xImpl, "### unexpected exception content!" ); |