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

           Branch data     Line data    Source code
       1                 :            : #ifndef INCLUDED_COM_SUN_STAR_REGISTRY_XIMPLEMENTATIONREGISTRATION_HPP
       2                 :            : #define INCLUDED_COM_SUN_STAR_REGISTRY_XIMPLEMENTATIONREGISTRATION_HPP
       3                 :            : 
       4                 :            : #include "sal/config.h"
       5                 :            : 
       6                 :            : #include "com/sun/star/registry/XImplementationRegistration.hdl"
       7                 :            : 
       8                 :            : #include "com/sun/star/uno/XInterface.hpp"
       9                 :            : #include "com/sun/star/registry/CannotRegisterImplementationException.hpp"
      10                 :            : #include "com/sun/star/uno/RuntimeException.hpp"
      11                 :            : #include "com/sun/star/registry/XSimpleRegistry.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/ustring.hxx"
      18                 :            : #include "rtl/instance.hxx"
      19                 :            : #include "sal/types.h"
      20                 :            : 
      21                 :            : namespace com { namespace sun { namespace star { namespace registry { namespace detail {
      22                 :            : 
      23                 :            : struct theXImplementationRegistrationType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXImplementationRegistrationType >
      24                 :            : {
      25                 :         64 :     ::com::sun::star::uno::Type * operator()() const
      26                 :            :     {
      27         [ +  - ]:         64 :         ::rtl::OUString sTypeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XImplementationRegistration") );
      28                 :            : 
      29                 :            :         // Start inline typedescription generation
      30                 :         64 :         typelib_InterfaceTypeDescription * pTD = 0;
      31                 :            : 
      32                 :            :         typelib_TypeDescriptionReference * aSuperTypes[1];
      33         [ +  - ]:         64 :         aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >::get().getTypeLibType();
      34                 :         64 :         typelib_TypeDescriptionReference * pMembers[4] = { 0,0,0,0 };
      35         [ +  - ]:         64 :         ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XImplementationRegistration::registerImplementation") );
      36                 :            :         typelib_typedescriptionreference_new( &pMembers[0],
      37                 :            :                                               (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
      38                 :         64 :                                               sMethodName0.pData );
      39         [ +  - ]:         64 :         ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XImplementationRegistration::revokeImplementation") );
      40                 :            :         typelib_typedescriptionreference_new( &pMembers[1],
      41                 :            :                                               (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
      42                 :         64 :                                               sMethodName1.pData );
      43         [ +  - ]:         64 :         ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XImplementationRegistration::getImplementations") );
      44                 :            :         typelib_typedescriptionreference_new( &pMembers[2],
      45                 :            :                                               (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
      46                 :         64 :                                               sMethodName2.pData );
      47         [ +  - ]:         64 :         ::rtl::OUString sMethodName3( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XImplementationRegistration::checkInstantiation") );
      48                 :            :         typelib_typedescriptionreference_new( &pMembers[3],
      49                 :            :                                               (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
      50                 :         64 :                                               sMethodName3.pData );
      51                 :            : 
      52                 :            :         typelib_typedescription_newMIInterface(
      53                 :            :             &pTD,
      54                 :            :             sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
      55                 :            :             1, aSuperTypes,
      56                 :            :             4,
      57                 :         64 :             pMembers );
      58                 :            : 
      59                 :         64 :         typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
      60                 :         64 :         typelib_typedescriptionreference_release( pMembers[0] );
      61                 :         64 :         typelib_typedescriptionreference_release( pMembers[1] );
      62                 :         64 :         typelib_typedescriptionreference_release( pMembers[2] );
      63                 :         64 :         typelib_typedescriptionreference_release( pMembers[3] );
      64                 :         64 :         typelib_typedescription_release( (typelib_TypeDescription*)pTD );
      65                 :            : 
      66                 :         64 :         return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
      67                 :            :     }
      68                 :            : };
      69                 :            : 
      70                 :            : } } } } }
      71                 :            : 
      72                 :            : namespace com { namespace sun { namespace star { namespace registry {
      73                 :            : 
      74                 :         66 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::com::sun::star::registry::XImplementationRegistration const *) {
      75                 :         66 :     const ::com::sun::star::uno::Type &rRet = *detail::theXImplementationRegistrationType::get();
      76                 :            :     // End inline typedescription generation
      77                 :            :     static bool bInitStarted = false;
      78         [ +  + ]:         66 :     if (!bInitStarted)
      79                 :            :     {
      80 [ +  - ][ +  - ]:         64 :         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
      81         [ +  - ]:         64 :         if (!bInitStarted)
      82                 :            :         {
      83                 :            :             OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
      84                 :         64 :             bInitStarted = true;
      85         [ +  - ]:         64 :             ::cppu::UnoType< ::com::sun::star::uno::RuntimeException >::get();
      86         [ +  - ]:         64 :             ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::registry::XSimpleRegistry > >::get();
      87                 :         64 :             ::cppu::UnoType< ::com::sun::star::registry::CannotRegisterImplementationException >::get();
      88         [ +  - ]:         64 :             ::cppu::UnoType< ::cppu::UnoSequenceType< ::rtl::OUString > >::get();
      89                 :            : 
      90                 :         64 :             typelib_InterfaceMethodTypeDescription * pMethod = 0;
      91                 :            :             {
      92                 :            :                 typelib_Parameter_Init aParameters[3];
      93         [ +  - ]:         64 :                 ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("aImplementationLoader") );
      94         [ +  - ]:         64 :                 ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("string") );
      95                 :         64 :                 aParameters[0].pParamName = sParamName0.pData;
      96                 :         64 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
      97                 :         64 :                 aParameters[0].pTypeName = sParamType0.pData;
      98                 :         64 :                 aParameters[0].bIn = sal_True;
      99                 :         64 :                 aParameters[0].bOut = sal_False;
     100         [ +  - ]:         64 :                 ::rtl::OUString sParamName1( RTL_CONSTASCII_USTRINGPARAM("aLocation") );
     101         [ +  - ]:         64 :                 ::rtl::OUString sParamType1( RTL_CONSTASCII_USTRINGPARAM("string") );
     102                 :         64 :                 aParameters[1].pParamName = sParamName1.pData;
     103                 :         64 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     104                 :         64 :                 aParameters[1].pTypeName = sParamType1.pData;
     105                 :         64 :                 aParameters[1].bIn = sal_True;
     106                 :         64 :                 aParameters[1].bOut = sal_False;
     107         [ +  - ]:         64 :                 ::rtl::OUString sParamName2( RTL_CONSTASCII_USTRINGPARAM("xReg") );
     108         [ +  - ]:         64 :                 ::rtl::OUString sParamType2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XSimpleRegistry") );
     109                 :         64 :                 aParameters[2].pParamName = sParamName2.pData;
     110                 :         64 :                 aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
     111                 :         64 :                 aParameters[2].pTypeName = sParamType2.pData;
     112                 :         64 :                 aParameters[2].bIn = sal_True;
     113                 :         64 :                 aParameters[2].bOut = sal_False;
     114         [ +  - ]:         64 :                 ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.CannotRegisterImplementationException"));
     115         [ +  - ]:         64 :                 ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
     116                 :         64 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
     117         [ +  - ]:         64 :                 ::rtl::OUString sReturnType0( RTL_CONSTASCII_USTRINGPARAM("void") );
     118         [ +  - ]:         64 :                 ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XImplementationRegistration::registerImplementation") );
     119                 :            :                 typelib_typedescription_newInterfaceMethod( &pMethod,
     120                 :            :                     3, sal_False,
     121                 :            :                     sMethodName0.pData,
     122                 :            :                     (typelib_TypeClass)::com::sun::star::uno::TypeClass_VOID, sReturnType0.pData,
     123                 :            :                     3, aParameters,
     124                 :         64 :                     2, the_Exceptions );
     125                 :         64 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     126                 :            :             }
     127                 :            :             {
     128                 :            :                 typelib_Parameter_Init aParameters[2];
     129         [ +  - ]:         64 :                 ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("aLocation") );
     130         [ +  - ]:         64 :                 ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("string") );
     131                 :         64 :                 aParameters[0].pParamName = sParamName0.pData;
     132                 :         64 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     133                 :         64 :                 aParameters[0].pTypeName = sParamType0.pData;
     134                 :         64 :                 aParameters[0].bIn = sal_True;
     135                 :         64 :                 aParameters[0].bOut = sal_False;
     136         [ +  - ]:         64 :                 ::rtl::OUString sParamName1( RTL_CONSTASCII_USTRINGPARAM("xReg") );
     137         [ +  - ]:         64 :                 ::rtl::OUString sParamType1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XSimpleRegistry") );
     138                 :         64 :                 aParameters[1].pParamName = sParamName1.pData;
     139                 :         64 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
     140                 :         64 :                 aParameters[1].pTypeName = sParamType1.pData;
     141                 :         64 :                 aParameters[1].bIn = sal_True;
     142                 :         64 :                 aParameters[1].bOut = sal_False;
     143         [ +  - ]:         64 :                 ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
     144                 :         64 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
     145         [ +  - ]:         64 :                 ::rtl::OUString sReturnType1( RTL_CONSTASCII_USTRINGPARAM("boolean") );
     146         [ +  - ]:         64 :                 ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XImplementationRegistration::revokeImplementation") );
     147                 :            :                 typelib_typedescription_newInterfaceMethod( &pMethod,
     148                 :            :                     4, sal_False,
     149                 :            :                     sMethodName1.pData,
     150                 :            :                     (typelib_TypeClass)::com::sun::star::uno::TypeClass_BOOLEAN, sReturnType1.pData,
     151                 :            :                     2, aParameters,
     152                 :         64 :                     1, the_Exceptions );
     153                 :         64 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     154                 :            :             }
     155                 :            :             {
     156                 :            :                 typelib_Parameter_Init aParameters[2];
     157         [ +  - ]:         64 :                 ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("aImplementationLoader") );
     158         [ +  - ]:         64 :                 ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("string") );
     159                 :         64 :                 aParameters[0].pParamName = sParamName0.pData;
     160                 :         64 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     161                 :         64 :                 aParameters[0].pTypeName = sParamType0.pData;
     162                 :         64 :                 aParameters[0].bIn = sal_True;
     163                 :         64 :                 aParameters[0].bOut = sal_False;
     164         [ +  - ]:         64 :                 ::rtl::OUString sParamName1( RTL_CONSTASCII_USTRINGPARAM("aLocation") );
     165         [ +  - ]:         64 :                 ::rtl::OUString sParamType1( RTL_CONSTASCII_USTRINGPARAM("string") );
     166                 :         64 :                 aParameters[1].pParamName = sParamName1.pData;
     167                 :         64 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     168                 :         64 :                 aParameters[1].pTypeName = sParamType1.pData;
     169                 :         64 :                 aParameters[1].bIn = sal_True;
     170                 :         64 :                 aParameters[1].bOut = sal_False;
     171         [ +  - ]:         64 :                 ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
     172                 :         64 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
     173         [ +  - ]:         64 :                 ::rtl::OUString sReturnType2( RTL_CONSTASCII_USTRINGPARAM("[]string") );
     174         [ +  - ]:         64 :                 ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XImplementationRegistration::getImplementations") );
     175                 :            :                 typelib_typedescription_newInterfaceMethod( &pMethod,
     176                 :            :                     5, sal_False,
     177                 :            :                     sMethodName2.pData,
     178                 :            :                     (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType2.pData,
     179                 :            :                     2, aParameters,
     180                 :         64 :                     1, the_Exceptions );
     181                 :         64 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     182                 :            :             }
     183                 :            :             {
     184                 :            :                 typelib_Parameter_Init aParameters[1];
     185         [ +  - ]:         64 :                 ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("implementationName") );
     186         [ +  - ]:         64 :                 ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("string") );
     187                 :         64 :                 aParameters[0].pParamName = sParamName0.pData;
     188                 :         64 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     189                 :         64 :                 aParameters[0].pTypeName = sParamType0.pData;
     190                 :         64 :                 aParameters[0].bIn = sal_True;
     191                 :         64 :                 aParameters[0].bOut = sal_False;
     192         [ +  - ]:         64 :                 ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
     193                 :         64 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
     194         [ +  - ]:         64 :                 ::rtl::OUString sReturnType3( RTL_CONSTASCII_USTRINGPARAM("[]string") );
     195         [ +  - ]:         64 :                 ::rtl::OUString sMethodName3( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XImplementationRegistration::checkInstantiation") );
     196                 :            :                 typelib_typedescription_newInterfaceMethod( &pMethod,
     197                 :            :                     6, sal_False,
     198                 :            :                     sMethodName3.pData,
     199                 :            :                     (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType3.pData,
     200                 :            :                     1, aParameters,
     201                 :         64 :                     1, the_Exceptions );
     202                 :         64 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     203                 :            :             }
     204                 :         64 :             typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
     205         [ +  - ]:         64 :         }
     206                 :            :     }
     207                 :            :     else
     208                 :            :     {
     209                 :            :         OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
     210                 :            :     }
     211                 :         66 :     return rRet;
     212                 :            : }
     213                 :            : 
     214                 :            : } } } }
     215                 :            : 
     216                 :         66 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< ::com::sun::star::registry::XImplementationRegistration > const *) SAL_THROW(()) {
     217                 :         66 :     return ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::registry::XImplementationRegistration > >::get();
     218                 :            : }
     219                 :            : 
     220                 :         66 : ::com::sun::star::uno::Type const & ::com::sun::star::registry::XImplementationRegistration::static_type(SAL_UNUSED_PARAMETER void *) {
     221                 :         66 :     return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< ::com::sun::star::registry::XImplementationRegistration > * >(0));
     222                 :            : }
     223                 :            : 
     224                 :            : #endif // INCLUDED_COM_SUN_STAR_REGISTRY_XIMPLEMENTATIONREGISTRATION_HPP

Generated by: LCOV version 1.10