bump product version to 4.1.6.2
[LibreOffice.git] / cppuhelper / source / typeprovider.cxx
blobad8586f5eda897f840ae0bf64d7862fc9980d086
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
24 using namespace osl;
25 using namespace com::sun::star::uno;
27 namespace cppu
30 //__________________________________________________________________________________________________
31 OImplementationId::~OImplementationId() SAL_THROW(())
33 delete _pSeq;
35 //__________________________________________________________________________________________________
36 Sequence< sal_Int8 > OImplementationId::getImplementationId() const SAL_THROW(())
38 if (! _pSeq)
40 MutexGuard aGuard( Mutex::getGlobalMutex() );
41 if (! _pSeq)
43 Sequence< sal_Int8 > * pSeq = new Sequence< sal_Int8 >( 16 );
44 ::rtl_createUuid( (sal_uInt8 *)pSeq->getArray(), 0, _bUseEthernetAddress );
45 _pSeq = pSeq;
48 return *_pSeq;
51 //--------------------------------------------------------------------------------------------------
52 static inline void copy( Sequence< Type > & rDest, const Sequence< Type > & rSource, sal_Int32 nOffset )
53 SAL_THROW(())
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(
64 const Type & rType1,
65 const Sequence< Type > & rAddTypes )
66 SAL_THROW(())
67 : _aTypes( 1 + rAddTypes.getLength() )
69 _aTypes[0] = rType1;
70 copy( _aTypes, rAddTypes, 1 );
72 //__________________________________________________________________________________________________
73 OTypeCollection::OTypeCollection(
74 const Type & rType1,
75 const Type & rType2,
76 const Sequence< Type > & rAddTypes )
77 SAL_THROW(())
78 : _aTypes( 2 + rAddTypes.getLength() )
80 _aTypes[0] = rType1;
81 _aTypes[1] = rType2;
82 copy( _aTypes, rAddTypes, 2 );
84 //__________________________________________________________________________________________________
85 OTypeCollection::OTypeCollection(
86 const Type & rType1,
87 const Type & rType2,
88 const Type & rType3,
89 const Sequence< Type > & rAddTypes )
90 SAL_THROW(())
91 : _aTypes( 3 + rAddTypes.getLength() )
93 _aTypes[0] = rType1;
94 _aTypes[1] = rType2;
95 _aTypes[2] = rType3;
96 copy( _aTypes, rAddTypes, 3 );
98 //__________________________________________________________________________________________________
99 OTypeCollection::OTypeCollection(
100 const Type & rType1,
101 const Type & rType2,
102 const Type & rType3,
103 const Type & rType4,
104 const Sequence< Type > & rAddTypes )
105 SAL_THROW(())
106 : _aTypes( 4 + rAddTypes.getLength() )
108 _aTypes[0] = rType1;
109 _aTypes[1] = rType2;
110 _aTypes[2] = rType3;
111 _aTypes[3] = rType4;
112 copy( _aTypes, rAddTypes, 4 );
114 //__________________________________________________________________________________________________
115 OTypeCollection::OTypeCollection(
116 const Type & rType1,
117 const Type & rType2,
118 const Type & rType3,
119 const Type & rType4,
120 const Type & rType5,
121 const Sequence< Type > & rAddTypes )
122 SAL_THROW(())
123 : _aTypes( 5 + rAddTypes.getLength() )
125 _aTypes[0] = rType1;
126 _aTypes[1] = rType2;
127 _aTypes[2] = rType3;
128 _aTypes[3] = rType4;
129 _aTypes[4] = rType5;
130 copy( _aTypes, rAddTypes, 5 );
132 //__________________________________________________________________________________________________
133 OTypeCollection::OTypeCollection(
134 const Type & rType1,
135 const Type & rType2,
136 const Type & rType3,
137 const Type & rType4,
138 const Type & rType5,
139 const Type & rType6,
140 const Sequence< Type > & rAddTypes )
141 SAL_THROW(())
142 : _aTypes( 6 + rAddTypes.getLength() )
144 _aTypes[0] = rType1;
145 _aTypes[1] = rType2;
146 _aTypes[2] = rType3;
147 _aTypes[3] = rType4;
148 _aTypes[4] = rType5;
149 _aTypes[5] = rType6;
150 copy( _aTypes, rAddTypes, 6 );
152 //__________________________________________________________________________________________________
153 OTypeCollection::OTypeCollection(
154 const Type & rType1,
155 const Type & rType2,
156 const Type & rType3,
157 const Type & rType4,
158 const Type & rType5,
159 const Type & rType6,
160 const Type & rType7,
161 const Sequence< Type > & rAddTypes )
162 SAL_THROW(())
163 : _aTypes( 7 + rAddTypes.getLength() )
165 _aTypes[0] = rType1;
166 _aTypes[1] = rType2;
167 _aTypes[2] = rType3;
168 _aTypes[3] = rType4;
169 _aTypes[4] = rType5;
170 _aTypes[5] = rType6;
171 _aTypes[6] = rType7;
172 copy( _aTypes, rAddTypes, 7 );
174 //__________________________________________________________________________________________________
175 OTypeCollection::OTypeCollection(
176 const Type & rType1,
177 const Type & rType2,
178 const Type & rType3,
179 const Type & rType4,
180 const Type & rType5,
181 const Type & rType6,
182 const Type & rType7,
183 const Type & rType8,
184 const Sequence< Type > & rAddTypes )
185 SAL_THROW(())
186 : _aTypes( 8 + rAddTypes.getLength() )
188 _aTypes[0] = rType1;
189 _aTypes[1] = rType2;
190 _aTypes[2] = rType3;
191 _aTypes[3] = rType4;
192 _aTypes[4] = rType5;
193 _aTypes[5] = rType6;
194 _aTypes[6] = rType7;
195 _aTypes[7] = rType8;
196 copy( _aTypes, rAddTypes, 8 );
198 //__________________________________________________________________________________________________
199 OTypeCollection::OTypeCollection(
200 const Type & rType1,
201 const Type & rType2,
202 const Type & rType3,
203 const Type & rType4,
204 const Type & rType5,
205 const Type & rType6,
206 const Type & rType7,
207 const Type & rType8,
208 const Type & rType9,
209 const Sequence< Type > & rAddTypes )
210 SAL_THROW(())
211 : _aTypes( 9 + rAddTypes.getLength() )
213 _aTypes[0] = rType1;
214 _aTypes[1] = rType2;
215 _aTypes[2] = rType3;
216 _aTypes[3] = rType4;
217 _aTypes[4] = rType5;
218 _aTypes[5] = rType6;
219 _aTypes[6] = rType7;
220 _aTypes[7] = rType8;
221 _aTypes[8] = rType9;
222 copy( _aTypes, rAddTypes, 9 );
224 //__________________________________________________________________________________________________
225 OTypeCollection::OTypeCollection(
226 const Type & rType1,
227 const Type & rType2,
228 const Type & rType3,
229 const Type & rType4,
230 const Type & rType5,
231 const Type & rType6,
232 const Type & rType7,
233 const Type & rType8,
234 const Type & rType9,
235 const Type & rType10,
236 const Sequence< Type > & rAddTypes )
237 SAL_THROW(())
238 : _aTypes( 10 + rAddTypes.getLength() )
240 _aTypes[0] = rType1;
241 _aTypes[1] = rType2;
242 _aTypes[2] = rType3;
243 _aTypes[3] = rType4;
244 _aTypes[4] = rType5;
245 _aTypes[5] = rType6;
246 _aTypes[6] = rType7;
247 _aTypes[7] = rType8;
248 _aTypes[8] = rType9;
249 _aTypes[9] = rType10;
250 copy( _aTypes, rAddTypes, 10 );
252 //__________________________________________________________________________________________________
253 OTypeCollection::OTypeCollection(
254 const Type & rType1,
255 const Type & rType2,
256 const Type & rType3,
257 const Type & rType4,
258 const Type & rType5,
259 const Type & rType6,
260 const Type & rType7,
261 const Type & rType8,
262 const Type & rType9,
263 const Type & rType10,
264 const Type & rType11,
265 const Sequence< Type > & rAddTypes )
266 SAL_THROW(())
267 : _aTypes( 11 + rAddTypes.getLength() )
269 _aTypes[0] = rType1;
270 _aTypes[1] = rType2;
271 _aTypes[2] = rType3;
272 _aTypes[3] = rType4;
273 _aTypes[4] = rType5;
274 _aTypes[5] = rType6;
275 _aTypes[6] = rType7;
276 _aTypes[7] = rType8;
277 _aTypes[8] = rType9;
278 _aTypes[9] = rType10;
279 _aTypes[10] = rType11;
280 copy( _aTypes, rAddTypes, 11 );
282 //__________________________________________________________________________________________________
283 OTypeCollection::OTypeCollection(
284 const Type & rType1,
285 const Type & rType2,
286 const Type & rType3,
287 const Type & rType4,
288 const Type & rType5,
289 const Type & rType6,
290 const Type & rType7,
291 const Type & rType8,
292 const Type & rType9,
293 const Type & rType10,
294 const Type & rType11,
295 const Type & rType12,
296 const Sequence< Type > & rAddTypes )
297 SAL_THROW(())
298 : _aTypes( 12 + rAddTypes.getLength() )
300 _aTypes[0] = rType1;
301 _aTypes[1] = rType2;
302 _aTypes[2] = rType3;
303 _aTypes[3] = rType4;
304 _aTypes[4] = rType5;
305 _aTypes[5] = rType6;
306 _aTypes[6] = rType7;
307 _aTypes[7] = rType8;
308 _aTypes[8] = rType9;
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: */