xref: /aoo41x/main/cppuhelper/source/primeweak.cxx (revision 52046e16)
1caff391cSHerbert Dürr /**************************************************************
2caff391cSHerbert Dürr  *
3caff391cSHerbert Dürr  * Licensed to the Apache Software Foundation (ASF) under one
4caff391cSHerbert Dürr  * or more contributor license agreements.  See the NOTICE file
5caff391cSHerbert Dürr  * distributed with this work for additional information
6caff391cSHerbert Dürr  * regarding copyright ownership.  The ASF licenses this file
7caff391cSHerbert Dürr  * to you under the Apache License, Version 2.0 (the
8caff391cSHerbert Dürr  * "License"); you may not use this file except in compliance
9caff391cSHerbert Dürr  * with the License.  You may obtain a copy of the License at
10caff391cSHerbert Dürr  *
11caff391cSHerbert Dürr  *   http://www.apache.org/licenses/LICENSE-2.0
12caff391cSHerbert Dürr  *
13caff391cSHerbert Dürr  * Unless required by applicable law or agreed to in writing,
14caff391cSHerbert Dürr  * software distributed under the License is distributed on an
15caff391cSHerbert Dürr  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16caff391cSHerbert Dürr  * KIND, either express or implied.  See the License for the
17caff391cSHerbert Dürr  * specific language governing permissions and limitations
18caff391cSHerbert Dürr  * under the License.
19caff391cSHerbert Dürr  *
20caff391cSHerbert Dürr  *************************************************************/
21caff391cSHerbert Dürr 
22caff391cSHerbert Dürr // MARKER(update_precomp.py): autogen include statement, do not remove
23caff391cSHerbert Dürr #include "precompiled_cppuhelper.hxx"
24caff391cSHerbert Dürr 
25caff391cSHerbert Dürr // The only purpose of this file is to workaround a problem in UNO:
26caff391cSHerbert Dürr // Cppumaker and its brethren emit different implementations for
27caff391cSHerbert Dürr // the same symbol by design (!) which is quite... unfortunate
28caff391cSHerbert Dürr // and can confuse the heck out of dynamic linkers, debuggers, etc.
29caff391cSHerbert Dürr //
30c52956d9SHerbert Dürr // For bootstrapping the comprehensive descriptions of some UNO types are needed.
31caff391cSHerbert Dürr // The mechanism in this file makes sure that these comprehensive type
32caff391cSHerbert Dürr // descriptions are used to prime the so-called "WeakMap".
33caff391cSHerbert Dürr //
34caff391cSHerbert Dürr // TODO: change cppumaker and its brethren to use different symbol names
35caff391cSHerbert Dürr //       for different implementations. In particular "cppu_detail_getUnoType"
36caff391cSHerbert Dürr //       should be divided into full, weak and mini implementations.
37caff391cSHerbert Dürr 
38caff391cSHerbert Dürr // Types that are candidates for this special workaround are the ones mentioned
39caff391cSHerbert Dürr // by the exceptions thrown from implbase_ex.cxx's __queryDeepNoXInterface()
40caff391cSHerbert Dürr // that also need to added to the makefile's UNOTYPES define
41caff391cSHerbert Dürr 
42caff391cSHerbert Dürr #define cppu_detail_getUnoType cppu_full_getUnoType
43caff391cSHerbert Dürr #define InitTypeDesc(T) {(void)cppu_full_getUnoType(static_cast< T * >(NULL));}
44caff391cSHerbert Dürr 
45c52956d9SHerbert Dürr // NOTE: the cppuhelper part in the include paths below ensures that the type descriptions
46c52956d9SHerbert Dürr // are comprehensive descriptions and not some weak descriptions e.g. from solver
47caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/lang/XComponent.hpp"
48caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/lang/XInitialization.hpp"
49caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/lang/XSingleServiceFactory.hpp"
50caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/lang/XSingleComponentFactory.hpp"
51caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/lang/XMultiServiceFactory.hpp"
525696ffe9SHerbert Dürr #include "cppuhelper/com/sun/star/lang/XMultiComponentFactory.hpp"
53caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/lang/XServiceInfo.hpp"
54caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/lang/XEventListener.hpp"
55caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/lang/XTypeProvider.hpp"
56caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/lang/XUnoTunnel.hpp"
57c52956d9SHerbert Dürr #include "cppuhelper/com/sun/star/lang/DisposedException.hpp"
58caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/uno/DeploymentException.hpp"
59caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/uno/XWeak.hpp"
60caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/uno/XCurrentContext.hpp"
61caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/uno/XComponentContext.hpp"
62caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/uno/RuntimeException.hpp"
63c52956d9SHerbert Dürr #include "cppuhelper/com/sun/star/util/XMacroExpander.hpp"
64caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/beans/PropertyValue.hpp"
65caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/beans/XPropertySet.hpp"
66caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/beans/XMultiPropertySet.hpp"
67*52046e16SHerbert Dürr #include "cppuhelper/com/sun/star/container/XContentEnumerationAccess.hpp"
68caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/container/XEnumerationAccess.hpp"
69caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/container/XEnumeration.hpp"
70c52956d9SHerbert Dürr #include "cppuhelper/com/sun/star/container/XNameAccess.hpp"
71c52956d9SHerbert Dürr #include "cppuhelper/com/sun/star/container/XNameReplace.hpp"
72c52956d9SHerbert Dürr #include "cppuhelper/com/sun/star/container/XNameContainer.hpp"
73caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/container/XHierarchicalNameAccess.hpp"
74caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/container/XSet.hpp"
75caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/bridge/XUnoUrlResolver.hpp"
76caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/io/IOException.hpp"
77caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/io/FilePermission.hpp"
78caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/security/RuntimePermission.hpp"
79caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/loader/XImplementationLoader.hpp"
80caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/security/XAccessController.hpp"
81caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/registry/XRegistryKey.hpp"
82caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/registry/XSimpleRegistry.hpp"
83caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XTypeDescription.hpp"
84caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XEnumTypeDescription.hpp"
85caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XArrayTypeDescription.hpp"
86caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XStructTypeDescription.hpp"
87caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XUnionTypeDescription.hpp"
88caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XCompoundTypeDescription.hpp"
89caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XIndirectTypeDescription.hpp"
90c52956d9SHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XInterfaceTypeDescription.hpp"
91c52956d9SHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XInterfaceMemberTypeDescription.hpp"
92c52956d9SHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XInterfaceMethodTypeDescription.hpp"
93caff391cSHerbert Dürr #include "cppuhelper/com/sun/star/reflection/XMethodParameter.hpp"
94caff391cSHerbert Dürr 
primeWeakMap(void)95caff391cSHerbert Dürr void primeWeakMap( void)
96caff391cSHerbert Dürr {
97caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XComponent );
98caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XInitialization );
99caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XSingleServiceFactory );
100caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XSingleComponentFactory );
101caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XMultiServiceFactory );
102caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XMultiComponentFactory );
103caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XServiceInfo );
104caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XEventListener );
105caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XTypeProvider );
106caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::lang::XUnoTunnel );
107c52956d9SHerbert Dürr 	InitTypeDesc( com::sun::star::lang::DisposedException );
108caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::uno::XWeak );
109caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::uno::DeploymentException );
110caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::uno::XCurrentContext );
111caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::uno::XComponentContext );
112caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::uno::RuntimeException );
113c52956d9SHerbert Dürr 	InitTypeDesc( com::sun::star::util::XMacroExpander );
114caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::beans::PropertyState );
115caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::beans::PropertyValue );
116caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::beans::XPropertySet );
117caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::beans::XMultiPropertySet );
118caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::container::XElementAccess );
119caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::container::XEnumeration );
120caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::container::XEnumerationAccess );
121*52046e16SHerbert Dürr 	InitTypeDesc( com::sun::star::container::XContentEnumerationAccess );
122caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::container::XHierarchicalNameAccess );
123c52956d9SHerbert Dürr 	InitTypeDesc( com::sun::star::container::XNameAccess );
124c52956d9SHerbert Dürr 	InitTypeDesc( com::sun::star::container::XNameReplace );
125c52956d9SHerbert Dürr 	InitTypeDesc( com::sun::star::container::XNameContainer );
126caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::container::XSet );
127caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::io::IOException );
128caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::io::FilePermission );
129caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::security::XAccessController );
130caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::security::RuntimePermission);
131caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::loader::XImplementationLoader );
132caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::bridge::XUnoUrlResolver );
133caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::registry::XRegistryKey );
134caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::registry::XSimpleRegistry );
135caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XTypeDescription );
136caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XEnumTypeDescription );
137caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XArrayTypeDescription );
138caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XStructTypeDescription );
139caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XUnionTypeDescription );
140caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XCompoundTypeDescription );
141caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XIndirectTypeDescription );
142c52956d9SHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XInterfaceTypeDescription );
143c52956d9SHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XInterfaceMemberTypeDescription );
144c52956d9SHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XInterfaceMethodTypeDescription );
145caff391cSHerbert Dürr 	InitTypeDesc( com::sun::star::reflection::XMethodParameter );
146caff391cSHerbert Dürr }
147caff391cSHerbert Dürr 
148