xref: /aoo42x/main/cppu/source/uno/any.cxx (revision 129fa3d1)
1*129fa3d1SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*129fa3d1SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*129fa3d1SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*129fa3d1SAndrew Rist  * distributed with this work for additional information
6*129fa3d1SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*129fa3d1SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*129fa3d1SAndrew Rist  * "License"); you may not use this file except in compliance
9*129fa3d1SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*129fa3d1SAndrew Rist  *
11*129fa3d1SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*129fa3d1SAndrew Rist  *
13*129fa3d1SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*129fa3d1SAndrew Rist  * software distributed under the License is distributed on an
15*129fa3d1SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*129fa3d1SAndrew Rist  * KIND, either express or implied.  See the License for the
17*129fa3d1SAndrew Rist  * specific language governing permissions and limitations
18*129fa3d1SAndrew Rist  * under the License.
19*129fa3d1SAndrew Rist  *
20*129fa3d1SAndrew Rist  *************************************************************/
21*129fa3d1SAndrew Rist 
22*129fa3d1SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_cppu.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "copy.hxx"
28cdf0e10cSrcweir #include "destr.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir using namespace cppu;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir extern "C"
34cdf0e10cSrcweir {
35cdf0e10cSrcweir //##################################################################################################
uno_type_any_assign(uno_Any * pDest,void * pSource,typelib_TypeDescriptionReference * pType,uno_AcquireFunc acquire,uno_ReleaseFunc release)36cdf0e10cSrcweir void SAL_CALL uno_type_any_assign(
37cdf0e10cSrcweir 	uno_Any * pDest, void * pSource,
38cdf0e10cSrcweir 	typelib_TypeDescriptionReference * pType,
39cdf0e10cSrcweir 	uno_AcquireFunc acquire, uno_ReleaseFunc release )
40cdf0e10cSrcweir 	SAL_THROW_EXTERN_C()
41cdf0e10cSrcweir {
42cdf0e10cSrcweir 	_destructAny( pDest, release );
43cdf0e10cSrcweir 	if (pType)
44cdf0e10cSrcweir 	{
45cdf0e10cSrcweir 		_copyConstructAny( pDest, pSource, pType, 0, acquire, 0 );
46cdf0e10cSrcweir 	}
47cdf0e10cSrcweir 	else
48cdf0e10cSrcweir 	{
49cdf0e10cSrcweir 		CONSTRUCT_EMPTY_ANY( pDest );
50cdf0e10cSrcweir 	}
51cdf0e10cSrcweir }
52cdf0e10cSrcweir //##################################################################################################
uno_any_assign(uno_Any * pDest,void * pSource,typelib_TypeDescription * pTypeDescr,uno_AcquireFunc acquire,uno_ReleaseFunc release)53cdf0e10cSrcweir void SAL_CALL uno_any_assign(
54cdf0e10cSrcweir 	uno_Any * pDest, void * pSource,
55cdf0e10cSrcweir 	typelib_TypeDescription * pTypeDescr,
56cdf0e10cSrcweir 	uno_AcquireFunc acquire, uno_ReleaseFunc release )
57cdf0e10cSrcweir 	SAL_THROW_EXTERN_C()
58cdf0e10cSrcweir {
59cdf0e10cSrcweir 	_destructAny( pDest, release );
60cdf0e10cSrcweir 	if (pTypeDescr)
61cdf0e10cSrcweir 	{
62cdf0e10cSrcweir 		_copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 );
63cdf0e10cSrcweir 	}
64cdf0e10cSrcweir 	else
65cdf0e10cSrcweir 	{
66cdf0e10cSrcweir 		CONSTRUCT_EMPTY_ANY( pDest );
67cdf0e10cSrcweir 	}
68cdf0e10cSrcweir }
69cdf0e10cSrcweir //##################################################################################################
uno_type_any_construct(uno_Any * pDest,void * pSource,typelib_TypeDescriptionReference * pType,uno_AcquireFunc acquire)70cdf0e10cSrcweir void SAL_CALL uno_type_any_construct(
71cdf0e10cSrcweir 	uno_Any * pDest, void * pSource,
72cdf0e10cSrcweir 	typelib_TypeDescriptionReference * pType,
73cdf0e10cSrcweir 	uno_AcquireFunc acquire )
74cdf0e10cSrcweir 	SAL_THROW_EXTERN_C()
75cdf0e10cSrcweir {
76cdf0e10cSrcweir 	if (pType)
77cdf0e10cSrcweir 	{
78cdf0e10cSrcweir 		_copyConstructAny( pDest, pSource, pType, 0, acquire, 0 );
79cdf0e10cSrcweir 	}
80cdf0e10cSrcweir 	else
81cdf0e10cSrcweir 	{
82cdf0e10cSrcweir 		CONSTRUCT_EMPTY_ANY( pDest );
83cdf0e10cSrcweir 	}
84cdf0e10cSrcweir }
85cdf0e10cSrcweir //##################################################################################################
uno_any_construct(uno_Any * pDest,void * pSource,typelib_TypeDescription * pTypeDescr,uno_AcquireFunc acquire)86cdf0e10cSrcweir void SAL_CALL uno_any_construct(
87cdf0e10cSrcweir 	uno_Any * pDest, void * pSource,
88cdf0e10cSrcweir 	typelib_TypeDescription * pTypeDescr,
89cdf0e10cSrcweir 	uno_AcquireFunc acquire )
90cdf0e10cSrcweir 	SAL_THROW_EXTERN_C()
91cdf0e10cSrcweir {
92cdf0e10cSrcweir 	if (pTypeDescr)
93cdf0e10cSrcweir 	{
94cdf0e10cSrcweir 		_copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 );
95cdf0e10cSrcweir 	}
96cdf0e10cSrcweir 	else
97cdf0e10cSrcweir 	{
98cdf0e10cSrcweir 		CONSTRUCT_EMPTY_ANY( pDest );
99cdf0e10cSrcweir 	}
100cdf0e10cSrcweir }
101cdf0e10cSrcweir //##################################################################################################
uno_type_any_constructAndConvert(uno_Any * pDest,void * pSource,typelib_TypeDescriptionReference * pType,uno_Mapping * mapping)102cdf0e10cSrcweir void SAL_CALL uno_type_any_constructAndConvert(
103cdf0e10cSrcweir 	uno_Any * pDest, void * pSource,
104cdf0e10cSrcweir 	typelib_TypeDescriptionReference * pType,
105cdf0e10cSrcweir 	uno_Mapping * mapping )
106cdf0e10cSrcweir 	SAL_THROW_EXTERN_C()
107cdf0e10cSrcweir {
108cdf0e10cSrcweir 	if (pType)
109cdf0e10cSrcweir 	{
110cdf0e10cSrcweir 		_copyConstructAny( pDest, pSource, pType, 0, 0, mapping );
111cdf0e10cSrcweir 	}
112cdf0e10cSrcweir 	else
113cdf0e10cSrcweir 	{
114cdf0e10cSrcweir 		CONSTRUCT_EMPTY_ANY( pDest );
115cdf0e10cSrcweir 	}
116cdf0e10cSrcweir }
117cdf0e10cSrcweir //##################################################################################################
uno_any_constructAndConvert(uno_Any * pDest,void * pSource,typelib_TypeDescription * pTypeDescr,uno_Mapping * mapping)118cdf0e10cSrcweir void SAL_CALL uno_any_constructAndConvert(
119cdf0e10cSrcweir 	uno_Any * pDest, void * pSource,
120cdf0e10cSrcweir 	typelib_TypeDescription * pTypeDescr,
121cdf0e10cSrcweir 	uno_Mapping * mapping )
122cdf0e10cSrcweir 	SAL_THROW_EXTERN_C()
123cdf0e10cSrcweir {
124cdf0e10cSrcweir 	if (pTypeDescr)
125cdf0e10cSrcweir 	{
126cdf0e10cSrcweir 		_copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, 0, mapping );
127cdf0e10cSrcweir 	}
128cdf0e10cSrcweir 	else
129cdf0e10cSrcweir 	{
130cdf0e10cSrcweir 		CONSTRUCT_EMPTY_ANY( pDest );
131cdf0e10cSrcweir 	}
132cdf0e10cSrcweir }
133cdf0e10cSrcweir //##################################################################################################
uno_any_destruct(uno_Any * pValue,uno_ReleaseFunc release)134cdf0e10cSrcweir void SAL_CALL uno_any_destruct( uno_Any * pValue, uno_ReleaseFunc release )
135cdf0e10cSrcweir 	SAL_THROW_EXTERN_C()
136cdf0e10cSrcweir {
137cdf0e10cSrcweir 	_destructAny( pValue, release );
138cdf0e10cSrcweir }
139cdf0e10cSrcweir //##################################################################################################
uno_any_clear(uno_Any * pValue,uno_ReleaseFunc release)140cdf0e10cSrcweir void SAL_CALL uno_any_clear( uno_Any * pValue, uno_ReleaseFunc release )
141cdf0e10cSrcweir 	SAL_THROW_EXTERN_C()
142cdf0e10cSrcweir {
143cdf0e10cSrcweir 	_destructAny( pValue, release );
144cdf0e10cSrcweir     CONSTRUCT_EMPTY_ANY( pValue );
145cdf0e10cSrcweir }
146cdf0e10cSrcweir }
147