Branch data 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 : 261 : ::com::sun::star::uno::Type * operator()() const
21 : : {
22 [ + - ]: 261 : ::rtl::OUString sTypeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XIndirectTypeDescription") );
23 : :
24 : : // Start inline typedescription generation
25 : 261 : typelib_InterfaceTypeDescription * pTD = 0;
26 : :
27 : : typelib_TypeDescriptionReference * aSuperTypes[1];
28 [ + - ]: 261 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XTypeDescription > >::get().getTypeLibType();
29 : 261 : typelib_TypeDescriptionReference * pMembers[1] = { 0 };
30 [ + - ]: 261 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XIndirectTypeDescription::getReferencedType") );
31 : : typelib_typedescriptionreference_new( &pMembers[0],
32 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
33 : 261 : sMethodName0.pData );
34 : :
35 : : typelib_typedescription_newMIInterface(
36 : : &pTD,
37 : : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
38 : : 1, aSuperTypes,
39 : : 1,
40 : 261 : pMembers );
41 : :
42 : 261 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
43 : 261 : typelib_typedescriptionreference_release( pMembers[0] );
44 : 261 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
45 : :
46 : 261 : 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 : 376 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::com::sun::star::reflection::XIndirectTypeDescription const *) {
55 : 376 : const ::com::sun::star::uno::Type &rRet = *detail::theXIndirectTypeDescriptionType::get();
56 : : // End inline typedescription generation
57 : : static bool bInitStarted = false;
58 [ + + ]: 376 : if (!bInitStarted)
59 : : {
60 [ + - ][ + - ]: 261 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
61 [ + - ]: 261 : if (!bInitStarted)
62 : : {
63 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
64 : 261 : bInitStarted = true;
65 [ + - ]: 261 : ::cppu::UnoType< ::com::sun::star::uno::RuntimeException >::get();
66 [ + - ]: 261 : ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XTypeDescription > >::get();
67 : :
68 : 261 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
69 : : {
70 [ + - ]: 261 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
71 : 261 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
72 [ + - ]: 261 : ::rtl::OUString sReturnType0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XTypeDescription") );
73 [ + - ]: 261 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("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 : 261 : 1, the_Exceptions );
80 : 261 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
81 : : }
82 : 261 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
83 [ + - ]: 261 : }
84 : : }
85 : : else
86 : : {
87 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
88 : : }
89 : 376 : return rRet;
90 : : }
91 : :
92 : : } } } }
93 : :
94 : 376 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIndirectTypeDescription > const *) SAL_THROW(()) {
95 : 376 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIndirectTypeDescription > >::get();
96 : : }
97 : :
98 : 376 : ::com::sun::star::uno::Type const & ::com::sun::star::reflection::XIndirectTypeDescription::static_type(SAL_UNUSED_PARAMETER void *) {
99 : 376 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIndirectTypeDescription > * >(0));
100 : : }
101 : :
102 : : #endif // INCLUDED_COM_SUN_STAR_REFLECTION_XINDIRECTTYPEDESCRIPTION_HPP
|