UDK 3.2.7 C/C++ API Reference

cppuhelper/implbase3.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_IMPLBASE3_HXX_
00020 #define _CPPUHELPER_IMPLBASE3_HXX_
00021 
00022 #include <cppuhelper/implbase_ex.hxx>
00023 #include <rtl/instance.hxx>
00024 
00025 namespace cppu
00026 {
00028 
00029     struct class_data3
00030     {
00031         sal_Int16 m_nTypes;
00032         sal_Bool m_storedTypeRefs;
00033         sal_Bool m_storedId;
00034         sal_Int8 m_id[ 16 ];
00035         type_entry m_typeEntries[ 3 + 1 ];
00036     };
00037 
00038     template< typename Ifc1, typename Ifc2, typename Ifc3, typename Impl > struct ImplClassData3
00039     {
00040         class_data* operator ()()
00041         {
00042             static class_data3 s_cd =
00043             {
00044                 3 +1, sal_False, sal_False,
00045                 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
00046                 {
00047                     { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 },
00048                     { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 },
00049                     { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 },
00050                     { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
00051                 }
00052             };
00053             return reinterpret_cast< class_data * >(&s_cd);
00054         }
00055     };
00056 
00058 
00067     template< class Ifc1, class Ifc2, class Ifc3 >
00068     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper3
00069         : public com::sun::star::lang::XTypeProvider
00070         , public Ifc1, public Ifc2, public Ifc3
00071     {
00072         struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, ImplHelper3<Ifc1, Ifc2, Ifc3> > > {};
00073     public:
00074         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00075             { return ImplHelper_query( rType, cd::get(), this ); }
00076         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00077             { return ImplHelper_getTypes( cd::get() ); }
00078         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00079             { return ImplHelper_getImplementationId( cd::get() ); }
00080 
00081 #if !defined _MSC_VER // public -> protected changes mangled names there
00082     protected:
00083 #endif
00084         ~ImplHelper3() throw () {}
00085     };
00094     template< class Ifc1, class Ifc2, class Ifc3 >
00095     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper3
00096         : public OWeakObject
00097         , public com::sun::star::lang::XTypeProvider
00098         , public Ifc1, public Ifc2, public Ifc3
00099     {
00100         struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, WeakImplHelper3<Ifc1, Ifc2, Ifc3> > > {};
00101     public:
00102         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00103             { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
00104         virtual void SAL_CALL acquire() throw ()
00105             { OWeakObject::acquire(); }
00106         virtual void SAL_CALL release() throw ()
00107             { OWeakObject::release(); }
00108         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00109             { return WeakImplHelper_getTypes( cd::get() ); }
00110         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00111             { return ImplHelper_getImplementationId( cd::get() ); }
00112     };
00126     template< class Ifc1, class Ifc2, class Ifc3 >
00127     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper3
00128         : public OWeakAggObject
00129         , public com::sun::star::lang::XTypeProvider
00130         , public Ifc1, public Ifc2, public Ifc3
00131     {
00132         struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, WeakAggImplHelper3<Ifc1, Ifc2, Ifc3> > > {};
00133     public:
00134         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00135             { return OWeakAggObject::queryInterface( rType ); }
00136         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00137             { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
00138         virtual void SAL_CALL acquire() throw ()
00139             { OWeakAggObject::acquire(); }
00140         virtual void SAL_CALL release() throw ()
00141             { OWeakAggObject::release(); }
00142         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00143             { return WeakAggImplHelper_getTypes( cd::get() ); }
00144         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00145             { return ImplHelper_getImplementationId( cd::get() ); }
00146     };
00164     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3 >
00165     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper3
00166         : public BaseClass
00167         , public Ifc1, public Ifc2, public Ifc3
00168     {
00169         struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, ImplInheritanceHelper3<BaseClass, Ifc1, Ifc2, Ifc3> > > {};
00170     protected:
00171         template< typename T1 >
00172         explicit ImplInheritanceHelper3(T1 const & arg1): BaseClass(arg1) {}
00173         template< typename T1, typename T2 >
00174         ImplInheritanceHelper3(T1 const & arg1, T2 const & arg2):
00175             BaseClass(arg1, arg2) {}
00176         template< typename T1, typename T2, typename T3 >
00177         ImplInheritanceHelper3(
00178             T1 const & arg1, T2 const & arg2, T3 const & arg3):
00179             BaseClass(arg1, arg2, arg3) {}
00180         template< typename T1, typename T2, typename T3, typename T4 >
00181         ImplInheritanceHelper3(
00182             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
00183             BaseClass(arg1, arg2, arg3, arg4) {}
00184         template<
00185             typename T1, typename T2, typename T3, typename T4, typename T5 >
00186         ImplInheritanceHelper3(
00187             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
00188             T5 const & arg5):
00189             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
00190         template<
00191             typename T1, typename T2, typename T3, typename T4, typename T5,
00192             typename T6 >
00193         ImplInheritanceHelper3(
00194             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
00195             T5 const & arg5, T6 const & arg6):
00196             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
00197     public:
00198         ImplInheritanceHelper3() {}
00199         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00200             {
00201                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
00202                 if (aRet.hasValue())
00203                     return aRet;
00204                 return BaseClass::queryInterface( rType );
00205             }
00206         virtual void SAL_CALL acquire() throw ()
00207             { BaseClass::acquire(); }
00208         virtual void SAL_CALL release() throw ()
00209             { BaseClass::release(); }
00210         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00211             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
00212         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00213             { return ImplHelper_getImplementationId( cd::get() ); }
00214     };
00232     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3 >
00233     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper3
00234         : public BaseClass
00235         , public Ifc1, public Ifc2, public Ifc3
00236     {
00237         struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, AggImplInheritanceHelper3<BaseClass, Ifc1, Ifc2, Ifc3> > > {};
00238     protected:
00239         template< typename T1 >
00240         explicit AggImplInheritanceHelper3(T1 const & arg1): BaseClass(arg1) {}
00241         template< typename T1, typename T2 >
00242         AggImplInheritanceHelper3(T1 const & arg1, T2 const & arg2):
00243             BaseClass(arg1, arg2) {}
00244         template< typename T1, typename T2, typename T3 >
00245         AggImplInheritanceHelper3(
00246             T1 const & arg1, T2 const & arg2, T3 const & arg3):
00247             BaseClass(arg1, arg2, arg3) {}
00248         template< typename T1, typename T2, typename T3, typename T4 >
00249         AggImplInheritanceHelper3(
00250             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
00251             BaseClass(arg1, arg2, arg3, arg4) {}
00252         template<
00253             typename T1, typename T2, typename T3, typename T4, typename T5 >
00254         AggImplInheritanceHelper3(
00255             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
00256             T5 const & arg5):
00257             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
00258         template<
00259             typename T1, typename T2, typename T3, typename T4, typename T5,
00260             typename T6 >
00261         AggImplInheritanceHelper3(
00262             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
00263             T5 const & arg5, T6 const & arg6):
00264             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
00265     public:
00266         AggImplInheritanceHelper3() {}
00267         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00268             { return BaseClass::queryInterface( rType ); }
00269         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00270             {
00271                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
00272                 if (aRet.hasValue())
00273                     return aRet;
00274                 return BaseClass::queryAggregation( rType );
00275             }
00276         virtual void SAL_CALL acquire() throw ()
00277             { BaseClass::acquire(); }
00278         virtual void SAL_CALL release() throw ()
00279             { BaseClass::release(); }
00280         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00281             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
00282         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00283             { return ImplHelper_getImplementationId( cd::get() ); }
00284     };
00285 }
00286 
00287 #endif
00288 
00289 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines