LCOV - code coverage report
Current view: top level - solver/unxlngi6.pro/inc/udkapi/com/sun/star/lang - XSingleComponentFactory.hpp (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 69 69 100.0 %
Date: 2012-08-25 Functions: 4 4 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 28 54 51.9 %

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

Generated by: LCOV version 1.10