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

Generated by: LCOV version 1.11