LCOV - code coverage report
Current view: top level - libreoffice/workdir/unxlngi6.pro/UnoApiHeadersTarget/udkapi/comprehensive/com/sun/star/reflection - XInterfaceTypeDescription.hpp (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 50 50 100.0 %
Date: 2012-12-27 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10