diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2004-06-25 16:33:14 +0000 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2004-06-25 16:33:14 +0000 |
commit | 69817be1940b70504d12427b2eca6562e374d957 (patch) | |
tree | 73237e25e0021d4bb3c99e83a4ab52c9ebccc907 /cppuhelper/inc/cppuhelper/compbase2.hxx | |
parent | 2b382a8c0d1cfdfad611f05921ebfdf5a9e185cb (diff) |
INTEGRATION: CWS tune04 (1.9.28); FILE MERGED
2004/06/15 08:53:06 cmc 1.9.28.1: #i29636# turn global objects into local static data protected with swishy double-locked templated template
Diffstat (limited to 'cppuhelper/inc/cppuhelper/compbase2.hxx')
-rw-r--r-- | cppuhelper/inc/cppuhelper/compbase2.hxx | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/cppuhelper/inc/cppuhelper/compbase2.hxx b/cppuhelper/inc/cppuhelper/compbase2.hxx index 62ded28c5c0d..0bb079098ba1 100644 --- a/cppuhelper/inc/cppuhelper/compbase2.hxx +++ b/cppuhelper/inc/cppuhelper/compbase2.hxx @@ -2,9 +2,9 @@ * * $RCSfile: compbase2.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: hr $ $Date: 2004-02-02 23:08:39 $ + * last change: $Author: hjs $ $Date: 2004-06-25 17:32:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -93,32 +93,21 @@ namespace cppu , public Ifc1, public Ifc2 { /** @internal */ - static class_data2 s_cd; + struct cd : public rtl::StaticAggregate< class_data, ImplClassData2 < Ifc1, Ifc2, WeakComponentImplHelper2<Ifc1, Ifc2> > > {}; public: inline WeakComponentImplHelper2( ::osl::Mutex & rMutex ) 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 ); } + { return WeakComponentImplHelper_query( rType, cd::get(), 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 ); } + { return WeakComponentImplHelper_getTypes( cd::get() ); } 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 Ifc1, class Ifc2 > - class_data2 WeakComponentImplHelper2< Ifc1, Ifc2 >::s_cd = - { - 2 +1, sal_False, sal_False, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { - { (::cppu::fptr_getCppuType)(::com::sun::star::uno::Type const & (SAL_CALL *)( ::com::sun::star::uno::Reference< Ifc1 > const * ))&getCppuType, ((sal_Int32)(Ifc1 *) (WeakComponentImplHelper2< Ifc1, Ifc2 > *) 16) - 16 }, - { (::cppu::fptr_getCppuType)(::com::sun::star::uno::Type const & (SAL_CALL *)( ::com::sun::star::uno::Reference< Ifc2 > const * ))&getCppuType, ((sal_Int32)(Ifc2 *) (WeakComponentImplHelper2< Ifc1, Ifc2 > *) 16) - 16 }, - { (::cppu::fptr_getCppuType)(::com::sun::star::uno::Type const & (SAL_CALL *)( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider > const * ))&getCppuType, ((sal_Int32)(::com::sun::star::lang::XTypeProvider *) (WeakComponentImplHelper2< Ifc1, Ifc2 > *) 16) - 16 } - } + { return ImplHelper_getImplementationId( cd::get() ); } }; /** Implementation helper supporting ::com::sun::star::lang::XTypeProvider and ::com::sun::star::lang::XComponent. Upon disposing objects of this class, sub-classes @@ -140,7 +129,7 @@ namespace cppu , public Ifc1, public Ifc2 { /** @internal */ - static class_data2 s_cd; + struct cd : public rtl::StaticAggregate< class_data, ImplClassData2 < Ifc1, Ifc2, WeakAggComponentImplHelper2<Ifc1, Ifc2> > > {}; public: inline WeakAggComponentImplHelper2( ::osl::Mutex & rMutex ) throw () : WeakAggComponentImplHelperBase( rMutex ) @@ -148,26 +137,15 @@ namespace cppu 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 ); } + { return WeakAggComponentImplHelper_queryAgg( rType, cd::get(), 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 ); } + { return WeakAggComponentImplHelper_getTypes( cd::get() ); } 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 Ifc1, class Ifc2 > - class_data2 WeakAggComponentImplHelper2< Ifc1, Ifc2 >::s_cd = - { - 2 +1, sal_False, sal_False, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { - { (::cppu::fptr_getCppuType)(::com::sun::star::uno::Type const & (SAL_CALL *)( ::com::sun::star::uno::Reference< Ifc1 > const * ))&getCppuType, ((sal_Int32)(Ifc1 *) (WeakAggComponentImplHelper2< Ifc1, Ifc2 > *) 16) - 16 }, - { (::cppu::fptr_getCppuType)(::com::sun::star::uno::Type const & (SAL_CALL *)( ::com::sun::star::uno::Reference< Ifc2 > const * ))&getCppuType, ((sal_Int32)(Ifc2 *) (WeakAggComponentImplHelper2< Ifc1, Ifc2 > *) 16) - 16 }, - { (::cppu::fptr_getCppuType)(::com::sun::star::uno::Type const & (SAL_CALL *)( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider > const * ))&getCppuType, ((sal_Int32)(::com::sun::star::lang::XTypeProvider *) (WeakAggComponentImplHelper2< Ifc1, Ifc2 > *) 16) - 16 } - } + { return ImplHelper_getImplementationId( cd::get() ); } }; } |