LCOV - code coverage report
Current view: top level - include/uno - dispatcher.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 39 41 95.1 %
Date: 2014-11-03 Functions: 11 11 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_UNO_DISPATCHER_HXX
      21             : #define INCLUDED_UNO_DISPATCHER_HXX
      22             : 
      23             : #include <uno/dispatcher.h>
      24             : 
      25             : /// @cond INTERNAL
      26             : 
      27             : namespace com
      28             : {
      29             : namespace sun
      30             : {
      31             : namespace star
      32             : {
      33             : namespace uno
      34             : {
      35             : 
      36             : /** C++ holder reference for binary C uno_Interface.  Not for public use, may be
      37             :     subject to changes.
      38             : 
      39             :     @see uno_Interface
      40             :     @attention
      41             :               not for public use!
      42             : */
      43             : class UnoInterfaceReference
      44             : {
      45             : public:
      46             :     uno_Interface * m_pUnoI;
      47             : 
      48      762195 :     inline bool is() const
      49      762195 :         { return m_pUnoI != 0; }
      50             : 
      51             :     inline ~UnoInterfaceReference();
      52             :     inline UnoInterfaceReference();
      53             :     inline UnoInterfaceReference( uno_Interface * pUnoI, __sal_NoAcquire );
      54             :     inline UnoInterfaceReference( uno_Interface * pUnoI );
      55             :     inline UnoInterfaceReference( UnoInterfaceReference const & ref );
      56             : 
      57     1040164 :     inline uno_Interface * get() const
      58     1040164 :         { return m_pUnoI; }
      59             : 
      60             :     inline UnoInterfaceReference & set(
      61             :         uno_Interface * pUnoI );
      62             :     inline UnoInterfaceReference & set(
      63             :         uno_Interface * pUnoI, __sal_NoAcquire );
      64             :     inline void clear();
      65             : 
      66     1365086 :     inline UnoInterfaceReference & operator = (
      67             :         UnoInterfaceReference const & ref )
      68     1365086 :         { return set( ref.m_pUnoI ); }
      69             :     inline UnoInterfaceReference & operator = (
      70             :         uno_Interface * pUnoI )
      71             :         { return set( pUnoI ); }
      72             : 
      73             :     inline void dispatch(
      74             :         struct _typelib_TypeDescription const * pMemberType,
      75             :         void * pReturn, void * pArgs [], uno_Any ** ppException ) const;
      76             : 
      77             : private:
      78             :     inline bool operator == ( UnoInterfaceReference const & ); // not impl
      79             :     inline bool operator != ( UnoInterfaceReference const & ); // not impl
      80             :     inline bool operator == ( uno_Interface * ); // not impl
      81             :     inline bool operator != ( uno_Interface * ); // not impl
      82             : };
      83             : 
      84             : 
      85     6460769 : inline UnoInterfaceReference::~UnoInterfaceReference()
      86             : {
      87     6460769 :     if (m_pUnoI != 0)
      88     1571201 :         (*m_pUnoI->release)( m_pUnoI );
      89     6460888 : }
      90             : 
      91             : 
      92     3393462 : inline UnoInterfaceReference::UnoInterfaceReference()
      93     3393462 :     : m_pUnoI( 0 )
      94             : {
      95     3393462 : }
      96             : 
      97             : 
      98        4762 : inline UnoInterfaceReference::UnoInterfaceReference(
      99             :     uno_Interface * pUnoI, __sal_NoAcquire )
     100        4762 :     : m_pUnoI( pUnoI )
     101             : {
     102        4762 : }
     103             : 
     104             : 
     105      169362 : inline UnoInterfaceReference::UnoInterfaceReference( uno_Interface * pUnoI )
     106      169362 :     : m_pUnoI( pUnoI )
     107             : {
     108      169362 :     if (m_pUnoI != 0)
     109      152406 :         (*m_pUnoI->acquire)( m_pUnoI );
     110      169362 : }
     111             : 
     112             : 
     113     2895229 : inline UnoInterfaceReference::UnoInterfaceReference(
     114             :     UnoInterfaceReference const & ref )
     115     2895229 :     : m_pUnoI( ref.m_pUnoI )
     116             : {
     117     2895229 :     if (m_pUnoI != 0)
     118      829814 :         (*m_pUnoI->acquire)( m_pUnoI );
     119     2895229 : }
     120             : 
     121             : 
     122     1757012 : inline UnoInterfaceReference & UnoInterfaceReference::set(
     123             :     uno_Interface * pUnoI )
     124             : {
     125     1757012 :     if (pUnoI != 0)
     126      558319 :         (*pUnoI->acquire)( pUnoI );
     127     1757014 :     if (m_pUnoI != 0)
     128           0 :         (*m_pUnoI->release)( m_pUnoI );
     129     1757014 :     m_pUnoI = pUnoI;
     130     1757014 :     return *this;
     131             : }
     132             : 
     133             : 
     134        8618 : inline UnoInterfaceReference & UnoInterfaceReference::set(
     135             :     uno_Interface * pUnoI, __sal_NoAcquire )
     136             : {
     137        8618 :     if (m_pUnoI != 0)
     138           0 :         (*m_pUnoI->release)( m_pUnoI );
     139        8618 :     m_pUnoI = pUnoI;
     140        8618 :     return *this;
     141             : }
     142             : 
     143             : 
     144             : inline void UnoInterfaceReference::clear()
     145             : {
     146             :     if (m_pUnoI != 0)
     147             :     {
     148             :         (*m_pUnoI->release)( m_pUnoI );
     149             :         m_pUnoI = 0;
     150             :     }
     151             : }
     152             : 
     153             : 
     154       18256 : inline void UnoInterfaceReference::dispatch(
     155             :     struct _typelib_TypeDescription const * pMemberType,
     156             :     void * pReturn, void * pArgs [], uno_Any ** ppException ) const
     157             : {
     158             :     (*m_pUnoI->pDispatcher)(
     159       18256 :         m_pUnoI, pMemberType, pReturn, pArgs, ppException );
     160       18256 : }
     161             : 
     162             : }
     163             : }
     164             : }
     165             : }
     166             : 
     167             : /// @endcond
     168             : 
     169             : #endif
     170             : 
     171             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10