UDK 3.2.7 C/C++ API Reference

cppuhelper/compbase.hxx

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /*
00003  * This file is part of the LibreOffice project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * This file incorporates work covered by the following license notice:
00010  *
00011  *   Licensed to the Apache Software Foundation (ASF) under one or more
00012  *   contributor license agreements. See the NOTICE file distributed
00013  *   with this work for additional information regarding copyright
00014  *   ownership. The ASF licenses this file to you under the Apache
00015  *   License, Version 2.0 (the "License"); you may not use this file
00016  *   except in compliance with the License. You may obtain a copy of
00017  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
00018  */
00019 #ifndef _CPPUHELPER_COMPBASE_HXX_
00020 #define _CPPUHELPER_COMPBASE_HXX_
00021 
00022 #include <cppuhelper/compbase_ex.hxx>
00023 #include <cppuhelper/implbase.hxx>
00024 
00025 /* This header should not be used anymore.
00026    @deprecated
00027 */
00028 
00030 
00031 #define __DEF_COMPIMPLHELPER_A( N ) \
00032 namespace cppu \
00033 { \
00034 template< __CLASS_IFC##N > \
00035 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper##N \
00036     : public ::cppu::WeakComponentImplHelperBase \
00037     , public ImplHelperBase##N< __IFC##N > \
00038 { \
00039     static ClassData##N s_aCD; \
00040 public: \
00041     WeakComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
00042         : WeakComponentImplHelperBase( rMutex ) \
00043         {} \
00044     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00045     { \
00046         ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase##N< __IFC##N > *)this ) ); \
00047         if (aRet.hasValue()) \
00048             return aRet; \
00049         return WeakComponentImplHelperBase::queryInterface( rType ); \
00050     } \
00051     virtual void SAL_CALL acquire() throw () \
00052         { WeakComponentImplHelperBase::acquire(); } \
00053     virtual void SAL_CALL release() throw () \
00054         { WeakComponentImplHelperBase::release(); } \
00055     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00056         { return getClassData( s_aCD ).getTypes(); } \
00057     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00058         { return getClassData( s_aCD ).getImplementationId(); } \
00059 }; \
00060 template< __CLASS_IFC##N > \
00061 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper##N \
00062     : public ::cppu::WeakAggComponentImplHelperBase \
00063     , public ImplHelperBase##N< __IFC##N > \
00064 { \
00065     static ClassData##N s_aCD; \
00066 public: \
00067     WeakAggComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
00068         : WeakAggComponentImplHelperBase( rMutex ) \
00069         {} \
00070     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00071         { return WeakAggComponentImplHelperBase::queryInterface( rType ); } \
00072     virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
00073     { \
00074         ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase##N< __IFC##N > *)this ) ); \
00075         if (aRet.hasValue()) \
00076             return aRet; \
00077         return WeakAggComponentImplHelperBase::queryAggregation( rType ); \
00078     } \
00079     virtual void SAL_CALL acquire() throw () \
00080         { WeakAggComponentImplHelperBase::acquire(); } \
00081     virtual void SAL_CALL release() throw () \
00082         { WeakAggComponentImplHelperBase::release(); } \
00083     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
00084         { return getClassData( s_aCD ).getTypes(); } \
00085     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
00086         { return getClassData( s_aCD ).getImplementationId(); } \
00087 };
00088 
00089 #define __DEF_COMPIMPLHELPER_B( N ) \
00090 template< __CLASS_IFC##N > \
00091 ClassData##N WeakComponentImplHelper##N< __IFC##N >::s_aCD = ClassData##N( 4 ); \
00092 template< __CLASS_IFC##N > \
00093 ClassData##N WeakAggComponentImplHelper##N< __IFC##N >::s_aCD = ClassData##N( 3 );
00094 
00095 #define __DEF_COMPIMPLHELPER_C( N ) \
00096 }
00097 
00098 #define __DEF_COMPIMPLHELPER( N ) \
00099 __DEF_COMPIMPLHELPER_A( N ) \
00100 __DEF_COMPIMPLHELPER_B( N ) \
00101 __DEF_COMPIMPLHELPER_C( N )
00102 
00104 
00105 #endif
00106 
00107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines