LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/udkapi/com/sun/star/reflection - XTypeDescriptionEnumerationAccess.hpp (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 61 61 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_XTYPEDESCRIPTIONENUMERATIONACCESS_HPP
       2             : #define INCLUDED_COM_SUN_STAR_REFLECTION_XTYPEDESCRIPTIONENUMERATIONACCESS_HPP
       3             : 
       4             : #include "sal/config.h"
       5             : 
       6             : #include "com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hdl"
       7             : 
       8             : #include "com/sun/star/uno/RuntimeException.hpp"
       9             : #include "com/sun/star/reflection/NoSuchTypeNameException.hpp"
      10             : #include "com/sun/star/reflection/XTypeDescriptionEnumeration.hpp"
      11             : #include "com/sun/star/uno/TypeClass.hpp"
      12             : #include "com/sun/star/uno/XInterface.hpp"
      13             : #include "com/sun/star/reflection/TypeDescriptionSearchDepth.hpp"
      14             : #include "com/sun/star/reflection/InvalidTypeNameException.hpp"
      15             : #include "com/sun/star/uno/Reference.hxx"
      16             : #include "com/sun/star/uno/Sequence.hxx"
      17             : #include "com/sun/star/uno/Type.hxx"
      18             : #include "cppu/unotype.hxx"
      19             : #include "osl/mutex.hxx"
      20             : #include "rtl/ustring.hxx"
      21             : #include "rtl/instance.hxx"
      22             : 
      23             : namespace com { namespace sun { namespace star { namespace reflection { namespace detail {
      24             : 
      25             : struct theXTypeDescriptionEnumerationAccessType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXTypeDescriptionEnumerationAccessType >
      26             : {
      27           2 :     ::com::sun::star::uno::Type * operator()() const
      28             :     {
      29           2 :         ::rtl::OUString sTypeName( "com.sun.star.reflection.XTypeDescriptionEnumerationAccess" );
      30             : 
      31             :         // Start inline typedescription generation
      32           2 :         typelib_InterfaceTypeDescription * pTD = 0;
      33             : 
      34             :         typelib_TypeDescriptionReference * aSuperTypes[1];
      35           2 :         aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get().getTypeLibType();
      36           2 :         typelib_TypeDescriptionReference * pMembers[1] = { 0 };
      37           2 :         ::rtl::OUString sMethodName0( "com.sun.star.reflection.XTypeDescriptionEnumerationAccess::createTypeDescriptionEnumeration" );
      38             :         typelib_typedescriptionreference_new( &pMembers[0],
      39             :                                               (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
      40           2 :                                               sMethodName0.pData );
      41             : 
      42             :         typelib_typedescription_newMIInterface(
      43             :             &pTD,
      44             :             sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
      45             :             1, aSuperTypes,
      46             :             1,
      47           2 :             pMembers );
      48             : 
      49           2 :         typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
      50           2 :         typelib_typedescriptionreference_release( pMembers[0] );
      51           2 :         typelib_typedescription_release( (typelib_TypeDescription*)pTD );
      52             : 
      53           2 :         return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
      54             :     }
      55             : };
      56             : 
      57             : } } } } }
      58             : 
      59             : namespace com { namespace sun { namespace star { namespace reflection {
      60             : 
      61           2 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::reflection::XTypeDescriptionEnumerationAccess const *) {
      62           2 :     const ::com::sun::star::uno::Type &rRet = *detail::theXTypeDescriptionEnumerationAccessType::get();
      63             :     // End inline typedescription generation
      64             :     static bool bInitStarted = false;
      65           2 :     if (!bInitStarted)
      66             :     {
      67           2 :         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
      68           2 :         if (!bInitStarted)
      69             :         {
      70             :             OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
      71           2 :             bInitStarted = true;
      72           2 :             ::cppu::UnoType< css::uno::RuntimeException >::get();
      73           2 :             ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XTypeDescriptionEnumeration > >::get();
      74           2 :             ::cppu::UnoType< ::cppu::UnoSequenceType< css::uno::TypeClass > >::get();
      75           2 :             ::cppu::UnoType< css::reflection::TypeDescriptionSearchDepth >::get();
      76           2 :             ::cppu::UnoType< css::reflection::NoSuchTypeNameException >::get();
      77           2 :             ::cppu::UnoType< css::reflection::InvalidTypeNameException >::get();
      78             : 
      79           2 :             typelib_InterfaceMethodTypeDescription * pMethod = 0;
      80             :             {
      81             :                 typelib_Parameter_Init aParameters[3];
      82           2 :                 ::rtl::OUString sParamName0( "moduleName" );
      83           2 :                 ::rtl::OUString sParamType0( "string" );
      84           2 :                 aParameters[0].pParamName = sParamName0.pData;
      85           2 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
      86           2 :                 aParameters[0].pTypeName = sParamType0.pData;
      87           2 :                 aParameters[0].bIn = sal_True;
      88           2 :                 aParameters[0].bOut = sal_False;
      89           2 :                 ::rtl::OUString sParamName1( "types" );
      90           2 :                 ::rtl::OUString sParamType1( "[]com.sun.star.uno.TypeClass" );
      91           2 :                 aParameters[1].pParamName = sParamName1.pData;
      92           2 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE;
      93           2 :                 aParameters[1].pTypeName = sParamType1.pData;
      94           2 :                 aParameters[1].bIn = sal_True;
      95           2 :                 aParameters[1].bOut = sal_False;
      96           2 :                 ::rtl::OUString sParamName2( "depth" );
      97           2 :                 ::rtl::OUString sParamType2( "com.sun.star.reflection.TypeDescriptionSearchDepth" );
      98           2 :                 aParameters[2].pParamName = sParamName2.pData;
      99           2 :                 aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_ENUM;
     100           2 :                 aParameters[2].pTypeName = sParamType2.pData;
     101           2 :                 aParameters[2].bIn = sal_True;
     102           2 :                 aParameters[2].bOut = sal_False;
     103           2 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.reflection.NoSuchTypeNameException" );
     104           2 :                 ::rtl::OUString the_ExceptionName1( "com.sun.star.reflection.InvalidTypeNameException" );
     105           2 :                 ::rtl::OUString the_ExceptionName2( "com.sun.star.uno.RuntimeException" );
     106           2 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData, the_ExceptionName2.pData };
     107           2 :                 ::rtl::OUString sReturnType0( "com.sun.star.reflection.XTypeDescriptionEnumeration" );
     108           2 :                 ::rtl::OUString sMethodName0( "com.sun.star.reflection.XTypeDescriptionEnumerationAccess::createTypeDescriptionEnumeration" );
     109             :                 typelib_typedescription_newInterfaceMethod( &pMethod,
     110             :                     3, sal_False,
     111             :                     sMethodName0.pData,
     112             :                     (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE, sReturnType0.pData,
     113             :                     3, aParameters,
     114           2 :                     3, the_Exceptions );
     115           2 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     116             :             }
     117           2 :             typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
     118           2 :         }
     119             :     }
     120             :     else
     121             :     {
     122             :         OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
     123             :     }
     124           2 :     return rRet;
     125             : }
     126             : 
     127             : } } } }
     128             : 
     129           2 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::reflection::XTypeDescriptionEnumerationAccess > const *) SAL_THROW(()) {
     130           2 :     return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XTypeDescriptionEnumerationAccess > >::get();
     131             : }
     132             : 
     133           2 : ::com::sun::star::uno::Type const & css::reflection::XTypeDescriptionEnumerationAccess::static_type(SAL_UNUSED_PARAMETER void *) {
     134           2 :     return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::reflection::XTypeDescriptionEnumerationAccess > * >(0));
     135             : }
     136             : 
     137             : #endif // INCLUDED_COM_SUN_STAR_REFLECTION_XTYPEDESCRIPTIONENUMERATIONACCESS_HPP

Generated by: LCOV version 1.10