LCOV - code coverage report
Current view: top level - libreoffice/workdir/unxlngi6.pro/UnoApiHeadersTarget/bridgetest/normal/test/testtools/bridgetest - TestPolyStruct2.hpp (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 15 15 100.0 %
Date: 2012-12-27 Functions: 19 19 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #ifndef INCLUDED_TEST_TESTTOOLS_BRIDGETEST_TESTPOLYSTRUCT2_HPP
       2             : #define INCLUDED_TEST_TESTTOOLS_BRIDGETEST_TESTPOLYSTRUCT2_HPP
       3             : 
       4             : #include "sal/config.h"
       5             : 
       6             : #include "test/testtools/bridgetest/TestPolyStruct2.hdl"
       7             : 
       8             : #include "com/sun/star/uno/Type.hxx"
       9             : #include "cppu/unotype.hxx"
      10             : #include "rtl/strbuf.hxx"
      11             : #include "rtl/textenc.h"
      12             : #include "rtl/ustring.hxx"
      13             : #include "sal/types.h"
      14             : #include "typelib/typeclass.h"
      15             : #include "typelib/typedescription.h"
      16             : 
      17             : namespace test { namespace testtools { namespace bridgetest {
      18             : 
      19           7 : template< typename typeparam_T, typename typeparam_C > inline TestPolyStruct2< typeparam_T, typeparam_C >::TestPolyStruct2() SAL_THROW(())
      20             :     : member1()
      21           7 :     , member2()
      22             : {
      23           7 : }
      24             : 
      25          23 : template< typename typeparam_T, typename typeparam_C > inline TestPolyStruct2< typeparam_T, typeparam_C >::TestPolyStruct2(typeparam_T const & member1_, typeparam_C const & member2_) SAL_THROW(())
      26             :     : member1(member1_)
      27          23 :     , member2(member2_)
      28             : {
      29          23 : }
      30             : 
      31             : template< typename typeparam_T, typename typeparam_C > 
      32             : inline TestPolyStruct2< typeparam_T, typeparam_C >
      33             : make_TestPolyStruct2(typeparam_T const & member1_, typeparam_C const & member2_) SAL_THROW(())
      34             : {
      35             :     return TestPolyStruct2< typeparam_T, typeparam_C >(member1_, member2_);
      36             : }
      37             : 
      38             : } } }
      39             : 
      40             : namespace cppu {
      41             : 
      42             : template< typename typeparam_T, typename typeparam_C > class UnoType< ::test::testtools::bridgetest::TestPolyStruct2< typeparam_T, typeparam_C > > {
      43             : public:
      44          26 :     static inline ::com::sun::star::uno::Type const & get() {
      45             :         //TODO: On certain platforms with weak memory models, the following code can result in some threads observing that the_type points to garbage
      46             :         static ::typelib_TypeDescriptionReference * the_type = 0;
      47          26 :         if (the_type == 0) {
      48          14 :             ::rtl::OStringBuffer the_buffer("test.testtools.bridgetest.TestPolyStruct2<");
      49          14 :             the_buffer.append(::rtl::OUStringToOString(::cppu::getTypeFavourChar(static_cast< typeparam_T * >(0)).getTypeName(), RTL_TEXTENCODING_UTF8));
      50          14 :             the_buffer.append(',');
      51          14 :             the_buffer.append(::rtl::OUStringToOString(::cppu::getTypeFavourChar(static_cast< typeparam_C * >(0)).getTypeName(), RTL_TEXTENCODING_UTF8));
      52          14 :             the_buffer.append('>');
      53          14 :             ::typelib_static_type_init(&the_type, typelib_TypeClass_STRUCT, the_buffer.getStr());
      54             :         }
      55          26 :         return *reinterpret_cast< ::com::sun::star::uno::Type * >(&the_type);
      56             :     }
      57             : 
      58             : private:
      59             :     UnoType(UnoType &); // not defined
      60             :     ~UnoType(); // not defined
      61             :     void operator =(UnoType); // not defined
      62             : };
      63             : 
      64             : }
      65             : 
      66             : template< typename typeparam_T, typename typeparam_C > inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::test::testtools::bridgetest::TestPolyStruct2< typeparam_T, typeparam_C > const *) SAL_THROW(()) {
      67             :         return ::cppu::UnoType< ::test::testtools::bridgetest::TestPolyStruct2< typeparam_T, typeparam_C > >::get();
      68             :     }
      69             : 
      70             : #endif // INCLUDED_TEST_TESTTOOLS_BRIDGETEST_TESTPOLYSTRUCT2_HPP

Generated by: LCOV version 1.10