LCOV - code coverage report
Current view: top level - include/cppuhelper - compbase10.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 12 20 60.0 %
Date: 2015-06-13 12:38:46 Functions: 6 11 54.5 %
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_COMPBASE10_HXX
      20             : #define INCLUDED_CPPUHELPER_COMPBASE10_HXX
      21             : 
      22             : #include <cppuhelper/implbase10.hxx>
      23             : #include <cppuhelper/compbase_ex.hxx>
      24             : 
      25             : namespace cppu
      26             : {
      27             : 
      28             :     /** Implementation helper supporting com::sun::star::lang::XTypeProvider and
      29             :         com::sun::star::lang::XComponent.
      30             : 
      31             :         Upon disposing objects of this class, sub-classes receive a disposing()
      32             :         call.  Objects of this class can be held weakly, i.e. by a
      33             :         com::sun::star::uno::WeakReference.
      34             : 
      35             :         @attention
      36             :         The life-cycle of the passed mutex reference has to be longer than objects of this class.
      37             : 
      38             :         @derive
      39             :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
      40             :         Your sub class defines method implementations for these interface(s).
      41             :     */
      42             :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
      43       13713 :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper10
      44             :         : public WeakComponentImplHelperBase
      45             :         , public ::com::sun::star::lang::XTypeProvider
      46             :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
      47             :     {
      48             :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, WeakComponentImplHelper10<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10> > > {};
      49             :     public:
      50       13713 :         inline WeakComponentImplHelper10( ::osl::Mutex & rMutex ) throw ()
      51       13713 :             : WeakComponentImplHelperBase( rMutex )
      52       13713 :             {}
      53      162701 :         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
      54      162701 :             { return WeakComponentImplHelper_query( rType, cd::get(), this, static_cast<WeakComponentImplHelperBase *>(this) ); }
      55      461864 :         virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
      56      461864 :             { WeakComponentImplHelperBase::acquire(); }
      57      461864 :         virtual void SAL_CALL release() throw () SAL_OVERRIDE
      58      461864 :             { WeakComponentImplHelperBase::release(); }
      59       13713 :         virtual void SAL_CALL dispose()throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      60       13713 :             { WeakComponentImplHelperBase::dispose(); }
      61           0 :         virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      62           0 :             { WeakComponentImplHelperBase::addEventListener(xListener); }
      63           0 :         virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      64           0 :             { WeakComponentImplHelperBase::removeEventListener(xListener); }
      65           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
      66           0 :             { return WeakComponentImplHelper_getTypes( cd::get() ); }
      67           0 :         virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      68           0 :             { return ImplHelper_getImplementationId( cd::get() ); }
      69             :     };
      70             : 
      71             :     /** Same as WeakComponentImplHelper10, except doesn't implement
      72             :         addEventListener, removeEventListener and dispose.
      73             : 
      74             :         This requires derived classes to implement those three methods.
      75             :         This makes it possible to implement classes which are required to
      76             :         implement methods from multiple bases which have different
      77             :         addEventListener/removeEventListener signatures without triggering
      78             :         the g++ overloaded-virtual warning
      79             :     */
      80             :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
      81             :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE PartialWeakComponentImplHelper10
      82             :         : public WeakComponentImplHelperBase
      83             :         , public ::com::sun::star::lang::XTypeProvider
      84             :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
      85             :     {
      86             :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, PartialWeakComponentImplHelper10<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10> > > {};
      87             :     public:
      88             :         inline PartialWeakComponentImplHelper10( ::osl::Mutex & rMutex ) throw ()
      89             :             : WeakComponentImplHelperBase( rMutex )
      90             :             {}
      91             :         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
      92             :             { return WeakComponentImplHelper_query( rType, cd::get(), this, static_cast<WeakComponentImplHelperBase *>(this) ); }
      93             :         virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
      94             :             { WeakComponentImplHelperBase::acquire(); }
      95             :         virtual void SAL_CALL release() throw () SAL_OVERRIDE
      96             :             { WeakComponentImplHelperBase::release(); }
      97             :         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      98             :             { return WeakComponentImplHelper_getTypes( cd::get() ); }
      99             :         virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     100             :             { return ImplHelper_getImplementationId( cd::get() ); }
     101             :     };
     102             : 
     103             :     /** Implementation helper supporting com::sun::star::lang::XTypeProvider and
     104             :         com::sun::star::lang::XComponent.
     105             : 
     106             :         Upon disposing objects of this class, sub-classes receive a disposing()
     107             :         call.  Objects of this class can be held weakly, i.e. by a
     108             :         com::sun::star::uno::WeakReference.  Object of this class can be
     109             :         aggregated, i.e. incoming queryInterface() calls are delegated.
     110             : 
     111             :         @attention
     112             :         The life-cycle of the passed mutex reference has to be longer than objects of this class.
     113             : 
     114             :         @derive
     115             :         Inherit from this class giving your interface(s) to be implemented as template argument(s).
     116             :         Your sub class defines method implementations for these interface(s).
     117             : 
     118             :         @deprecated
     119             :     */
     120             :     template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
     121             :     class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper10
     122             :         : public WeakAggComponentImplHelperBase
     123             :         , public ::com::sun::star::lang::XTypeProvider
     124             :         , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10
     125             :     {
     126             :         struct cd : public rtl::StaticAggregate< class_data, ImplClassData10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, WeakAggComponentImplHelper10<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10> > > {};
     127             :     public:
     128             :         inline WeakAggComponentImplHelper10( ::osl::Mutex & rMutex ) throw ()
     129             :             : WeakAggComponentImplHelperBase( rMutex )
     130             :             {}
     131             :         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
     132             :             { return WeakAggComponentImplHelperBase::queryInterface( rType ); }
     133             :         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
     134             :             { return WeakAggComponentImplHelper_queryAgg( rType, cd::get(), this, static_cast<WeakAggComponentImplHelperBase *>(this) ); }
     135             :         virtual void SAL_CALL acquire() throw () SAL_OVERRIDE
     136             :             { WeakAggComponentImplHelperBase::acquire(); }
     137             :         virtual void SAL_CALL release() throw () SAL_OVERRIDE
     138             :             { WeakAggComponentImplHelperBase::release(); }
     139             :         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     140             :             { return WeakAggComponentImplHelper_getTypes( cd::get() ); }
     141             :         virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     142             :             { return ImplHelper_getImplementationId( cd::get() ); }
     143             :     };
     144             : }
     145             : 
     146             : #endif
     147             : 
     148             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11