LCOV - code coverage report
Current view: top level - solver/unxlngi6.pro/inc/cppuhelper - implbase6.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 35 43 81.4 %
Date: 2012-08-25 Functions: 164 277 59.2 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 9 20 45.0 %

           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_IMPLBASE6_HXX_
      29                 :            : #define _CPPUHELPER_IMPLBASE6_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_data6
      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[ 6 + 1 ];
      45                 :            :     };
      46                 :            : 
      47                 :            :     template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Impl >
      48                 :            :         struct ImplClassData6
      49                 :            :     {
      50                 :        976 :         class_data* operator ()()
      51                 :            :         {
      52                 :            :             static class_data6 s_cd =
      53                 :            :             {
      54                 :            :                 6 +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                 :            :                     { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
      64                 :            :                 }
      65                 :            :             };
      66                 :        976 :             return reinterpret_cast< class_data * >(&s_cd);
      67                 :            :         }
      68                 :            :     };
      69                 :            : 
      70                 :            :     /// @endcond
      71                 :            : 
      72                 :            :     /** Implementation helper implementing interface com::sun::star::lang::XTypeProvider
      73                 :            :         and method XInterface::queryInterface(), but no reference counting.
      74                 :            : 
      75                 :            :         @derive
      76                 :            :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
      77                 :            :         Your sub class defines method implementations for these interface(s) including acquire()/
      78                 :            :         release() and delegates incoming queryInterface() calls to this base class.
      79                 :            :     */
      80                 :            :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
      81                 :            :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper6
      82                 :            :         : public com::sun::star::lang::XTypeProvider
      83                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
      84                 :            :     {
      85                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, ImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
      86                 :            :     public:
      87                 :            :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
      88                 :            :             { return ImplHelper_query( rType, cd::get(), this ); }
      89                 :            :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
      90                 :            :             { return ImplHelper_getTypes( cd::get() ); }
      91                 :            :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
      92                 :            :             { return ImplHelper_getImplementationId( cd::get() ); }
      93                 :            : 
      94                 :            : #if !defined _MSC_VER // public -> protected changes mangled names there
      95                 :            :     protected:
      96                 :            : #endif
      97                 :            :         ~ImplHelper6() throw () {}
      98                 :            :     };
      99                 :            :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     100                 :            :         com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
     101                 :            :         (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakObject).
     102                 :            : 
     103                 :            :         @derive
     104                 :            :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
     105                 :            :         Your sub class defines method implementations for these interface(s).
     106                 :            :     */
     107                 :            :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
     108 [ -  + ][ -  + ]:      22197 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper6
     109                 :            :         : public OWeakObject
     110                 :            :         , public com::sun::star::lang::XTypeProvider
     111                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
     112                 :            :     {
     113                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
     114                 :            :     public:
     115                 :     255715 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     116                 :     255715 :             { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
     117                 :    1001187 :         virtual void SAL_CALL acquire() throw ()
     118                 :    1001187 :             { OWeakObject::acquire(); }
     119                 :    1000099 :         virtual void SAL_CALL release() throw ()
     120                 :    1000099 :             { OWeakObject::release(); }
     121                 :        147 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
     122                 :        147 :             { return WeakImplHelper_getTypes( cd::get() ); }
     123                 :        147 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
     124                 :        147 :             { return ImplHelper_getImplementationId( cd::get() ); }
     125                 :            :     };
     126                 :            :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     127                 :            :         com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
     128                 :            :         (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakAggObject).
     129                 :            :         In addition, it supports also aggregation meaning object of this class can be aggregated
     130                 :            :         (com::sun::star::uno::XAggregation thru ::cppu::OWeakAggObject).
     131                 :            :         If a delegator is set (this object is aggregated), then incoming queryInterface()
     132                 :            :         calls are delegated to the delegator object. If the delegator does not support the
     133                 :            :         demanded interface, it calls queryAggregation() on its aggregated objects.
     134                 :            : 
     135                 :            :         @derive
     136                 :            :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
     137                 :            :         Your sub class defines method implementations for these interface(s).
     138                 :            :     */
     139                 :            :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
     140         [ -  + ]:       3595 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper6
     141                 :            :         : public OWeakAggObject
     142                 :            :         , public com::sun::star::lang::XTypeProvider
     143                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
     144                 :            :     {
     145                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakAggImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
     146                 :            :     public:
     147                 :      29177 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     148                 :      29177 :             { return OWeakAggObject::queryInterface( rType ); }
     149                 :      29177 :         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     150                 :      29177 :             { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
     151                 :     223803 :         virtual void SAL_CALL acquire() throw ()
     152                 :     223803 :             { OWeakAggObject::acquire(); }
     153                 :     223702 :         virtual void SAL_CALL release() throw ()
     154                 :     223702 :             { OWeakAggObject::release(); }
     155                 :          0 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
     156                 :          0 :             { return WeakAggImplHelper_getTypes( cd::get() ); }
     157                 :          0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
     158                 :          0 :             { return ImplHelper_getImplementationId( cd::get() ); }
     159                 :            :     };
     160                 :            :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     161                 :            :         com::sun::star::uno::XInterface inherting from a BaseClass.
     162                 :            :         All acquire() and release() calls are delegated to the BaseClass. Upon queryInterface(),
     163                 :            :         if a demanded interface is not supported by this class directly, the request is
     164                 :            :         delegated to the BaseClass.
     165                 :            : 
     166                 :            :         @attention
     167                 :            :         The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface
     168                 :            :         and com::sun::star::lang::XTypeProvider are implemented properly.  The
     169                 :            :         BaseClass must have at least one ctor that can be called with six or
     170                 :            :         fewer arguments, of which none is of non-const reference type.
     171                 :            : 
     172                 :            :         @derive
     173                 :            :         Inherit from this class giving your additional interface(s) to be implemented as
     174                 :            :         template argument(s). Your sub class defines method implementations for these interface(s).
     175                 :            :     */
     176                 :            :     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
     177         [ -  + ]:      12480 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper6
     178                 :            :         : public BaseClass
     179                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
     180                 :            :     {
     181                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, ImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
     182                 :            :     protected:
     183                 :            :         template< typename T1 >
     184                 :            :         explicit ImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
     185                 :            :         template< typename T1, typename T2 >
     186                 :            :         ImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
     187                 :            :             BaseClass(arg1, arg2) {}
     188                 :            :         template< typename T1, typename T2, typename T3 >
     189                 :            :         ImplInheritanceHelper6(
     190                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3):
     191                 :            :             BaseClass(arg1, arg2, arg3) {}
     192                 :            :         template< typename T1, typename T2, typename T3, typename T4 >
     193                 :      12369 :         ImplInheritanceHelper6(
     194                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
     195                 :      12369 :             BaseClass(arg1, arg2, arg3, arg4) {}
     196                 :            :         template<
     197                 :            :             typename T1, typename T2, typename T3, typename T4, typename T5 >
     198                 :            :         ImplInheritanceHelper6(
     199                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     200                 :            :             T5 const & arg5):
     201                 :            :             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
     202                 :            :         template<
     203                 :            :             typename T1, typename T2, typename T3, typename T4, typename T5,
     204                 :            :             typename T6 >
     205                 :            :         ImplInheritanceHelper6(
     206                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     207                 :            :             T5 const & arg5, T6 const & arg6):
     208                 :            :             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
     209                 :            :     public:
     210                 :        279 :         ImplInheritanceHelper6() {}
     211                 :     394156 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     212                 :            :             {
     213 [ +  - ][ +  - ]:     394156 :                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
     214         [ +  + ]:     394156 :                 if (aRet.hasValue())
     215                 :     228560 :                     return aRet;
     216         [ +  - ]:     394156 :                 return BaseClass::queryInterface( rType );
     217                 :            :             }
     218                 :    2511607 :         virtual void SAL_CALL acquire() throw ()
     219                 :    2511607 :             { BaseClass::acquire(); }
     220                 :    2510989 :         virtual void SAL_CALL release() throw ()
     221                 :    2510989 :             { BaseClass::release(); }
     222                 :          0 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
     223 [ #  # ][ #  # ]:          0 :             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
     224                 :          0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
     225                 :          0 :             { return ImplHelper_getImplementationId( cd::get() ); }
     226                 :            :     };
     227                 :            :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     228                 :            :         com::sun::star::uno::XInterface inherting from a BaseClass.
     229                 :            :         All acquire(),  release() and queryInterface() calls are delegated to the BaseClass.
     230                 :            :         Upon queryAggregation(), if a demanded interface is not supported by this class directly,
     231                 :            :         the request is delegated to the BaseClass.
     232                 :            : 
     233                 :            :         @attention
     234                 :            :         The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface,
     235                 :            :         com::sun::star::uno::XAggregation and com::sun::star::lang::XTypeProvider
     236                 :            :         are implemented properly.  The BaseClass must have at least one ctor
     237                 :            :         that can be called with six or fewer arguments, of which none is of
     238                 :            :         non-const reference type.
     239                 :            : 
     240                 :            :         @derive
     241                 :            :         Inherit from this class giving your additional interface(s) to be implemented as
     242                 :            :         template argument(s). Your sub class defines method implementations for these interface(s).
     243                 :            :     */
     244                 :            :     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
     245                 :            :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper6
     246                 :            :         : public BaseClass
     247                 :            :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
     248                 :            :     {
     249                 :            :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, AggImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
     250                 :            :     protected:
     251                 :            :         template< typename T1 >
     252                 :            :         explicit AggImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
     253                 :            :         template< typename T1, typename T2 >
     254                 :            :         AggImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
     255                 :            :             BaseClass(arg1, arg2) {}
     256                 :            :         template< typename T1, typename T2, typename T3 >
     257                 :            :         AggImplInheritanceHelper6(
     258                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3):
     259                 :            :             BaseClass(arg1, arg2, arg3) {}
     260                 :            :         template< typename T1, typename T2, typename T3, typename T4 >
     261                 :            :         AggImplInheritanceHelper6(
     262                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
     263                 :            :             BaseClass(arg1, arg2, arg3, arg4) {}
     264                 :            :         template<
     265                 :            :             typename T1, typename T2, typename T3, typename T4, typename T5 >
     266                 :            :         AggImplInheritanceHelper6(
     267                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     268                 :            :             T5 const & arg5):
     269                 :            :             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
     270                 :            :         template<
     271                 :            :             typename T1, typename T2, typename T3, typename T4, typename T5,
     272                 :            :             typename T6 >
     273                 :            :         AggImplInheritanceHelper6(
     274                 :            :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     275                 :            :             T5 const & arg5, T6 const & arg6):
     276                 :            :             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
     277                 :            :     public:
     278                 :            :         AggImplInheritanceHelper6() {}
     279                 :            :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     280                 :            :             { return BaseClass::queryInterface( rType ); }
     281                 :            :         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
     282                 :            :             {
     283                 :            :                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
     284                 :            :                 if (aRet.hasValue())
     285                 :            :                     return aRet;
     286                 :            :                 return BaseClass::queryAggregation( rType );
     287                 :            :             }
     288                 :            :         virtual void SAL_CALL acquire() throw ()
     289                 :            :             { BaseClass::acquire(); }
     290                 :            :         virtual void SAL_CALL release() throw ()
     291                 :            :             { BaseClass::release(); }
     292                 :            :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
     293                 :            :             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
     294                 :            :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
     295                 :            :             { return ImplHelper_getImplementationId( cd::get() ); }
     296                 :            :     };
     297                 :            : }
     298                 :            : 
     299                 :            : #endif
     300                 :            : 
     301                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10