LCOV - code coverage report
Current view: top level - solver/unxlngi6.pro/inc/cppuhelper - implbase7.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 38 50 76.0 %
Date: 2012-08-25 Functions: 95 157 60.5 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 8 18 44.4 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : #ifndef _CPPUHELPER_IMPLBASE7_HXX_
      29                 :            : #define _CPPUHELPER_IMPLBASE7_HXX_
      30                 :            : 
      31                 :            : #include <cppuhelper/implbase_ex.hxx>
      32                 :            : #include <rtl/instance.hxx>
      33                 :            : 
      34                 :            : namespace cppu
      35                 :            : {
      36                 :            :     /// @cond INTERNAL
      37                 :            : 
      38                 :            :     struct class_data7
      39                 :            :     {
      40                 :            :         sal_Int16 m_nTypes;
      41                 :            :         sal_Bool m_storedTypeRefs;
      42                 :            :         sal_Bool m_storedId;
      43                 :            :         sal_Int8 m_id[ 16 ];
      44                 :            :         type_entry m_typeEntries[ 7 + 1 ];
      45                 :            :     };
      46                 :            : 
      47                 :            :     template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Ifc7, typename Impl >
      48                 :            :         struct ImplClassData7
      49                 :            :     {
      50                 :       1732 :         class_data* operator ()()
      51                 :            :         {
      52                 :            :             static class_data7 s_cd =
      53                 :            :             {
      54                 :            :                 7 +1, sal_False, sal_False,
      55                 :            :                 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
      56                 :            :                 {
      57                 :            :                     { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 },
      58                 :            :                     { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 },
      59                 :            :                     { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 },
      60                 :            :                     { { Ifc4::static_type }, ((sal_IntPtr)(Ifc4 *) (Impl *) 16) - 16 },
      61                 :            :                     { { Ifc5::static_type }, ((sal_IntPtr)(Ifc5 *) (Impl *) 16) - 16 },
      62                 :            :                     { { Ifc6::static_type }, ((sal_IntPtr)(Ifc6 *) (Impl *) 16) - 16 },
      63                 :            :                     { { Ifc7::static_type }, ((sal_IntPtr)(Ifc7 *) (Impl *) 16) - 16 },
      64                 :            :                     { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
      65                 :            :                 }
      66                 :            :             };
      67                 :       1732 :             return reinterpret_cast< class_data * >(&s_cd);
      68                 :            :         }
      69                 :            :     };
      70                 :            : 
      71                 :            :     /// @endcond
      72                 :            : 
      73                 :            :     /** Implementation helper implementing interface com::sun::star::lang::XTypeProvider
      74                 :            :         and method XInterface::queryInterface(), but no reference counting.
      75                 :            : 
      76                 :            :         @derive
      77                 :            :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
      78                 :            :         Your sub class defines method implementations for these interface(s) including acquire()/
      79                 :            :         release() and delegates incoming queryInterface() calls to this base class.
      80                 :            :     */
      81                 :            :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
      82                 :       2682 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper7
      83                 :            :         : public com::sun::star::lang::XTypeProvider
      84                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
      85                 :            :     {
      86                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, ImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
      87                 :            :     public:
      88                 :     153228 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
      89                 :     153228 :             { return ImplHelper_query( rType, cd::get(), this ); }
      90                 :        102 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
      91                 :        102 :             { return ImplHelper_getTypes( cd::get() ); }
      92                 :          4 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
      93                 :          4 :             { return ImplHelper_getImplementationId( cd::get() ); }
      94                 :            : 
      95                 :            : #if !defined _MSC_VER // public -> protected changes mangled names there
      96                 :            :     protected:
      97                 :            : #endif
      98                 :       2603 :         ~ImplHelper7() throw () {}
      99                 :            :     };
     100                 :            :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     101                 :            :         com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
     102                 :            :         (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakObject).
     103                 :            : 
     104                 :            :         @derive
     105                 :            :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
     106                 :            :         Your sub class defines method implementations for these interface(s).
     107                 :            :     */
     108                 :            :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
     109         [ -  + ]:      51529 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper7
     110                 :            :         : public OWeakObject
     111                 :            :         , public com::sun::star::lang::XTypeProvider
     112                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
     113                 :            :     {
     114                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, WeakImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
     115                 :            :     public:
     116                 :     173801 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     117                 :     173801 :             { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
     118                 :     736770 :         virtual void SAL_CALL acquire() throw ()
     119                 :     736770 :             { OWeakObject::acquire(); }
     120                 :     733919 :         virtual void SAL_CALL release() throw ()
     121                 :     733919 :             { OWeakObject::release(); }
     122                 :          0 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
     123                 :          0 :             { return WeakImplHelper_getTypes( cd::get() ); }
     124                 :          0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
     125                 :          0 :             { return ImplHelper_getImplementationId( cd::get() ); }
     126                 :            :     };
     127                 :            :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     128                 :            :         com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
     129                 :            :         (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakAggObject).
     130                 :            :         In addition, it supports also aggregation meaning object of this class can be aggregated
     131                 :            :         (com::sun::star::uno::XAggregation thru ::cppu::OWeakAggObject).
     132                 :            :         If a delegator is set (this object is aggregated), then incoming queryInterface()
     133                 :            :         calls are delegated to the delegator object. If the delegator does not support the
     134                 :            :         demanded interface, it calls queryAggregation() on its aggregated objects.
     135                 :            : 
     136                 :            :         @derive
     137                 :            :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
     138                 :            :         Your sub class defines method implementations for these interface(s).
     139                 :            :     */
     140                 :            :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
     141         [ -  + ]:       2837 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper7
     142                 :            :         : public OWeakAggObject
     143                 :            :         , public com::sun::star::lang::XTypeProvider
     144                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
     145                 :            :     {
     146                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, WeakAggImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
     147                 :            :     public:
     148                 :          0 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     149                 :          0 :             { return OWeakAggObject::queryInterface( rType ); }
     150                 :      69807 :         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     151                 :      69807 :             { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
     152                 :     172717 :         virtual void SAL_CALL acquire() throw ()
     153                 :     172717 :             { OWeakAggObject::acquire(); }
     154                 :     172318 :         virtual void SAL_CALL release() throw ()
     155                 :     172318 :             { OWeakAggObject::release(); }
     156                 :         92 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
     157                 :         92 :             { return WeakAggImplHelper_getTypes( cd::get() ); }
     158                 :          0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
     159                 :          0 :             { return ImplHelper_getImplementationId( cd::get() ); }
     160                 :            :     };
     161                 :            :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     162                 :            :         com::sun::star::uno::XInterface inherting from a BaseClass.
     163                 :            :         All acquire() and release() calls are delegated to the BaseClass. Upon queryInterface(),
     164                 :            :         if a demanded interface is not supported by this class directly, the request is
     165                 :            :         delegated to the BaseClass.
     166                 :            : 
     167                 :            :         @attention
     168                 :            :         The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface
     169                 :            :         and com::sun::star::lang::XTypeProvider are implemented properly.  The
     170                 :            :         BaseClass must have at least one ctor that can be called with six or
     171                 :            :         fewer arguments, of which none is of non-const reference type.
     172                 :            : 
     173                 :            :         @derive
     174                 :            :         Inherit from this class giving your additional interface(s) to be implemented as
     175                 :            :         template argument(s). Your sub class defines method implementations for these interface(s).
     176                 :            :     */
     177                 :            :     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
     178         [ -  + ]:        308 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper7
     179                 :            :         : public BaseClass
     180                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
     181                 :            :     {
     182                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, ImplInheritanceHelper7<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
     183                 :            :     protected:
     184                 :            :         template< typename T1 >
     185                 :        130 :         explicit ImplInheritanceHelper7(T1 const & arg1): BaseClass(arg1) {}
     186                 :            :         template< typename T1, typename T2 >
     187                 :            :         ImplInheritanceHelper7(T1 const & arg1, T2 const & arg2):
     188                 :            :             BaseClass(arg1, arg2) {}
     189                 :            :         template< typename T1, typename T2, typename T3 >
     190                 :            :         ImplInheritanceHelper7(
     191                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3):
     192                 :            :             BaseClass(arg1, arg2, arg3) {}
     193                 :            :         template< typename T1, typename T2, typename T3, typename T4 >
     194                 :            :         ImplInheritanceHelper7(
     195                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
     196                 :            :             BaseClass(arg1, arg2, arg3, arg4) {}
     197                 :            :         template<
     198                 :            :             typename T1, typename T2, typename T3, typename T4, typename T5 >
     199                 :            :         ImplInheritanceHelper7(
     200                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     201                 :            :             T5 const & arg5):
     202                 :            :             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
     203                 :            :         template<
     204                 :            :             typename T1, typename T2, typename T3, typename T4, typename T5,
     205                 :            :             typename T6 >
     206                 :            :         ImplInheritanceHelper7(
     207                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     208                 :            :             T5 const & arg5, T6 const & arg6):
     209                 :            :             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
     210                 :            :     public:
     211                 :        178 :         ImplInheritanceHelper7() {}
     212                 :      47309 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     213                 :            :             {
     214 [ +  - ][ +  - ]:      47309 :                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
     215         [ +  + ]:      47309 :                 if (aRet.hasValue())
     216                 :       4460 :                     return aRet;
     217         [ +  - ]:      47309 :                 return BaseClass::queryInterface( rType );
     218                 :            :             }
     219                 :     165361 :         virtual void SAL_CALL acquire() throw ()
     220                 :     165361 :             { BaseClass::acquire(); }
     221                 :     165621 :         virtual void SAL_CALL release() throw ()
     222                 :     165621 :             { BaseClass::release(); }
     223                 :          0 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
     224 [ #  # ][ #  # ]:          0 :             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
     225                 :          0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
     226                 :          0 :             { return ImplHelper_getImplementationId( cd::get() ); }
     227                 :            :     };
     228                 :            :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     229                 :            :         com::sun::star::uno::XInterface inherting from a BaseClass.
     230                 :            :         All acquire(),  release() and queryInterface() calls are delegated to the BaseClass.
     231                 :            :         Upon queryAggregation(), if a demanded interface is not supported by this class directly,
     232                 :            :         the request is delegated to the BaseClass.
     233                 :            : 
     234                 :            :         @attention
     235                 :            :         The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface,
     236                 :            :         com::sun::star::uno::XAggregation and com::sun::star::lang::XTypeProvider
     237                 :            :         are implemented properly.  The BaseClass must have at least one ctor
     238                 :            :         that can be called with six or fewer arguments, of which none is of
     239                 :            :         non-const reference type.
     240                 :            : 
     241                 :            :         @derive
     242                 :            :         Inherit from this class giving your additional interface(s) to be implemented as
     243                 :            :         template argument(s). Your sub class defines method implementations for these interface(s).
     244                 :            :     */
     245                 :            :     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
     246                 :            :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper7
     247                 :            :         : public BaseClass
     248                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
     249                 :            :     {
     250                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, AggImplInheritanceHelper7<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
     251                 :            :     protected:
     252                 :            :         template< typename T1 >
     253                 :            :         explicit AggImplInheritanceHelper7(T1 const & arg1): BaseClass(arg1) {}
     254                 :            :         template< typename T1, typename T2 >
     255                 :            :         AggImplInheritanceHelper7(T1 const & arg1, T2 const & arg2):
     256                 :            :             BaseClass(arg1, arg2) {}
     257                 :            :         template< typename T1, typename T2, typename T3 >
     258                 :            :         AggImplInheritanceHelper7(
     259                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3):
     260                 :            :             BaseClass(arg1, arg2, arg3) {}
     261                 :            :         template< typename T1, typename T2, typename T3, typename T4 >
     262                 :            :         AggImplInheritanceHelper7(
     263                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
     264                 :            :             BaseClass(arg1, arg2, arg3, arg4) {}
     265                 :            :         template<
     266                 :            :             typename T1, typename T2, typename T3, typename T4, typename T5 >
     267                 :            :         AggImplInheritanceHelper7(
     268                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     269                 :            :             T5 const & arg5):
     270                 :            :             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
     271                 :            :         template<
     272                 :            :             typename T1, typename T2, typename T3, typename T4, typename T5,
     273                 :            :             typename T6 >
     274                 :            :         AggImplInheritanceHelper7(
     275                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     276                 :            :             T5 const & arg5, T6 const & arg6):
     277                 :            :             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
     278                 :            :     public:
     279                 :            :         AggImplInheritanceHelper7() {}
     280                 :            :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     281                 :            :             { return BaseClass::queryInterface( rType ); }
     282                 :            :         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     283                 :            :             {
     284                 :            :                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
     285                 :            :                 if (aRet.hasValue())
     286                 :            :                     return aRet;
     287                 :            :                 return BaseClass::queryAggregation( rType );
     288                 :            :             }
     289                 :            :         virtual void SAL_CALL acquire() throw ()
     290                 :            :             { BaseClass::acquire(); }
     291                 :            :         virtual void SAL_CALL release() throw ()
     292                 :            :             { BaseClass::release(); }
     293                 :            :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
     294                 :            :             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
     295                 :            :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
     296                 :            :             { return ImplHelper_getImplementationId( cd::get() ); }
     297                 :            :     };
     298                 :            : }
     299                 :            : 
     300                 :            : #endif
     301                 :            : 
     302                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10