xref: /AOO41X/main/cppuhelper/source/typeprovider.cxx (revision 9d7e27acf3441a88e7e2e9d0bd0e0c145f24ac0d)
1*9d7e27acSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9d7e27acSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9d7e27acSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9d7e27acSAndrew Rist  * distributed with this work for additional information
6*9d7e27acSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9d7e27acSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9d7e27acSAndrew Rist  * "License"); you may not use this file except in compliance
9*9d7e27acSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*9d7e27acSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*9d7e27acSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9d7e27acSAndrew Rist  * software distributed under the License is distributed on an
15*9d7e27acSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9d7e27acSAndrew Rist  * KIND, either express or implied.  See the License for the
17*9d7e27acSAndrew Rist  * specific language governing permissions and limitations
18*9d7e27acSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*9d7e27acSAndrew Rist  *************************************************************/
21*9d7e27acSAndrew Rist 
22*9d7e27acSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_cppuhelper.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <cppuhelper/typeprovider.hxx>
28cdf0e10cSrcweir #include <osl/mutex.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir using namespace osl;
31cdf0e10cSrcweir using namespace com::sun::star::uno;
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace cppu
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //__________________________________________________________________________________________________
~OImplementationId()37cdf0e10cSrcweir OImplementationId::~OImplementationId() SAL_THROW( () )
38cdf0e10cSrcweir {
39cdf0e10cSrcweir 	delete _pSeq;
40cdf0e10cSrcweir }
41cdf0e10cSrcweir //__________________________________________________________________________________________________
getImplementationId() const42cdf0e10cSrcweir Sequence< sal_Int8 > OImplementationId::getImplementationId() const SAL_THROW( () )
43cdf0e10cSrcweir {
44cdf0e10cSrcweir 	if (! _pSeq)
45cdf0e10cSrcweir 	{
46cdf0e10cSrcweir 		MutexGuard aGuard( Mutex::getGlobalMutex() );
47cdf0e10cSrcweir 		if (! _pSeq)
48cdf0e10cSrcweir 		{
49cdf0e10cSrcweir 			Sequence< sal_Int8 > * pSeq = new Sequence< sal_Int8 >( 16 );
50cdf0e10cSrcweir 			::rtl_createUuid( (sal_uInt8 *)pSeq->getArray(), 0, _bUseEthernetAddress );
51cdf0e10cSrcweir 			_pSeq = pSeq;
52cdf0e10cSrcweir 		}
53cdf0e10cSrcweir 	}
54cdf0e10cSrcweir 	return *_pSeq;
55cdf0e10cSrcweir }
56cdf0e10cSrcweir 
57cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------
copy(Sequence<Type> & rDest,const Sequence<Type> & rSource,sal_Int32 nOffset)58cdf0e10cSrcweir static inline void copy( Sequence< Type > & rDest, const Sequence< Type > & rSource, sal_Int32 nOffset )
59cdf0e10cSrcweir 	SAL_THROW( () )
60cdf0e10cSrcweir {
61cdf0e10cSrcweir 	Type * pDest = rDest.getArray();
62cdf0e10cSrcweir 	const Type * pSource = rSource.getConstArray();
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	for ( sal_Int32 nPos = rSource.getLength(); nPos--; )
65cdf0e10cSrcweir 		pDest[nOffset+ nPos] = pSource[nPos];
66cdf0e10cSrcweir }
67cdf0e10cSrcweir 
68cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Sequence<Type> & rAddTypes)69cdf0e10cSrcweir OTypeCollection::OTypeCollection(
70cdf0e10cSrcweir 	const Type & rType1,
71cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
72cdf0e10cSrcweir 	SAL_THROW( () )
73cdf0e10cSrcweir 	: _aTypes( 1 + rAddTypes.getLength() )
74cdf0e10cSrcweir {
75cdf0e10cSrcweir 	_aTypes[0] = rType1;
76cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 1 );
77cdf0e10cSrcweir }
78cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Sequence<Type> & rAddTypes)79cdf0e10cSrcweir OTypeCollection::OTypeCollection(
80cdf0e10cSrcweir 	const Type & rType1,
81cdf0e10cSrcweir 	const Type & rType2,
82cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
83cdf0e10cSrcweir 	SAL_THROW( () )
84cdf0e10cSrcweir 	: _aTypes( 2 + rAddTypes.getLength() )
85cdf0e10cSrcweir {
86cdf0e10cSrcweir 	_aTypes[0] = rType1;
87cdf0e10cSrcweir 	_aTypes[1] = rType2;
88cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 2 );
89cdf0e10cSrcweir }
90cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Sequence<Type> & rAddTypes)91cdf0e10cSrcweir OTypeCollection::OTypeCollection(
92cdf0e10cSrcweir 	const Type & rType1,
93cdf0e10cSrcweir 	const Type & rType2,
94cdf0e10cSrcweir 	const Type & rType3,
95cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
96cdf0e10cSrcweir 	SAL_THROW( () )
97cdf0e10cSrcweir 	: _aTypes( 3 + rAddTypes.getLength() )
98cdf0e10cSrcweir {
99cdf0e10cSrcweir 	_aTypes[0] = rType1;
100cdf0e10cSrcweir 	_aTypes[1] = rType2;
101cdf0e10cSrcweir 	_aTypes[2] = rType3;
102cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 3 );
103cdf0e10cSrcweir }
104cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Type & rType4,const Sequence<Type> & rAddTypes)105cdf0e10cSrcweir OTypeCollection::OTypeCollection(
106cdf0e10cSrcweir 	const Type & rType1,
107cdf0e10cSrcweir 	const Type & rType2,
108cdf0e10cSrcweir 	const Type & rType3,
109cdf0e10cSrcweir 	const Type & rType4,
110cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
111cdf0e10cSrcweir 	SAL_THROW( () )
112cdf0e10cSrcweir 	: _aTypes( 4 + rAddTypes.getLength() )
113cdf0e10cSrcweir {
114cdf0e10cSrcweir 	_aTypes[0] = rType1;
115cdf0e10cSrcweir 	_aTypes[1] = rType2;
116cdf0e10cSrcweir 	_aTypes[2] = rType3;
117cdf0e10cSrcweir 	_aTypes[3] = rType4;
118cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 4 );
119cdf0e10cSrcweir }
120cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Type & rType4,const Type & rType5,const Sequence<Type> & rAddTypes)121cdf0e10cSrcweir OTypeCollection::OTypeCollection(
122cdf0e10cSrcweir 	const Type & rType1,
123cdf0e10cSrcweir 	const Type & rType2,
124cdf0e10cSrcweir 	const Type & rType3,
125cdf0e10cSrcweir 	const Type & rType4,
126cdf0e10cSrcweir 	const Type & rType5,
127cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
128cdf0e10cSrcweir 	SAL_THROW( () )
129cdf0e10cSrcweir 	: _aTypes( 5 + rAddTypes.getLength() )
130cdf0e10cSrcweir {
131cdf0e10cSrcweir 	_aTypes[0] = rType1;
132cdf0e10cSrcweir 	_aTypes[1] = rType2;
133cdf0e10cSrcweir 	_aTypes[2] = rType3;
134cdf0e10cSrcweir 	_aTypes[3] = rType4;
135cdf0e10cSrcweir 	_aTypes[4] = rType5;
136cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 5 );
137cdf0e10cSrcweir }
138cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Type & rType4,const Type & rType5,const Type & rType6,const Sequence<Type> & rAddTypes)139cdf0e10cSrcweir OTypeCollection::OTypeCollection(
140cdf0e10cSrcweir 	const Type & rType1,
141cdf0e10cSrcweir 	const Type & rType2,
142cdf0e10cSrcweir 	const Type & rType3,
143cdf0e10cSrcweir 	const Type & rType4,
144cdf0e10cSrcweir 	const Type & rType5,
145cdf0e10cSrcweir 	const Type & rType6,
146cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
147cdf0e10cSrcweir 	SAL_THROW( () )
148cdf0e10cSrcweir 	: _aTypes( 6 + rAddTypes.getLength() )
149cdf0e10cSrcweir {
150cdf0e10cSrcweir 	_aTypes[0] = rType1;
151cdf0e10cSrcweir 	_aTypes[1] = rType2;
152cdf0e10cSrcweir 	_aTypes[2] = rType3;
153cdf0e10cSrcweir 	_aTypes[3] = rType4;
154cdf0e10cSrcweir 	_aTypes[4] = rType5;
155cdf0e10cSrcweir 	_aTypes[5] = rType6;
156cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 6 );
157cdf0e10cSrcweir }
158cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Type & rType4,const Type & rType5,const Type & rType6,const Type & rType7,const Sequence<Type> & rAddTypes)159cdf0e10cSrcweir OTypeCollection::OTypeCollection(
160cdf0e10cSrcweir 	const Type & rType1,
161cdf0e10cSrcweir 	const Type & rType2,
162cdf0e10cSrcweir 	const Type & rType3,
163cdf0e10cSrcweir 	const Type & rType4,
164cdf0e10cSrcweir 	const Type & rType5,
165cdf0e10cSrcweir 	const Type & rType6,
166cdf0e10cSrcweir 	const Type & rType7,
167cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
168cdf0e10cSrcweir 	SAL_THROW( () )
169cdf0e10cSrcweir 	: _aTypes( 7 + rAddTypes.getLength() )
170cdf0e10cSrcweir {
171cdf0e10cSrcweir 	_aTypes[0] = rType1;
172cdf0e10cSrcweir 	_aTypes[1] = rType2;
173cdf0e10cSrcweir 	_aTypes[2] = rType3;
174cdf0e10cSrcweir 	_aTypes[3] = rType4;
175cdf0e10cSrcweir 	_aTypes[4] = rType5;
176cdf0e10cSrcweir 	_aTypes[5] = rType6;
177cdf0e10cSrcweir 	_aTypes[6] = rType7;
178cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 7 );
179cdf0e10cSrcweir }
180cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Type & rType4,const Type & rType5,const Type & rType6,const Type & rType7,const Type & rType8,const Sequence<Type> & rAddTypes)181cdf0e10cSrcweir OTypeCollection::OTypeCollection(
182cdf0e10cSrcweir 	const Type & rType1,
183cdf0e10cSrcweir 	const Type & rType2,
184cdf0e10cSrcweir 	const Type & rType3,
185cdf0e10cSrcweir 	const Type & rType4,
186cdf0e10cSrcweir 	const Type & rType5,
187cdf0e10cSrcweir 	const Type & rType6,
188cdf0e10cSrcweir 	const Type & rType7,
189cdf0e10cSrcweir 	const Type & rType8,
190cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
191cdf0e10cSrcweir 	SAL_THROW( () )
192cdf0e10cSrcweir 	: _aTypes( 8 + rAddTypes.getLength() )
193cdf0e10cSrcweir {
194cdf0e10cSrcweir 	_aTypes[0] = rType1;
195cdf0e10cSrcweir 	_aTypes[1] = rType2;
196cdf0e10cSrcweir 	_aTypes[2] = rType3;
197cdf0e10cSrcweir 	_aTypes[3] = rType4;
198cdf0e10cSrcweir 	_aTypes[4] = rType5;
199cdf0e10cSrcweir 	_aTypes[5] = rType6;
200cdf0e10cSrcweir 	_aTypes[6] = rType7;
201cdf0e10cSrcweir 	_aTypes[7] = rType8;
202cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 8 );
203cdf0e10cSrcweir }
204cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Type & rType4,const Type & rType5,const Type & rType6,const Type & rType7,const Type & rType8,const Type & rType9,const Sequence<Type> & rAddTypes)205cdf0e10cSrcweir OTypeCollection::OTypeCollection(
206cdf0e10cSrcweir 	const Type & rType1,
207cdf0e10cSrcweir 	const Type & rType2,
208cdf0e10cSrcweir 	const Type & rType3,
209cdf0e10cSrcweir 	const Type & rType4,
210cdf0e10cSrcweir 	const Type & rType5,
211cdf0e10cSrcweir 	const Type & rType6,
212cdf0e10cSrcweir 	const Type & rType7,
213cdf0e10cSrcweir 	const Type & rType8,
214cdf0e10cSrcweir 	const Type & rType9,
215cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
216cdf0e10cSrcweir 	SAL_THROW( () )
217cdf0e10cSrcweir 	: _aTypes( 9 + rAddTypes.getLength() )
218cdf0e10cSrcweir {
219cdf0e10cSrcweir 	_aTypes[0] = rType1;
220cdf0e10cSrcweir 	_aTypes[1] = rType2;
221cdf0e10cSrcweir 	_aTypes[2] = rType3;
222cdf0e10cSrcweir 	_aTypes[3] = rType4;
223cdf0e10cSrcweir 	_aTypes[4] = rType5;
224cdf0e10cSrcweir 	_aTypes[5] = rType6;
225cdf0e10cSrcweir 	_aTypes[6] = rType7;
226cdf0e10cSrcweir 	_aTypes[7] = rType8;
227cdf0e10cSrcweir 	_aTypes[8] = rType9;
228cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 9 );
229cdf0e10cSrcweir }
230cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Type & rType4,const Type & rType5,const Type & rType6,const Type & rType7,const Type & rType8,const Type & rType9,const Type & rType10,const Sequence<Type> & rAddTypes)231cdf0e10cSrcweir OTypeCollection::OTypeCollection(
232cdf0e10cSrcweir 	const Type & rType1,
233cdf0e10cSrcweir 	const Type & rType2,
234cdf0e10cSrcweir 	const Type & rType3,
235cdf0e10cSrcweir 	const Type & rType4,
236cdf0e10cSrcweir 	const Type & rType5,
237cdf0e10cSrcweir 	const Type & rType6,
238cdf0e10cSrcweir 	const Type & rType7,
239cdf0e10cSrcweir 	const Type & rType8,
240cdf0e10cSrcweir 	const Type & rType9,
241cdf0e10cSrcweir 	const Type & rType10,
242cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
243cdf0e10cSrcweir 	SAL_THROW( () )
244cdf0e10cSrcweir 	: _aTypes( 10 + rAddTypes.getLength() )
245cdf0e10cSrcweir {
246cdf0e10cSrcweir 	_aTypes[0] = rType1;
247cdf0e10cSrcweir 	_aTypes[1] = rType2;
248cdf0e10cSrcweir 	_aTypes[2] = rType3;
249cdf0e10cSrcweir 	_aTypes[3] = rType4;
250cdf0e10cSrcweir 	_aTypes[4] = rType5;
251cdf0e10cSrcweir 	_aTypes[5] = rType6;
252cdf0e10cSrcweir 	_aTypes[6] = rType7;
253cdf0e10cSrcweir 	_aTypes[7] = rType8;
254cdf0e10cSrcweir 	_aTypes[8] = rType9;
255cdf0e10cSrcweir 	_aTypes[9] = rType10;
256cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 10 );
257cdf0e10cSrcweir }
258cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Type & rType4,const Type & rType5,const Type & rType6,const Type & rType7,const Type & rType8,const Type & rType9,const Type & rType10,const Type & rType11,const Sequence<Type> & rAddTypes)259cdf0e10cSrcweir OTypeCollection::OTypeCollection(
260cdf0e10cSrcweir 	const Type & rType1,
261cdf0e10cSrcweir 	const Type & rType2,
262cdf0e10cSrcweir 	const Type & rType3,
263cdf0e10cSrcweir 	const Type & rType4,
264cdf0e10cSrcweir 	const Type & rType5,
265cdf0e10cSrcweir 	const Type & rType6,
266cdf0e10cSrcweir 	const Type & rType7,
267cdf0e10cSrcweir 	const Type & rType8,
268cdf0e10cSrcweir 	const Type & rType9,
269cdf0e10cSrcweir 	const Type & rType10,
270cdf0e10cSrcweir 	const Type & rType11,
271cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
272cdf0e10cSrcweir 	SAL_THROW( () )
273cdf0e10cSrcweir 	: _aTypes( 11 + rAddTypes.getLength() )
274cdf0e10cSrcweir {
275cdf0e10cSrcweir 	_aTypes[0] = rType1;
276cdf0e10cSrcweir 	_aTypes[1] = rType2;
277cdf0e10cSrcweir 	_aTypes[2] = rType3;
278cdf0e10cSrcweir 	_aTypes[3] = rType4;
279cdf0e10cSrcweir 	_aTypes[4] = rType5;
280cdf0e10cSrcweir 	_aTypes[5] = rType6;
281cdf0e10cSrcweir 	_aTypes[6] = rType7;
282cdf0e10cSrcweir 	_aTypes[7] = rType8;
283cdf0e10cSrcweir 	_aTypes[8] = rType9;
284cdf0e10cSrcweir 	_aTypes[9] = rType10;
285cdf0e10cSrcweir 	_aTypes[10] = rType11;
286cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 11 );
287cdf0e10cSrcweir }
288cdf0e10cSrcweir //__________________________________________________________________________________________________
OTypeCollection(const Type & rType1,const Type & rType2,const Type & rType3,const Type & rType4,const Type & rType5,const Type & rType6,const Type & rType7,const Type & rType8,const Type & rType9,const Type & rType10,const Type & rType11,const Type & rType12,const Sequence<Type> & rAddTypes)289cdf0e10cSrcweir OTypeCollection::OTypeCollection(
290cdf0e10cSrcweir 	const Type & rType1,
291cdf0e10cSrcweir 	const Type & rType2,
292cdf0e10cSrcweir 	const Type & rType3,
293cdf0e10cSrcweir 	const Type & rType4,
294cdf0e10cSrcweir 	const Type & rType5,
295cdf0e10cSrcweir 	const Type & rType6,
296cdf0e10cSrcweir 	const Type & rType7,
297cdf0e10cSrcweir 	const Type & rType8,
298cdf0e10cSrcweir 	const Type & rType9,
299cdf0e10cSrcweir 	const Type & rType10,
300cdf0e10cSrcweir 	const Type & rType11,
301cdf0e10cSrcweir 	const Type & rType12,
302cdf0e10cSrcweir 	const Sequence< Type > & rAddTypes )
303cdf0e10cSrcweir 	SAL_THROW( () )
304cdf0e10cSrcweir 	: _aTypes( 12 + rAddTypes.getLength() )
305cdf0e10cSrcweir {
306cdf0e10cSrcweir 	_aTypes[0] = rType1;
307cdf0e10cSrcweir 	_aTypes[1] = rType2;
308cdf0e10cSrcweir 	_aTypes[2] = rType3;
309cdf0e10cSrcweir 	_aTypes[3] = rType4;
310cdf0e10cSrcweir 	_aTypes[4] = rType5;
311cdf0e10cSrcweir 	_aTypes[5] = rType6;
312cdf0e10cSrcweir 	_aTypes[6] = rType7;
313cdf0e10cSrcweir 	_aTypes[7] = rType8;
314cdf0e10cSrcweir 	_aTypes[8] = rType9;
315cdf0e10cSrcweir 	_aTypes[9] = rType10;
316cdf0e10cSrcweir 	_aTypes[10] = rType11;
317cdf0e10cSrcweir 	_aTypes[11] = rType12;
318cdf0e10cSrcweir 	copy( _aTypes, rAddTypes, 12 );
319cdf0e10cSrcweir }
320cdf0e10cSrcweir 
321cdf0e10cSrcweir }
322cdf0e10cSrcweir 
323