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

Generated by: LCOV version 1.10