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

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

Generated by: LCOV version 1.10