1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <cppuhelper/typeprovider.hxx>
22 #include <osl/mutex.hxx>
25 using namespace com::sun::star::uno
;
30 //__________________________________________________________________________________________________
31 OImplementationId::~OImplementationId() SAL_THROW(())
35 //__________________________________________________________________________________________________
36 Sequence
< sal_Int8
> OImplementationId::getImplementationId() const SAL_THROW(())
40 MutexGuard
aGuard( Mutex::getGlobalMutex() );
43 Sequence
< sal_Int8
> * pSeq
= new Sequence
< sal_Int8
>( 16 );
44 ::rtl_createUuid( (sal_uInt8
*)pSeq
->getArray(), 0, _bUseEthernetAddress
);
51 //--------------------------------------------------------------------------------------------------
52 static inline void copy( Sequence
< Type
> & rDest
, const Sequence
< Type
> & rSource
, sal_Int32 nOffset
)
55 Type
* pDest
= rDest
.getArray();
56 const Type
* pSource
= rSource
.getConstArray();
58 for ( sal_Int32 nPos
= rSource
.getLength(); nPos
--; )
59 pDest
[nOffset
+ nPos
] = pSource
[nPos
];
62 //__________________________________________________________________________________________________
63 OTypeCollection::OTypeCollection(
65 const Sequence
< Type
> & rAddTypes
)
67 : _aTypes( 1 + rAddTypes
.getLength() )
70 copy( _aTypes
, rAddTypes
, 1 );
72 //__________________________________________________________________________________________________
73 OTypeCollection::OTypeCollection(
76 const Sequence
< Type
> & rAddTypes
)
78 : _aTypes( 2 + rAddTypes
.getLength() )
82 copy( _aTypes
, rAddTypes
, 2 );
84 //__________________________________________________________________________________________________
85 OTypeCollection::OTypeCollection(
89 const Sequence
< Type
> & rAddTypes
)
91 : _aTypes( 3 + rAddTypes
.getLength() )
96 copy( _aTypes
, rAddTypes
, 3 );
98 //__________________________________________________________________________________________________
99 OTypeCollection::OTypeCollection(
104 const Sequence
< Type
> & rAddTypes
)
106 : _aTypes( 4 + rAddTypes
.getLength() )
112 copy( _aTypes
, rAddTypes
, 4 );
114 //__________________________________________________________________________________________________
115 OTypeCollection::OTypeCollection(
121 const Sequence
< Type
> & rAddTypes
)
123 : _aTypes( 5 + rAddTypes
.getLength() )
130 copy( _aTypes
, rAddTypes
, 5 );
132 //__________________________________________________________________________________________________
133 OTypeCollection::OTypeCollection(
140 const Sequence
< Type
> & rAddTypes
)
142 : _aTypes( 6 + rAddTypes
.getLength() )
150 copy( _aTypes
, rAddTypes
, 6 );
152 //__________________________________________________________________________________________________
153 OTypeCollection::OTypeCollection(
161 const Sequence
< Type
> & rAddTypes
)
163 : _aTypes( 7 + rAddTypes
.getLength() )
172 copy( _aTypes
, rAddTypes
, 7 );
174 //__________________________________________________________________________________________________
175 OTypeCollection::OTypeCollection(
184 const Sequence
< Type
> & rAddTypes
)
186 : _aTypes( 8 + rAddTypes
.getLength() )
196 copy( _aTypes
, rAddTypes
, 8 );
198 //__________________________________________________________________________________________________
199 OTypeCollection::OTypeCollection(
209 const Sequence
< Type
> & rAddTypes
)
211 : _aTypes( 9 + rAddTypes
.getLength() )
222 copy( _aTypes
, rAddTypes
, 9 );
224 //__________________________________________________________________________________________________
225 OTypeCollection::OTypeCollection(
235 const Type
& rType10
,
236 const Sequence
< Type
> & rAddTypes
)
238 : _aTypes( 10 + rAddTypes
.getLength() )
249 _aTypes
[9] = rType10
;
250 copy( _aTypes
, rAddTypes
, 10 );
252 //__________________________________________________________________________________________________
253 OTypeCollection::OTypeCollection(
263 const Type
& rType10
,
264 const Type
& rType11
,
265 const Sequence
< Type
> & rAddTypes
)
267 : _aTypes( 11 + rAddTypes
.getLength() )
278 _aTypes
[9] = rType10
;
279 _aTypes
[10] = rType11
;
280 copy( _aTypes
, rAddTypes
, 11 );
282 //__________________________________________________________________________________________________
283 OTypeCollection::OTypeCollection(
293 const Type
& rType10
,
294 const Type
& rType11
,
295 const Type
& rType12
,
296 const Sequence
< Type
> & rAddTypes
)
298 : _aTypes( 12 + rAddTypes
.getLength() )
309 _aTypes
[9] = rType10
;
310 _aTypes
[10] = rType11
;
311 _aTypes
[11] = rType12
;
312 copy( _aTypes
, rAddTypes
, 12 );
317 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */