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 .
20 #include <cppuhelper/typeprovider.hxx>
23 #include <osl/mutex.hxx>
28 using namespace com::sun::star::uno
;
33 // suppress spurious warning triggered by SAL_DEPRECATED in class declaration
34 #if defined _MSC_VER && !defined __clang__
36 #pragma warning(disable: 4996)
39 OImplementationId::~OImplementationId()
44 #if defined _MSC_VER && !defined __clang__
48 Sequence
< sal_Int8
> OImplementationId::getImplementationId() const
52 MutexGuard
aGuard( Mutex::getGlobalMutex() );
55 Sequence
< sal_Int8
> * pSeq
= new Sequence
< sal_Int8
>( 16 );
56 ::rtl_createUuid( reinterpret_cast<sal_uInt8
*>(pSeq
->getArray()), nullptr, _bUseEthernetAddress
);
65 sal_Int32
TypeSeqLen(const Sequence
<Type
>& s
) { return s
.getLength(); }
66 template <class... Args
> sal_Int32
TypeSeqLen(const Type
&, Args
... args
)
68 return 1 + TypeSeqLen(args
...);
71 void PutToTypeSeq(Type
* p
, const Sequence
<Type
>& s
) { std::copy(s
.begin(), s
.end(), p
); }
72 template <class... Args
> void PutToTypeSeq(Type
* p
, const Type
& t
, Args
... args
)
75 PutToTypeSeq(p
+ 1, args
...);
78 template <class... Args
> Sequence
<Type
> InitTypeSeq(Args
... args
)
80 Sequence
<Type
> s(TypeSeqLen(args
...));
81 PutToTypeSeq(s
.getArray(), args
...);
86 OTypeCollection::OTypeCollection(
88 const Sequence
< Type
> & rMore
)
89 : _aTypes(InitTypeSeq(rT1
, rMore
))
93 OTypeCollection::OTypeCollection(
96 const Sequence
< Type
> & rMore
)
97 : _aTypes(InitTypeSeq(rT1
, rT2
, rMore
))
101 OTypeCollection::OTypeCollection(
105 const Sequence
< Type
> & rMore
)
106 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rMore
))
110 OTypeCollection::OTypeCollection(
115 const Sequence
< Type
> & rMore
)
116 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rT4
, rMore
))
120 OTypeCollection::OTypeCollection(
126 const Sequence
< Type
> & rMore
)
127 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rT4
, rT5
, rMore
))
131 OTypeCollection::OTypeCollection(
138 const Sequence
< Type
> & rMore
)
139 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rT4
, rT5
, rT6
, rMore
))
143 OTypeCollection::OTypeCollection(
151 const Sequence
< Type
> & rMore
)
152 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rT4
, rT5
, rT6
, rT7
, rMore
))
156 OTypeCollection::OTypeCollection(
165 const Sequence
< Type
> & rMore
)
166 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rT4
, rT5
, rT6
, rT7
, rT8
, rMore
))
170 OTypeCollection::OTypeCollection(
180 const Sequence
< Type
> & rMore
)
181 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rT4
, rT5
, rT6
, rT7
, rT8
, rT9
, rMore
))
185 OTypeCollection::OTypeCollection(
196 const Sequence
< Type
> & rMore
)
197 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rT4
, rT5
, rT6
, rT7
, rT8
, rT9
, rT10
, rMore
))
201 OTypeCollection::OTypeCollection(
213 const Sequence
< Type
> & rMore
)
214 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rT4
, rT5
, rT6
, rT7
, rT8
, rT9
, rT10
, rT11
, rMore
))
218 OTypeCollection::OTypeCollection(
231 const Sequence
< Type
> & rMore
)
232 : _aTypes(InitTypeSeq(rT1
, rT2
, rT3
, rT4
, rT5
, rT6
, rT7
, rT8
, rT9
, rT10
, rT11
, rT12
, rMore
))
238 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */