Line data Source code
1 : #ifndef INCLUDED_COM_SUN_STAR_REFLECTION_XINDIRECTTYPEDESCRIPTION_HPP
2 : #define INCLUDED_COM_SUN_STAR_REFLECTION_XINDIRECTTYPEDESCRIPTION_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "com/sun/star/reflection/XIndirectTypeDescription.hdl"
7 :
8 : #include "com/sun/star/uno/RuntimeException.hpp"
9 : #include "com/sun/star/reflection/XTypeDescription.hpp"
10 : #include "com/sun/star/uno/Reference.hxx"
11 : #include "com/sun/star/uno/Type.hxx"
12 : #include "cppu/unotype.hxx"
13 : #include "osl/mutex.hxx"
14 : #include "rtl/instance.hxx"
15 :
16 : namespace com { namespace sun { namespace star { namespace reflection { namespace detail {
17 :
18 : struct theXIndirectTypeDescriptionType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXIndirectTypeDescriptionType >
19 : {
20 15 : ::com::sun::star::uno::Type * operator()() const
21 : {
22 15 : ::rtl::OUString sTypeName( "com.sun.star.reflection.XIndirectTypeDescription" );
23 :
24 : // Start inline typedescription generation
25 15 : typelib_InterfaceTypeDescription * pTD = 0;
26 :
27 : typelib_TypeDescriptionReference * aSuperTypes[1];
28 15 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XTypeDescription > >::get().getTypeLibType();
29 15 : typelib_TypeDescriptionReference * pMembers[1] = { 0 };
30 15 : ::rtl::OUString sMethodName0( "com.sun.star.reflection.XIndirectTypeDescription::getReferencedType" );
31 : typelib_typedescriptionreference_new( &pMembers[0],
32 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
33 15 : sMethodName0.pData );
34 :
35 : typelib_typedescription_newMIInterface(
36 : &pTD,
37 : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
38 : 1, aSuperTypes,
39 : 1,
40 15 : pMembers );
41 :
42 15 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
43 15 : typelib_typedescriptionreference_release( pMembers[0] );
44 15 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
45 :
46 15 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
47 : }
48 : };
49 :
50 : } } } } }
51 :
52 : namespace com { namespace sun { namespace star { namespace reflection {
53 :
54 26 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::reflection::XIndirectTypeDescription const *) {
55 26 : const ::com::sun::star::uno::Type &rRet = *detail::theXIndirectTypeDescriptionType::get();
56 : // End inline typedescription generation
57 : static bool bInitStarted = false;
58 26 : if (!bInitStarted)
59 : {
60 15 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
61 15 : if (!bInitStarted)
62 : {
63 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
64 15 : bInitStarted = true;
65 15 : ::cppu::UnoType< css::uno::RuntimeException >::get();
66 15 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XTypeDescription > >::get();
67 :
68 15 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
69 : {
70 15 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
71 15 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
72 15 : ::rtl::OUString sReturnType0( "com.sun.star.reflection.XTypeDescription" );
73 15 : ::rtl::OUString sMethodName0( "com.sun.star.reflection.XIndirectTypeDescription::getReferencedType" );
74 : typelib_typedescription_newInterfaceMethod( &pMethod,
75 : 5, sal_False,
76 : sMethodName0.pData,
77 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE, sReturnType0.pData,
78 : 0, 0,
79 15 : 1, the_Exceptions );
80 15 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
81 : }
82 15 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
83 15 : }
84 : }
85 : else
86 : {
87 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
88 : }
89 26 : return rRet;
90 : }
91 :
92 : } } } }
93 :
94 26 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::reflection::XIndirectTypeDescription > const *) SAL_THROW(()) {
95 26 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XIndirectTypeDescription > >::get();
96 : }
97 :
98 26 : ::com::sun::star::uno::Type const & css::reflection::XIndirectTypeDescription::static_type(SAL_UNUSED_PARAMETER void *) {
99 26 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::reflection::XIndirectTypeDescription > * >(0));
100 : }
101 :
102 : #endif // INCLUDED_COM_SUN_STAR_REFLECTION_XINDIRECTTYPEDESCRIPTION_HPP
|