UDK 3.2.7 C/C++ API Reference
cppuhelper/implbase6.hxx
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /*************************************************************************
00003  *
00004  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
00005  *
00006  * Copyright 2000, 2010 Oracle and/or its affiliates.
00007  *
00008  * OpenOffice.org - a multi-platform office productivity suite
00009  *
00010  * This file is part of OpenOffice.org.
00011  *
00012  * OpenOffice.org is free software: you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 3
00014  * only, as published by the Free Software Foundation.
00015  *
00016  * OpenOffice.org is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License version 3 for more details
00020  * (a copy is included in the LICENSE file that accompanied this code).
00021  *
00022  * You should have received a copy of the GNU Lesser General Public License
00023  * version 3 along with OpenOffice.org.  If not, see
00024  * <http://www.openoffice.org/license.html>
00025  * for a copy of the LGPLv3 License.
00026  *
00027  ************************************************************************/
00028 #ifndef _CPPUHELPER_IMPLBASE6_HXX_
00029 #define _CPPUHELPER_IMPLBASE6_HXX_
00030 
00031 #include <cppuhelper/implbase_ex.hxx>
00032 #include <rtl/instance.hxx>
00033 
00034 namespace cppu
00035 {
00037 
00038     struct class_data6
00039     {
00040         sal_Int16 m_nTypes;
00041         sal_Bool m_storedTypeRefs;
00042         sal_Bool m_storedId;
00043         sal_Int8 m_id[ 16 ];
00044         type_entry m_typeEntries[ 6 + 1 ];
00045     };
00046 
00047     template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Impl >
00048         struct ImplClassData6
00049     {
00050         class_data* operator ()()
00051         {
00052             static class_data6 s_cd =
00053             {
00054                 6 +1, sal_False, sal_False,
00055                 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
00056                 {
00057                     { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 },
00058                     { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 },
00059                     { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 },
00060                     { { Ifc4::static_type }, ((sal_IntPtr)(Ifc4 *) (Impl *) 16) - 16 },
00061                     { { Ifc5::static_type }, ((sal_IntPtr)(Ifc5 *) (Impl *) 16) - 16 },
00062                     { { Ifc6::static_type }, ((sal_IntPtr)(Ifc6 *) (Impl *) 16) - 16 },
00063                     { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
00064                 }
00065             };
00066             return reinterpret_cast< class_data * >(&s_cd);
00067         }
00068     };
00069 
00071 
00080     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
00081     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper6
00082         : public com::sun::star::lang::XTypeProvider
00083         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
00084     {
00085         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, ImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
00086     public:
00087         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00088             { return ImplHelper_query( rType, cd::get(), this ); }
00089         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00090             { return ImplHelper_getTypes( cd::get() ); }
00091         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00092             { return ImplHelper_getImplementationId( cd::get() ); }
00093 
00094 #if !defined _MSC_VER // public -> protected changes mangled names there
00095     protected:
00096 #endif
00097         ~ImplHelper6() throw () {}
00098     };
00107     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
00108     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper6
00109         : public OWeakObject
00110         , public com::sun::star::lang::XTypeProvider
00111         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
00112     {
00113         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
00114     public:
00115         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00116             { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
00117         virtual void SAL_CALL acquire() throw ()
00118             { OWeakObject::acquire(); }
00119         virtual void SAL_CALL release() throw ()
00120             { OWeakObject::release(); }
00121         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00122             { return WeakImplHelper_getTypes( cd::get() ); }
00123         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00124             { return ImplHelper_getImplementationId( cd::get() ); }
00125     };
00139     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
00140     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper6
00141         : public OWeakAggObject
00142         , public com::sun::star::lang::XTypeProvider
00143         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
00144     {
00145         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakAggImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
00146     public:
00147         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00148             { return OWeakAggObject::queryInterface( rType ); }
00149         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00150             { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
00151         virtual void SAL_CALL acquire() throw ()
00152             { OWeakAggObject::acquire(); }
00153         virtual void SAL_CALL release() throw ()
00154             { OWeakAggObject::release(); }
00155         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00156             { return WeakAggImplHelper_getTypes( cd::get() ); }
00157         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00158             { return ImplHelper_getImplementationId( cd::get() ); }
00159     };
00176     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
00177     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper6
00178         : public BaseClass
00179         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
00180     {
00181         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, ImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
00182     protected:
00183         template< typename T1 >
00184         explicit ImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
00185         template< typename T1, typename T2 >
00186         ImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
00187             BaseClass(arg1, arg2) {}
00188         template< typename T1, typename T2, typename T3 >
00189         ImplInheritanceHelper6(
00190             T1 const & arg1, T2 const & arg2, T3 const & arg3):
00191             BaseClass(arg1, arg2, arg3) {}
00192         template< typename T1, typename T2, typename T3, typename T4 >
00193         ImplInheritanceHelper6(
00194             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
00195             BaseClass(arg1, arg2, arg3, arg4) {}
00196         template<
00197             typename T1, typename T2, typename T3, typename T4, typename T5 >
00198         ImplInheritanceHelper6(
00199             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
00200             T5 const & arg5):
00201             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
00202         template<
00203             typename T1, typename T2, typename T3, typename T4, typename T5,
00204             typename T6 >
00205         ImplInheritanceHelper6(
00206             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
00207             T5 const & arg5, T6 const & arg6):
00208             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
00209     public:
00210         ImplInheritanceHelper6() {}
00211         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00212             {
00213                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
00214                 if (aRet.hasValue())
00215                     return aRet;
00216                 return BaseClass::queryInterface( rType );
00217             }
00218         virtual void SAL_CALL acquire() throw ()
00219             { BaseClass::acquire(); }
00220         virtual void SAL_CALL release() throw ()
00221             { BaseClass::release(); }
00222         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00223             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
00224         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00225             { return ImplHelper_getImplementationId( cd::get() ); }
00226     };
00244     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
00245     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper6
00246         : public BaseClass
00247         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
00248     {
00249         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, AggImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
00250     protected:
00251         template< typename T1 >
00252         explicit AggImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
00253         template< typename T1, typename T2 >
00254         AggImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
00255             BaseClass(arg1, arg2) {}
00256         template< typename T1, typename T2, typename T3 >
00257         AggImplInheritanceHelper6(
00258             T1 const & arg1, T2 const & arg2, T3 const & arg3):
00259             BaseClass(arg1, arg2, arg3) {}
00260         template< typename T1, typename T2, typename T3, typename T4 >
00261         AggImplInheritanceHelper6(
00262             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
00263             BaseClass(arg1, arg2, arg3, arg4) {}
00264         template<
00265             typename T1, typename T2, typename T3, typename T4, typename T5 >
00266         AggImplInheritanceHelper6(
00267             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
00268             T5 const & arg5):
00269             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
00270         template<
00271             typename T1, typename T2, typename T3, typename T4, typename T5,
00272             typename T6 >
00273         AggImplInheritanceHelper6(
00274             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
00275             T5 const & arg5, T6 const & arg6):
00276             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
00277     public:
00278         AggImplInheritanceHelper6() {}
00279         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00280             { return BaseClass::queryInterface( rType ); }
00281         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
00282             {
00283                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
00284                 if (aRet.hasValue())
00285                     return aRet;
00286                 return BaseClass::queryAggregation( rType );
00287             }
00288         virtual void SAL_CALL acquire() throw ()
00289             { BaseClass::acquire(); }
00290         virtual void SAL_CALL release() throw ()
00291             { BaseClass::release(); }
00292         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
00293             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
00294         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
00295             { return ImplHelper_getImplementationId( cd::get() ); }
00296     };
00297 }
00298 
00299 #endif
00300 
00301 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines