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