LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/cppuhelper - typeprovider.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 9 16 56.2 %
Date: 2012-12-17 Functions: 4 8 50.0 %
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 _CPPUHELPER_TYPEPROVIDER_HXX_
      20             : #define _CPPUHELPER_TYPEPROVIDER_HXX_
      21             : 
      22             : #include <rtl/alloc.h>
      23             : #include <rtl/uuid.h>
      24             : #include <com/sun/star/uno/Sequence.hxx>
      25             : #include "cppuhelperdllapi.h"
      26             : 
      27             : 
      28             : namespace cppu
      29             : {
      30             : 
      31             : /** Helper class to implement com::sun::star::lang::XTypeProvider.  Construct a static object
      32             :     of this class with your UNO object's supported types.
      33             : */
      34           1 : class CPPUHELPER_DLLPUBLIC OTypeCollection
      35             : {
      36             :     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > _aTypes;
      37             : 
      38             : public:
      39             :     /// @cond INTERNAL
      40             :     // these are here to force memory de/allocation to sal lib.
      41           0 :     inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
      42           0 :         { return ::rtl_allocateMemory( nSize ); }
      43           0 :     inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
      44           0 :         { ::rtl_freeMemory( pMem ); }
      45             :     inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(())
      46             :         { return pMem; }
      47             :     inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(())
      48             :         {}
      49             :     /// @endcond
      50             : 
      51           0 :     inline OTypeCollection( const OTypeCollection & rCollection )
      52             :         SAL_THROW(())
      53           0 :         : _aTypes( rCollection._aTypes )
      54           0 :         {}
      55             :     OTypeCollection(
      56             :         const ::com::sun::star::uno::Type & rType1,
      57             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
      58             :         SAL_THROW(());
      59             :     OTypeCollection(
      60             :         const ::com::sun::star::uno::Type & rType1,
      61             :         const ::com::sun::star::uno::Type & rType2,
      62             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
      63             :         SAL_THROW(());
      64             :     OTypeCollection(
      65             :         const ::com::sun::star::uno::Type & rType1,
      66             :         const ::com::sun::star::uno::Type & rType2,
      67             :         const ::com::sun::star::uno::Type & rType3,
      68             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
      69             :         SAL_THROW(());
      70             :     OTypeCollection(
      71             :         const ::com::sun::star::uno::Type & rType1,
      72             :         const ::com::sun::star::uno::Type & rType2,
      73             :         const ::com::sun::star::uno::Type & rType3,
      74             :         const ::com::sun::star::uno::Type & rType4,
      75             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
      76             :         SAL_THROW(());
      77             :     OTypeCollection(
      78             :         const ::com::sun::star::uno::Type & rType1,
      79             :         const ::com::sun::star::uno::Type & rType2,
      80             :         const ::com::sun::star::uno::Type & rType3,
      81             :         const ::com::sun::star::uno::Type & rType4,
      82             :         const ::com::sun::star::uno::Type & rType5,
      83             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
      84             :         SAL_THROW(());
      85             :     OTypeCollection(
      86             :         const ::com::sun::star::uno::Type & rType1,
      87             :         const ::com::sun::star::uno::Type & rType2,
      88             :         const ::com::sun::star::uno::Type & rType3,
      89             :         const ::com::sun::star::uno::Type & rType4,
      90             :         const ::com::sun::star::uno::Type & rType5,
      91             :         const ::com::sun::star::uno::Type & rType6,
      92             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
      93             :         SAL_THROW(());
      94             :     OTypeCollection(
      95             :         const ::com::sun::star::uno::Type & rType1,
      96             :         const ::com::sun::star::uno::Type & rType2,
      97             :         const ::com::sun::star::uno::Type & rType3,
      98             :         const ::com::sun::star::uno::Type & rType4,
      99             :         const ::com::sun::star::uno::Type & rType5,
     100             :         const ::com::sun::star::uno::Type & rType6,
     101             :         const ::com::sun::star::uno::Type & rType7,
     102             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
     103             :         SAL_THROW(());
     104             :     OTypeCollection(
     105             :         const ::com::sun::star::uno::Type & rType1,
     106             :         const ::com::sun::star::uno::Type & rType2,
     107             :         const ::com::sun::star::uno::Type & rType3,
     108             :         const ::com::sun::star::uno::Type & rType4,
     109             :         const ::com::sun::star::uno::Type & rType5,
     110             :         const ::com::sun::star::uno::Type & rType6,
     111             :         const ::com::sun::star::uno::Type & rType7,
     112             :         const ::com::sun::star::uno::Type & rType8,
     113             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
     114             :         SAL_THROW(());
     115             :     OTypeCollection(
     116             :         const ::com::sun::star::uno::Type & rType1,
     117             :         const ::com::sun::star::uno::Type & rType2,
     118             :         const ::com::sun::star::uno::Type & rType3,
     119             :         const ::com::sun::star::uno::Type & rType4,
     120             :         const ::com::sun::star::uno::Type & rType5,
     121             :         const ::com::sun::star::uno::Type & rType6,
     122             :         const ::com::sun::star::uno::Type & rType7,
     123             :         const ::com::sun::star::uno::Type & rType8,
     124             :         const ::com::sun::star::uno::Type & rType9,
     125             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
     126             :         SAL_THROW(());
     127             :     OTypeCollection(
     128             :         const ::com::sun::star::uno::Type & rType1,
     129             :         const ::com::sun::star::uno::Type & rType2,
     130             :         const ::com::sun::star::uno::Type & rType3,
     131             :         const ::com::sun::star::uno::Type & rType4,
     132             :         const ::com::sun::star::uno::Type & rType5,
     133             :         const ::com::sun::star::uno::Type & rType6,
     134             :         const ::com::sun::star::uno::Type & rType7,
     135             :         const ::com::sun::star::uno::Type & rType8,
     136             :         const ::com::sun::star::uno::Type & rType9,
     137             :         const ::com::sun::star::uno::Type & rType10,
     138             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
     139             :         SAL_THROW(());
     140             :     OTypeCollection(
     141             :         const ::com::sun::star::uno::Type & rType1,
     142             :         const ::com::sun::star::uno::Type & rType2,
     143             :         const ::com::sun::star::uno::Type & rType3,
     144             :         const ::com::sun::star::uno::Type & rType4,
     145             :         const ::com::sun::star::uno::Type & rType5,
     146             :         const ::com::sun::star::uno::Type & rType6,
     147             :         const ::com::sun::star::uno::Type & rType7,
     148             :         const ::com::sun::star::uno::Type & rType8,
     149             :         const ::com::sun::star::uno::Type & rType9,
     150             :         const ::com::sun::star::uno::Type & rType10,
     151             :         const ::com::sun::star::uno::Type & rType11,
     152             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
     153             :         SAL_THROW(());
     154             :     OTypeCollection(
     155             :         const ::com::sun::star::uno::Type & rType1,
     156             :         const ::com::sun::star::uno::Type & rType2,
     157             :         const ::com::sun::star::uno::Type & rType3,
     158             :         const ::com::sun::star::uno::Type & rType4,
     159             :         const ::com::sun::star::uno::Type & rType5,
     160             :         const ::com::sun::star::uno::Type & rType6,
     161             :         const ::com::sun::star::uno::Type & rType7,
     162             :         const ::com::sun::star::uno::Type & rType8,
     163             :         const ::com::sun::star::uno::Type & rType9,
     164             :         const ::com::sun::star::uno::Type & rType10,
     165             :         const ::com::sun::star::uno::Type & rType11,
     166             :         const ::com::sun::star::uno::Type & rType12,
     167             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() )
     168             :         SAL_THROW(());
     169             : 
     170             :     /** Called upon XTypeProvider::getTypes().
     171             : 
     172             :         @return type collection
     173             :     */
     174           9 :     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() SAL_THROW(())
     175           9 :         { return _aTypes; }
     176             : };
     177             : 
     178             : /** Helper class to implement com::sun::star::lang::XTypeProvider.  Construct a static object
     179             :     of this class for your UNO object's implementation id.
     180             : */
     181             : class CPPUHELPER_DLLPUBLIC OImplementationId
     182             : {
     183             :     mutable ::com::sun::star::uno::Sequence< sal_Int8 > * _pSeq;
     184             :     sal_Bool _bUseEthernetAddress;
     185             : 
     186             : public:
     187             :     /// @cond INTERNAL
     188             : 
     189             :     // these are here to force memory de/allocation to sal lib.
     190             :     inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
     191             :         { return ::rtl_allocateMemory( nSize ); }
     192             :     inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
     193             :         { ::rtl_freeMemory( pMem ); }
     194             :     inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(())
     195             :         { return pMem; }
     196             :     inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(())
     197             :         {}
     198             : 
     199             :     ~OImplementationId() SAL_THROW(());
     200             : 
     201             :     /// @endcond
     202             : 
     203             :     /** Constructor.
     204             : 
     205             :         @param bUseEthernetAddress whether an ethernet mac address should be taken into account
     206             :     */
     207           7 :     inline OImplementationId( sal_Bool bUseEthernetAddress = sal_True ) SAL_THROW(())
     208             :         : _pSeq( 0 )
     209           7 :         , _bUseEthernetAddress( bUseEthernetAddress )
     210           7 :         {}
     211             :     /** Constructor giving implementation id.
     212             : 
     213             :         @param rSeq implementation id
     214             :     */
     215             :     inline OImplementationId( const ::com::sun::star::uno::Sequence< sal_Int8 > & rSeq ) SAL_THROW(())
     216             :         : _pSeq( new ::com::sun::star::uno::Sequence< sal_Int8 >( rSeq ) )
     217             :         {}
     218           4 :     inline OImplementationId( const OImplementationId & rId ) SAL_THROW(())
     219           4 :         : _pSeq( new ::com::sun::star::uno::Sequence< sal_Int8 >( rId.getImplementationId() ) )
     220           4 :         {}
     221             : 
     222             :     /** Called upon XTypeProvider::getImplementationId().
     223             : 
     224             :         @return implementation id
     225             :     */
     226             :     ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() const SAL_THROW(());
     227             : };
     228             : 
     229             : }
     230             : 
     231             : #endif
     232             : 
     233             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10