LCOV - code coverage report
Current view: top level - workdir/unxlngi6.pro/UnoApiHeadersTarget/cppuhelper/comprehensive/cppuhelper/detail - XExceptionThrower.hpp (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 50 50 100.0 %
Date: 2012-08-25 Functions: 3 3 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 21 40 52.5 %

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

Generated by: LCOV version 1.10