LCOV - code coverage report
Current view: top level - cppuhelper/source - typeprovider.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 76 144 52.8 %
Date: 2014-11-03 Functions: 9 15 60.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             : 
      20             : 
      21             : #include <cppuhelper/typeprovider.hxx>
      22             : #include <osl/mutex.hxx>
      23             : 
      24             : using namespace osl;
      25             : using namespace com::sun::star::uno;
      26             : 
      27             : namespace cppu
      28             : {
      29             : 
      30             : 
      31         464 : OImplementationId::~OImplementationId()
      32             : {
      33         464 :     delete _pSeq;
      34         464 : }
      35             : 
      36      710448 : Sequence< sal_Int8 > OImplementationId::getImplementationId() const
      37             : {
      38      710448 :     if (! _pSeq)
      39             :     {
      40         462 :         MutexGuard aGuard( Mutex::getGlobalMutex() );
      41         462 :         if (! _pSeq)
      42             :         {
      43         462 :             Sequence< sal_Int8 > * pSeq = new Sequence< sal_Int8 >( 16 );
      44         462 :             ::rtl_createUuid( (sal_uInt8 *)pSeq->getArray(), 0, _bUseEthernetAddress );
      45         462 :             _pSeq = pSeq;
      46         462 :         }
      47             :     }
      48      710448 :     return *_pSeq;
      49             : }
      50             : 
      51             : 
      52         372 : static inline void copy( Sequence< Type > & rDest, const Sequence< Type > & rSource, sal_Int32 nOffset )
      53             : {
      54         372 :     Type * pDest = rDest.getArray();
      55         372 :     const Type * pSource = rSource.getConstArray();
      56             : 
      57        1122 :     for ( sal_Int32 nPos = rSource.getLength(); nPos--; )
      58         378 :         pDest[nOffset+ nPos] = pSource[nPos];
      59         372 : }
      60             : 
      61             : 
      62          16 : OTypeCollection::OTypeCollection(
      63             :     const Type & rType1,
      64             :     const Sequence< Type > & rAddTypes )
      65          16 :     : _aTypes( 1 + rAddTypes.getLength() )
      66             : {
      67          16 :     _aTypes[0] = rType1;
      68          16 :     copy( _aTypes, rAddTypes, 1 );
      69          16 : }
      70             : 
      71           0 : OTypeCollection::OTypeCollection(
      72             :     const Type & rType1,
      73             :     const Type & rType2,
      74             :     const Sequence< Type > & rAddTypes )
      75           0 :     : _aTypes( 2 + rAddTypes.getLength() )
      76             : {
      77           0 :     _aTypes[0] = rType1;
      78           0 :     _aTypes[1] = rType2;
      79           0 :     copy( _aTypes, rAddTypes, 2 );
      80           0 : }
      81             : 
      82         338 : OTypeCollection::OTypeCollection(
      83             :     const Type & rType1,
      84             :     const Type & rType2,
      85             :     const Type & rType3,
      86             :     const Sequence< Type > & rAddTypes )
      87         338 :     : _aTypes( 3 + rAddTypes.getLength() )
      88             : {
      89         338 :     _aTypes[0] = rType1;
      90         338 :     _aTypes[1] = rType2;
      91         338 :     _aTypes[2] = rType3;
      92         338 :     copy( _aTypes, rAddTypes, 3 );
      93         338 : }
      94             : 
      95          10 : OTypeCollection::OTypeCollection(
      96             :     const Type & rType1,
      97             :     const Type & rType2,
      98             :     const Type & rType3,
      99             :     const Type & rType4,
     100             :     const Sequence< Type > & rAddTypes )
     101          10 :     : _aTypes( 4 + rAddTypes.getLength() )
     102             : {
     103          10 :     _aTypes[0] = rType1;
     104          10 :     _aTypes[1] = rType2;
     105          10 :     _aTypes[2] = rType3;
     106          10 :     _aTypes[3] = rType4;
     107          10 :     copy( _aTypes, rAddTypes, 4 );
     108          10 : }
     109             : 
     110           4 : OTypeCollection::OTypeCollection(
     111             :     const Type & rType1,
     112             :     const Type & rType2,
     113             :     const Type & rType3,
     114             :     const Type & rType4,
     115             :     const Type & rType5,
     116             :     const Sequence< Type > & rAddTypes )
     117           4 :     : _aTypes( 5 + rAddTypes.getLength() )
     118             : {
     119           4 :     _aTypes[0] = rType1;
     120           4 :     _aTypes[1] = rType2;
     121           4 :     _aTypes[2] = rType3;
     122           4 :     _aTypes[3] = rType4;
     123           4 :     _aTypes[4] = rType5;
     124           4 :     copy( _aTypes, rAddTypes, 5 );
     125           4 : }
     126             : 
     127           0 : OTypeCollection::OTypeCollection(
     128             :     const Type & rType1,
     129             :     const Type & rType2,
     130             :     const Type & rType3,
     131             :     const Type & rType4,
     132             :     const Type & rType5,
     133             :     const Type & rType6,
     134             :     const Sequence< Type > & rAddTypes )
     135           0 :     : _aTypes( 6 + rAddTypes.getLength() )
     136             : {
     137           0 :     _aTypes[0] = rType1;
     138           0 :     _aTypes[1] = rType2;
     139           0 :     _aTypes[2] = rType3;
     140           0 :     _aTypes[3] = rType4;
     141           0 :     _aTypes[4] = rType5;
     142           0 :     _aTypes[5] = rType6;
     143           0 :     copy( _aTypes, rAddTypes, 6 );
     144           0 : }
     145             : 
     146           0 : OTypeCollection::OTypeCollection(
     147             :     const Type & rType1,
     148             :     const Type & rType2,
     149             :     const Type & rType3,
     150             :     const Type & rType4,
     151             :     const Type & rType5,
     152             :     const Type & rType6,
     153             :     const Type & rType7,
     154             :     const Sequence< Type > & rAddTypes )
     155           0 :     : _aTypes( 7 + rAddTypes.getLength() )
     156             : {
     157           0 :     _aTypes[0] = rType1;
     158           0 :     _aTypes[1] = rType2;
     159           0 :     _aTypes[2] = rType3;
     160           0 :     _aTypes[3] = rType4;
     161           0 :     _aTypes[4] = rType5;
     162           0 :     _aTypes[5] = rType6;
     163           0 :     _aTypes[6] = rType7;
     164           0 :     copy( _aTypes, rAddTypes, 7 );
     165           0 : }
     166             : 
     167           0 : OTypeCollection::OTypeCollection(
     168             :     const Type & rType1,
     169             :     const Type & rType2,
     170             :     const Type & rType3,
     171             :     const Type & rType4,
     172             :     const Type & rType5,
     173             :     const Type & rType6,
     174             :     const Type & rType7,
     175             :     const Type & rType8,
     176             :     const Sequence< Type > & rAddTypes )
     177           0 :     : _aTypes( 8 + rAddTypes.getLength() )
     178             : {
     179           0 :     _aTypes[0] = rType1;
     180           0 :     _aTypes[1] = rType2;
     181           0 :     _aTypes[2] = rType3;
     182           0 :     _aTypes[3] = rType4;
     183           0 :     _aTypes[4] = rType5;
     184           0 :     _aTypes[5] = rType6;
     185           0 :     _aTypes[6] = rType7;
     186           0 :     _aTypes[7] = rType8;
     187           0 :     copy( _aTypes, rAddTypes, 8 );
     188           0 : }
     189             : 
     190           2 : OTypeCollection::OTypeCollection(
     191             :     const Type & rType1,
     192             :     const Type & rType2,
     193             :     const Type & rType3,
     194             :     const Type & rType4,
     195             :     const Type & rType5,
     196             :     const Type & rType6,
     197             :     const Type & rType7,
     198             :     const Type & rType8,
     199             :     const Type & rType9,
     200             :     const Sequence< Type > & rAddTypes )
     201           2 :     : _aTypes( 9 + rAddTypes.getLength() )
     202             : {
     203           2 :     _aTypes[0] = rType1;
     204           2 :     _aTypes[1] = rType2;
     205           2 :     _aTypes[2] = rType3;
     206           2 :     _aTypes[3] = rType4;
     207           2 :     _aTypes[4] = rType5;
     208           2 :     _aTypes[5] = rType6;
     209           2 :     _aTypes[6] = rType7;
     210           2 :     _aTypes[7] = rType8;
     211           2 :     _aTypes[8] = rType9;
     212           2 :     copy( _aTypes, rAddTypes, 9 );
     213           2 : }
     214             : 
     215           0 : OTypeCollection::OTypeCollection(
     216             :     const Type & rType1,
     217             :     const Type & rType2,
     218             :     const Type & rType3,
     219             :     const Type & rType4,
     220             :     const Type & rType5,
     221             :     const Type & rType6,
     222             :     const Type & rType7,
     223             :     const Type & rType8,
     224             :     const Type & rType9,
     225             :     const Type & rType10,
     226             :     const Sequence< Type > & rAddTypes )
     227           0 :     : _aTypes( 10 + rAddTypes.getLength() )
     228             : {
     229           0 :     _aTypes[0] = rType1;
     230           0 :     _aTypes[1] = rType2;
     231           0 :     _aTypes[2] = rType3;
     232           0 :     _aTypes[3] = rType4;
     233           0 :     _aTypes[4] = rType5;
     234           0 :     _aTypes[5] = rType6;
     235           0 :     _aTypes[6] = rType7;
     236           0 :     _aTypes[7] = rType8;
     237           0 :     _aTypes[8] = rType9;
     238           0 :     _aTypes[9] = rType10;
     239           0 :     copy( _aTypes, rAddTypes, 10 );
     240           0 : }
     241             : 
     242           0 : OTypeCollection::OTypeCollection(
     243             :     const Type & rType1,
     244             :     const Type & rType2,
     245             :     const Type & rType3,
     246             :     const Type & rType4,
     247             :     const Type & rType5,
     248             :     const Type & rType6,
     249             :     const Type & rType7,
     250             :     const Type & rType8,
     251             :     const Type & rType9,
     252             :     const Type & rType10,
     253             :     const Type & rType11,
     254             :     const Sequence< Type > & rAddTypes )
     255           0 :     : _aTypes( 11 + rAddTypes.getLength() )
     256             : {
     257           0 :     _aTypes[0] = rType1;
     258           0 :     _aTypes[1] = rType2;
     259           0 :     _aTypes[2] = rType3;
     260           0 :     _aTypes[3] = rType4;
     261           0 :     _aTypes[4] = rType5;
     262           0 :     _aTypes[5] = rType6;
     263           0 :     _aTypes[6] = rType7;
     264           0 :     _aTypes[7] = rType8;
     265           0 :     _aTypes[8] = rType9;
     266           0 :     _aTypes[9] = rType10;
     267           0 :     _aTypes[10] = rType11;
     268           0 :     copy( _aTypes, rAddTypes, 11 );
     269           0 : }
     270             : 
     271           2 : OTypeCollection::OTypeCollection(
     272             :     const Type & rType1,
     273             :     const Type & rType2,
     274             :     const Type & rType3,
     275             :     const Type & rType4,
     276             :     const Type & rType5,
     277             :     const Type & rType6,
     278             :     const Type & rType7,
     279             :     const Type & rType8,
     280             :     const Type & rType9,
     281             :     const Type & rType10,
     282             :     const Type & rType11,
     283             :     const Type & rType12,
     284             :     const Sequence< Type > & rAddTypes )
     285           2 :     : _aTypes( 12 + rAddTypes.getLength() )
     286             : {
     287           2 :     _aTypes[0] = rType1;
     288           2 :     _aTypes[1] = rType2;
     289           2 :     _aTypes[2] = rType3;
     290           2 :     _aTypes[3] = rType4;
     291           2 :     _aTypes[4] = rType5;
     292           2 :     _aTypes[5] = rType6;
     293           2 :     _aTypes[6] = rType7;
     294           2 :     _aTypes[7] = rType8;
     295           2 :     _aTypes[8] = rType9;
     296           2 :     _aTypes[9] = rType10;
     297           2 :     _aTypes[10] = rType11;
     298           2 :     _aTypes[11] = rType12;
     299           2 :     copy( _aTypes, rAddTypes, 12 );
     300           2 : }
     301             : 
     302             : }
     303             : 
     304             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10