LCOV - code coverage report
Current view: top level - include/cppuhelper - implbase5.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 54 69 78.3 %
Date: 2014-11-03 Functions: 372 699 53.2 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #ifndef INCLUDED_CPPUHELPER_IMPLBASE5_HXX
      20             : #define INCLUDED_CPPUHELPER_IMPLBASE5_HXX
      21             : 
      22             : #include <cppuhelper/implbase_ex.hxx>
      23             : #include <rtl/instance.hxx>
      24             : 
      25             : namespace cppu
      26             : {
      27             :     /// @cond INTERNAL
      28             : 
      29             :     struct class_data5
      30             :     {
      31             :         sal_Int16 m_nTypes;
      32             :         sal_Bool m_storedTypeRefs;
      33             :         sal_Bool m_storedId;
      34             :         sal_Int8 m_id[ 16 ];
      35             :         type_entry m_typeEntries[ 5 + 1 ];
      36             :     };
      37             : 
      38             :     template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Impl >
      39             :         struct ImplClassData5
      40             :     {
      41        2391 :         class_data* operator ()()
      42             :         {
      43             :             static class_data5 s_cd =
      44             :             {
      45             :                 5 +1, sal_False, sal_False,
      46             :                 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
      47             :                 {
      48             :                     CPPUHELPER_DETAIL_TYPEENTRY(Ifc1),
      49             :                     CPPUHELPER_DETAIL_TYPEENTRY(Ifc2),
      50             :                     CPPUHELPER_DETAIL_TYPEENTRY(Ifc3),
      51             :                     CPPUHELPER_DETAIL_TYPEENTRY(Ifc4),
      52             :                     CPPUHELPER_DETAIL_TYPEENTRY(Ifc5),
      53             :                     CPPUHELPER_DETAIL_TYPEENTRY(com::sun::star::lang::XTypeProvider)
      54             :                 }
      55             :             };
      56        2391 :             return reinterpret_cast< class_data * >(&s_cd);
      57             :         }
      58             :     };
      59             : 
      60             :     /// @endcond
      61             : 
      62             :     /** Implementation helper implementing interface com::sun::star::lang::XTypeProvider
      63             :         and method XInterface::queryInterface(), but no reference counting.
      64             : 
      65             :         @derive
      66             :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
      67             :         Your sub class defines method implementations for these interface(s) including acquire()/
      68             :         release() and delegates incoming queryInterface() calls to this base class.
      69             :     */
      70             :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
      71         550 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper5
      72             :         : public com::sun::star::lang::XTypeProvider
      73             :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
      74             :     {
      75             :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, ImplHelper5<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
      76             :     public:
      77         490 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      78         490 :             { return ImplHelper_query( rType, cd::get(), this ); }
      79           0 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      80           0 :             { return ImplHelper_getTypes( cd::get() ); }
      81           0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      82           0 :             { return ImplHelper_getImplementationId( cd::get() ); }
      83             : 
      84             : #if !defined _MSC_VER // public -> protected changes mangled names there
      85             :     protected:
      86             : #endif
      87         544 :         ~ImplHelper5() throw () {}
      88             :     };
      89             :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
      90             :         com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
      91             :         (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakObject).
      92             : 
      93             :         @derive
      94             :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
      95             :         Your sub class defines method implementations for these interface(s).
      96             :     */
      97             :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
      98     1811582 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper5
      99             :         : public OWeakObject
     100             :         , public com::sun::star::lang::XTypeProvider
     101             :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
     102             :     {
     103             :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, WeakImplHelper5<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
     104             :     public:
     105     2789500 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     106     2789500 :             { return WeakImplHelper_query( rType, cd::get(), this, static_cast<OWeakObject *>(this) ); }
     107     9766970 :         virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
     108     9766970 :             { OWeakObject::acquire(); }
     109     9764436 :         virtual void SAL_CALL release() throw () SAL_OVERRIDE
     110     9764436 :             { OWeakObject::release(); }
     111         140 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     112         140 :             { return WeakImplHelper_getTypes( cd::get() ); }
     113           0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     114           0 :             { return ImplHelper_getImplementationId( cd::get() ); }
     115             :     };
     116             :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     117             :         com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
     118             :         (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakAggObject).
     119             :         In addition, it supports also aggregation meaning object of this class can be aggregated
     120             :         (com::sun::star::uno::XAggregation thru ::cppu::OWeakAggObject).
     121             :         If a delegator is set (this object is aggregated), then incoming queryInterface()
     122             :         calls are delegated to the delegator object. If the delegator does not support the
     123             :         demanded interface, it calls queryAggregation() on its aggregated objects.
     124             : 
     125             :         @derive
     126             :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
     127             :         Your sub class defines method implementations for these interface(s).
     128             :     */
     129             :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
     130       98381 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper5
     131             :         : public OWeakAggObject
     132             :         , public com::sun::star::lang::XTypeProvider
     133             :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
     134             :     {
     135             :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, WeakAggImplHelper5<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
     136             :     public:
     137      357336 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     138      357336 :             { return OWeakAggObject::queryInterface( rType ); }
     139      357336 :         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     140      357336 :             { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, static_cast<OWeakAggObject *>(this) ); }
     141     1552234 :         virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
     142     1552234 :             { OWeakAggObject::acquire(); }
     143     1552217 :         virtual void SAL_CALL release() throw () SAL_OVERRIDE
     144     1552217 :             { OWeakAggObject::release(); }
     145           0 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     146           0 :             { return WeakAggImplHelper_getTypes( cd::get() ); }
     147           0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     148           0 :             { return ImplHelper_getImplementationId( cd::get() ); }
     149             :     };
     150             :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     151             :         com::sun::star::uno::XInterface inherting from a BaseClass.
     152             :         All acquire() and release() calls are delegated to the BaseClass. Upon queryInterface(),
     153             :         if a demanded interface is not supported by this class directly, the request is
     154             :         delegated to the BaseClass.
     155             : 
     156             :         @attention
     157             :         The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface
     158             :         and com::sun::star::lang::XTypeProvider are implemented properly.  The
     159             :         BaseClass must have at least one ctor that can be called with six or
     160             :         fewer arguments, of which none is of non-const reference type.
     161             : 
     162             :         @derive
     163             :         Inherit from this class giving your additional interface(s) to be implemented as
     164             :         template argument(s). Your sub class defines method implementations for these interface(s).
     165             :     */
     166             :     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
     167       42169 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper5
     168             :         : public BaseClass
     169             :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
     170             :     {
     171             :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, ImplInheritanceHelper5<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
     172             :     protected:
     173             :         template< typename T1 >
     174           0 :         explicit ImplInheritanceHelper5(T1 const & arg1): BaseClass(arg1) {}
     175             :         template< typename T1, typename T2 >
     176             :         ImplInheritanceHelper5(T1 const & arg1, T2 const & arg2):
     177             :             BaseClass(arg1, arg2) {}
     178             :         template< typename T1, typename T2, typename T3 >
     179             :         ImplInheritanceHelper5(
     180             :             T1 const & arg1, T2 const & arg2, T3 const & arg3):
     181             :             BaseClass(arg1, arg2, arg3) {}
     182             :         template< typename T1, typename T2, typename T3, typename T4 >
     183       28762 :         ImplInheritanceHelper5(
     184             :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
     185       28762 :             BaseClass(arg1, arg2, arg3, arg4) {}
     186             :         template<
     187             :             typename T1, typename T2, typename T3, typename T4, typename T5 >
     188             :         ImplInheritanceHelper5(
     189             :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     190             :             T5 const & arg5):
     191             :             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
     192             :         template<
     193             :             typename T1, typename T2, typename T3, typename T4, typename T5,
     194             :             typename T6 >
     195             :         ImplInheritanceHelper5(
     196             :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     197             :             T5 const & arg5, T6 const & arg6):
     198             :             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
     199             :     public:
     200       13439 :         ImplInheritanceHelper5() {}
     201      248633 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     202             :             {
     203      248633 :                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
     204      248633 :                 if (aRet.hasValue())
     205      121592 :                     return aRet;
     206      127041 :                 return BaseClass::queryInterface( rType );
     207             :             }
     208     1261413 :         virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
     209     1261413 :             { BaseClass::acquire(); }
     210      411529 :         virtual void SAL_CALL release() throw () SAL_OVERRIDE
     211      411529 :             { BaseClass::release(); }
     212           2 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     213           2 :             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
     214           0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     215           0 :             { return ImplHelper_getImplementationId( cd::get() ); }
     216             :     };
     217             :     /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
     218             :         com::sun::star::uno::XInterface inherting from a BaseClass.
     219             :         All acquire(),  release() and queryInterface() calls are delegated to the BaseClass.
     220             :         Upon queryAggregation(), if a demanded interface is not supported by this class directly,
     221             :         the request is delegated to the BaseClass.
     222             : 
     223             :         @attention
     224             :         The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface,
     225             :         com::sun::star::uno::XAggregation and com::sun::star::lang::XTypeProvider
     226             :         are implemented properly.  The BaseClass must have at least one ctor
     227             :         that can be called with six or fewer arguments, of which none is of
     228             :         non-const reference type.
     229             : 
     230             :         @derive
     231             :         Inherit from this class giving your additional interface(s) to be implemented as
     232             :         template argument(s). Your sub class defines method implementations for these interface(s).
     233             :     */
     234             :     template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
     235          12 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper5
     236             :         : public BaseClass
     237             :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
     238             :     {
     239             :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, AggImplInheritanceHelper5<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
     240             :     protected:
     241             :         template< typename T1 >
     242             :         explicit AggImplInheritanceHelper5(T1 const & arg1): BaseClass(arg1) {}
     243             :         template< typename T1, typename T2 >
     244             :         AggImplInheritanceHelper5(T1 const & arg1, T2 const & arg2):
     245             :             BaseClass(arg1, arg2) {}
     246             :         template< typename T1, typename T2, typename T3 >
     247             :         AggImplInheritanceHelper5(
     248             :             T1 const & arg1, T2 const & arg2, T3 const & arg3):
     249             :             BaseClass(arg1, arg2, arg3) {}
     250             :         template< typename T1, typename T2, typename T3, typename T4 >
     251             :         AggImplInheritanceHelper5(
     252             :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
     253             :             BaseClass(arg1, arg2, arg3, arg4) {}
     254             :         template<
     255             :             typename T1, typename T2, typename T3, typename T4, typename T5 >
     256             :         AggImplInheritanceHelper5(
     257             :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     258             :             T5 const & arg5):
     259             :             BaseClass(arg1, arg2, arg3, arg4, arg5) {}
     260             :         template<
     261             :             typename T1, typename T2, typename T3, typename T4, typename T5,
     262             :             typename T6 >
     263             :         AggImplInheritanceHelper5(
     264             :             T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
     265             :             T5 const & arg5, T6 const & arg6):
     266             :             BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
     267             :     public:
     268          36 :         AggImplInheritanceHelper5() {}
     269        1257 :         virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     270        1257 :             { return BaseClass::queryInterface( rType ); }
     271         950 :         virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     272             :             {
     273         950 :                 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
     274         950 :                 if (aRet.hasValue())
     275         164 :                     return aRet;
     276         786 :                 return BaseClass::queryAggregation( rType );
     277             :             }
     278        5113 :         virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
     279        5113 :             { BaseClass::acquire(); }
     280        5039 :         virtual void SAL_CALL release() throw () SAL_OVERRIDE
     281        5039 :             { BaseClass::release(); }
     282          48 :         virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     283          48 :             { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
     284           0 :         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     285           0 :             { return ImplHelper_getImplementationId( cd::get() ); }
     286             :     };
     287             : }
     288             : 
     289             : #endif
     290             : 
     291             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10