LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/udkapi/com/sun/star/beans - Optional.hpp (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 13 23.1 %
Date: 2012-12-27 Functions: 1 8 12.5 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #ifndef INCLUDED_COM_SUN_STAR_BEANS_OPTIONAL_HPP
       2             : #define INCLUDED_COM_SUN_STAR_BEANS_OPTIONAL_HPP
       3             : 
       4             : #include "sal/config.h"
       5             : 
       6             : #include "com/sun/star/beans/Optional.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 com { namespace sun { namespace star { namespace beans {
      18             : 
      19         241 : template< typename typeparam_T > inline Optional< typeparam_T >::Optional() SAL_THROW(())
      20             :     : IsPresent(false)
      21         241 :     , Value()
      22             : {
      23         241 : }
      24             : 
      25           0 : template< typename typeparam_T > inline Optional< typeparam_T >::Optional(const ::sal_Bool& IsPresent_, typeparam_T const & Value_) SAL_THROW(())
      26             :     : IsPresent(IsPresent_)
      27           0 :     , Value(Value_)
      28             : {
      29           0 : }
      30             : 
      31             : template< typename typeparam_T > 
      32             : inline Optional< typeparam_T >
      33             : make_Optional(const ::sal_Bool& IsPresent_, typeparam_T const & Value_) SAL_THROW(())
      34             : {
      35             :     return Optional< typeparam_T >(IsPresent_, Value_);
      36             : }
      37             : 
      38             : } } } }
      39             : 
      40             : namespace cppu {
      41             : 
      42             : template< typename typeparam_T > class UnoType< css::beans::Optional< typeparam_T > > {
      43             : public:
      44           0 :     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           0 :         if (the_type == 0) {
      48           0 :             ::rtl::OStringBuffer the_buffer("com.sun.star.beans.Optional<");
      49           0 :             the_buffer.append(::rtl::OUStringToOString(::cppu::getTypeFavourChar(static_cast< typeparam_T * >(0)).getTypeName(), RTL_TEXTENCODING_UTF8));
      50           0 :             the_buffer.append('>');
      51           0 :             ::typelib_static_type_init(&the_type, typelib_TypeClass_STRUCT, the_buffer.getStr());
      52             :         }
      53           0 :         return *reinterpret_cast< ::com::sun::star::uno::Type * >(&the_type);
      54             :     }
      55             : 
      56             : private:
      57             :     UnoType(UnoType &); // not defined
      58             :     ~UnoType(); // not defined
      59             :     void operator =(UnoType); // not defined
      60             : };
      61             : 
      62             : }
      63             : 
      64             : template< typename typeparam_T > inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER css::beans::Optional< typeparam_T > const *) SAL_THROW(()) {
      65             :         return ::cppu::UnoType< css::beans::Optional< typeparam_T > >::get();
      66             :     }
      67             : 
      68             : #endif // INCLUDED_COM_SUN_STAR_BEANS_OPTIONAL_HPP

Generated by: LCOV version 1.10