LCOV - code coverage report
Current view: top level - cppu/source/helper/purpenv - helper_purpenv_Environment.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 141 196 71.9 %
Date: 2014-11-03 Functions: 30 43 69.8 %
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             : 
      21             : #include "cppu/helper/purpenv/Environment.hxx"
      22             : 
      23             : #include "osl/diagnose.h"
      24             : #include "uno/lbnames.h"
      25             : 
      26             : #include "typelib/typedescription.h"
      27             : #include "osl/interlck.h"
      28             : 
      29             : #ifdef debug
      30             : # define LOG_LIFECYCLE_cppu_helper_purpenv_Base
      31             : #endif
      32             : 
      33             : #ifdef LOG_LIFECYCLE_cppu_helper_purpenv_Base
      34             : #  include <iostream>
      35             : #  define LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(x) x
      36             : 
      37             : #else
      38             : #  define LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(x)
      39             : 
      40             : #endif
      41             : 
      42             : 
      43             : extern "C" {
      44             : typedef void SAL_CALL EnvFun_P   (uno_Environment *);
      45             : typedef void SAL_CALL EnvFun_PP_P(uno_Environment ** ppHardEnv, uno_Environment *);
      46             : typedef void SAL_CALL ExtEnv_registerProxyInterface (uno_ExtEnvironment                 *,
      47             :                                                      void                              ** ppProxy,
      48             :                                                      uno_freeProxyFunc                    freeProxy,
      49             :                                                      rtl_uString * pOId,
      50             :                                                      typelib_InterfaceTypeDescription   * pTypeDescr);
      51             : typedef void SAL_CALL ExtEnv_revokeInterface        (uno_ExtEnvironment                 *,
      52             :                                                      void                               * pInterface);
      53             : typedef void SAL_CALL ExtEnv_getObjectIdentifier    (uno_ExtEnvironment                 *,
      54             :                                                      rtl_uString                       **,
      55             :                                                      void                               *);
      56             : typedef void SAL_CALL ExtEnv_getRegisteredInterface (uno_ExtEnvironment                 *,
      57             :                                                      void                              **,
      58             :                                                      rtl_uString                        *,
      59             :                                                      typelib_InterfaceTypeDescription   *);
      60             : typedef void SAL_CALL ExtEnv_getRegisteredInterfaces(uno_ExtEnvironment                 *,
      61             :                                                      void                             *** pppInterfaces,
      62             :                                                      sal_Int32                          * pnLen,
      63             :                                                      uno_memAlloc                         memAlloc);
      64             : typedef void SAL_CALL ExtEnv_computeObjectIdentifier(uno_ExtEnvironment                 *,
      65             :                                                      rtl_uString                       ** ppOId,
      66             :                                                      void                               * pInterface);
      67             : typedef void SAL_CALL ExtEnv_acquireInterface       (uno_ExtEnvironment                 *,
      68             :                                                      void                               * pInterface);
      69             : typedef void SAL_CALL ExtEnv_releaseInterface       (uno_ExtEnvironment                 *,
      70             :                                                      void                               * pInterface);
      71             : }
      72             : 
      73             : class Base : public cppu::Enterable
      74             : {
      75             : public:
      76             :     explicit Base(uno_Environment * pEnv, cppu::Enterable * pEnterable);
      77             : 
      78             :     void acquireWeak(void);
      79             :     void releaseWeak(void);
      80             :     void harden     (uno_Environment ** ppHardEnv);
      81             :     void acquire    (void);
      82             :     void release    (void);
      83             : 
      84             :     void registerProxyInterface (void                                  ** ppProxy,
      85             :                                  uno_freeProxyFunc                        freeProxy,
      86             :                                  rtl::OUString                    const & oid,
      87             :                                  typelib_InterfaceTypeDescription       * pTypeDescr);
      88             :     void revokeInterface        (void                                   * pInterface);
      89             :     void getObjectIdentifier    (void                                   * pInterface,
      90             :                                  rtl::OUString                          * pOid);
      91             :     void getRegisteredInterface (void                                  **,
      92             :                                  rtl::OUString                    const & oid,
      93             :                                  typelib_InterfaceTypeDescription       *);
      94             :     void getRegisteredInterfaces(void                                 ***,
      95             :                                  sal_Int32                              * pnLen,
      96             :                                  uno_memAlloc                             memAlloc);
      97             :     void computeObjectIdentifier(void                                   * pInterface,
      98             :                                  rtl::OUString                          * pOid);
      99             :     void acquireInterface       (void                                   * pInterface);
     100             :     void releaseInterface       (void                                   * pInterface);
     101             : 
     102             :     virtual void v_enter     (void) SAL_OVERRIDE;
     103             :     virtual void v_leave     (void) SAL_OVERRIDE;
     104             :     virtual void v_callInto_v(uno_EnvCallee * pCallee, va_list * pParam) SAL_OVERRIDE;
     105             :     virtual void v_callOut_v (uno_EnvCallee * pCallee, va_list * pParam) SAL_OVERRIDE;
     106             :     virtual bool v_isValid   (rtl::OUString * pReason) SAL_OVERRIDE;
     107             : 
     108             : protected:
     109             :     oslInterlockedCount    m_nRef;
     110             :     uno_Environment      * m_pEnv;
     111             :     cppu::Enterable      * m_pEnterable;
     112             : 
     113             :     EnvFun_P    * m_env_acquire;
     114             :     EnvFun_P    * m_env_release;
     115             :     EnvFun_PP_P * m_env_harden;
     116             :     EnvFun_P    * m_env_acquireWeak;
     117             :     EnvFun_P    * m_env_releaseWeak;
     118             : 
     119             :     ExtEnv_registerProxyInterface  * m_env_registerProxyInterface;
     120             :     ExtEnv_revokeInterface         * m_env_revokeInterface;
     121             :     ExtEnv_getObjectIdentifier     * m_env_getObjectIdentifier;
     122             :     ExtEnv_getRegisteredInterface  * m_env_getRegisteredInterface;
     123             :     ExtEnv_getRegisteredInterfaces * m_env_getRegisteredInterfaces;
     124             :     ExtEnv_computeObjectIdentifier * m_env_computeObjectIdentifier;
     125             :     ExtEnv_acquireInterface        * m_env_acquireInterface;
     126             :     ExtEnv_releaseInterface        * m_env_releaseInterface;
     127             : 
     128             :     virtual  ~Base();
     129             : };
     130             : 
     131             : extern "C" {
     132         656 : static void SAL_CALL s_acquire(uno_Environment * pEnv) //SAL_THROW_EXTERN_C()
     133             : {
     134         656 :     Base * pBase = static_cast<Base *>(pEnv->pReserved);
     135         656 :     pBase->acquire();
     136         656 : }
     137             : 
     138       15858 : static void SAL_CALL s_release(uno_Environment * pEnv) SAL_THROW_EXTERN_C()
     139             : {
     140       15858 :     Base * pBase = static_cast<Base *>(pEnv->pReserved);
     141       15858 :     pBase->release();
     142       15858 : }
     143             : 
     144       15258 : static void SAL_CALL s_harden(uno_Environment ** ppHardEnv, uno_Environment * pEnv) SAL_THROW_EXTERN_C()
     145             : {
     146       15258 :     Base * pBase = static_cast<Base *>(pEnv->pReserved);
     147       15258 :     pBase->harden(ppHardEnv);
     148       15258 : }
     149             : 
     150           4 : static void SAL_CALL s_acquireWeak(uno_Environment * pEnv) SAL_THROW_EXTERN_C()
     151             : {
     152           4 :     Base * pBase = static_cast<Base *>(pEnv->pReserved);
     153           4 :     pBase->acquireWeak();
     154           4 : }
     155             : 
     156           0 : static void SAL_CALL s_releaseWeak(uno_Environment * pEnv) SAL_THROW_EXTERN_C()
     157             : {
     158           0 :     Base * pBase = static_cast<Base *>(pEnv->pReserved);
     159           0 :     pBase->releaseWeak();
     160           0 : }
     161             : 
     162             : 
     163         296 : static void SAL_CALL s_registerProxyInterface(uno_ExtEnvironment                * pExtEnv,
     164             :                                                          void                             ** ppProxy,
     165             :                                                          uno_freeProxyFunc                   freeProxy,
     166             :                                                          rtl_uString                       * pOId,
     167             :                                                          typelib_InterfaceTypeDescription  * pTypeDescr)
     168             : {
     169         296 :     Base * pBase = static_cast<Base *>(pExtEnv->aBase.pReserved);
     170         296 :     pBase->registerProxyInterface(ppProxy, freeProxy, pOId, pTypeDescr);
     171         296 : }
     172             : 
     173         500 : static void SAL_CALL s_revokeInterface(uno_ExtEnvironment * pExtEnv, void * pInterface)
     174             : {
     175         500 :     Base * pBase = static_cast<Base *>(pExtEnv->aBase.pReserved);
     176         500 :     pBase->revokeInterface(pInterface);
     177         500 : }
     178             : 
     179         436 : static void SAL_CALL s_getObjectIdentifier(uno_ExtEnvironment *  pExtEnv,
     180             :                                                       rtl_uString        ** ppOId,
     181             :                                                       void               *  pInterface)
     182             : {
     183         436 :     Base * pBase = static_cast<Base *>(pExtEnv->aBase.pReserved);
     184         436 :     pBase->getObjectIdentifier(pInterface, reinterpret_cast<rtl::OUString *>(ppOId));
     185         436 : }
     186             : 
     187        1110 : static void SAL_CALL s_getRegisteredInterface(uno_ExtEnvironment *  pExtEnv,
     188             :                                                          void               ** ppInterface,
     189             :                                                          rtl_uString        *  pOId,
     190             :                                                          typelib_InterfaceTypeDescription * pTypeDescr)
     191             : {
     192        1110 :     Base * pBase = static_cast<Base *>(pExtEnv->aBase.pReserved);
     193        1110 :     pBase->getRegisteredInterface(ppInterface, pOId, pTypeDescr);
     194        1110 : }
     195             : 
     196           0 : static void SAL_CALL s_getRegisteredInterfaces(uno_ExtEnvironment   * pExtEnv,
     197             :                                                           void               *** pppInterface,
     198             :                                                           sal_Int32            * pnLen,
     199             :                                                           uno_memAlloc           memAlloc)
     200             : {
     201           0 :     Base * pBase = static_cast<Base *>(pExtEnv->aBase.pReserved);
     202           0 :     pBase->getRegisteredInterfaces(pppInterface, pnLen, memAlloc);
     203           0 : }
     204             : 
     205           0 : static void SAL_CALL s_computeObjectIdentifier(uno_ExtEnvironment *  pExtEnv,
     206             :                                                           rtl_uString        ** ppOId,
     207             :                                                           void               *  pInterface)
     208             : {
     209           0 :     Base * pBase = static_cast<Base *>(pExtEnv->aBase.pReserved);
     210           0 :     pBase->computeObjectIdentifier(pInterface, reinterpret_cast<rtl::OUString *>(ppOId));
     211           0 : }
     212             : 
     213         140 : static void SAL_CALL s_acquireInterface(uno_ExtEnvironment * pExtEnv, void * pInterface) {
     214         140 :     Base * pBase = static_cast<Base *>(pExtEnv->aBase.pReserved);
     215         140 :     pBase->acquireInterface(pInterface);
     216         140 : }
     217             : 
     218           8 : static void SAL_CALL s_releaseInterface(uno_ExtEnvironment * pExtEnv, void * pInterface) {
     219           8 :     Base * pBase = static_cast<Base *>(pExtEnv->aBase.pReserved);
     220           8 :     pBase->releaseInterface(pInterface);
     221           8 : }
     222             : 
     223             : }
     224             : 
     225           4 : Base::Base(uno_Environment * pEnv, cppu::Enterable * pEnterable)
     226             :     :m_nRef(1),
     227             :      m_pEnv(pEnv),
     228             :      m_pEnterable     (pEnterable),
     229             :      m_env_acquire    (pEnv->acquire),
     230             :      m_env_release    (pEnv->release),
     231             :      m_env_harden     (pEnv->harden),
     232             :      m_env_acquireWeak(pEnv->acquireWeak),
     233             :      m_env_releaseWeak(pEnv->releaseWeak),
     234             :      m_env_registerProxyInterface (pEnv->pExtEnv->registerProxyInterface),
     235             :      m_env_revokeInterface        (pEnv->pExtEnv->revokeInterface),
     236             :      m_env_getObjectIdentifier    (pEnv->pExtEnv->getObjectIdentifier),
     237             :      m_env_getRegisteredInterface (pEnv->pExtEnv->getRegisteredInterface),
     238             :      m_env_getRegisteredInterfaces(pEnv->pExtEnv->getRegisteredInterfaces),
     239             :      m_env_computeObjectIdentifier(pEnv->pExtEnv->computeObjectIdentifier),
     240             :      m_env_acquireInterface       (pEnv->pExtEnv->acquireInterface),
     241           4 :      m_env_releaseInterface       (pEnv->pExtEnv->releaseInterface)
     242             : {
     243             :     LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(fprintf(stderr, "LIFE: %s -> %p\n", "cppu::helper::purpenv::Base::Base(uno_Environment * pEnv)", this));
     244             :     OSL_ENSURE(
     245             :         rtl_ustr_ascii_compare_WithLength(pEnv->pTypeName->buffer, rtl_str_getLength(UNO_LB_UNO), UNO_LB_UNO)
     246             :             == 0,
     247             :             "### wrong environment type!");
     248             : 
     249           4 :     pEnv->acquire     = s_acquire;
     250           4 :     pEnv->release     = s_release;
     251           4 :     pEnv->harden      = s_harden;
     252           4 :     pEnv->acquireWeak = s_acquireWeak;
     253           4 :     pEnv->releaseWeak = s_releaseWeak;
     254             : 
     255           4 :     pEnv->pExtEnv->registerProxyInterface  = s_registerProxyInterface;
     256           4 :     pEnv->pExtEnv->revokeInterface         = s_revokeInterface;
     257           4 :     pEnv->pExtEnv->getObjectIdentifier     = s_getObjectIdentifier;
     258           4 :     pEnv->pExtEnv->getRegisteredInterface  = s_getRegisteredInterface;
     259           4 :     pEnv->pExtEnv->getRegisteredInterfaces = s_getRegisteredInterfaces;
     260           4 :     pEnv->pExtEnv->computeObjectIdentifier = s_computeObjectIdentifier;
     261           4 :     pEnv->pExtEnv->acquireInterface        = s_acquireInterface;
     262           4 :     pEnv->pExtEnv->releaseInterface        = s_releaseInterface;
     263             : 
     264           4 :     pEnv->pReserved = this;
     265           4 : }
     266             : 
     267           0 : Base::~Base()
     268             : {
     269             :     LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(fprintf(stderr, "LIFE: %s -> %p\n", "cppu::helper::purpenv::Base::~Base()", this));
     270             : 
     271           0 :     m_pEnv->acquire     = m_env_acquire;
     272           0 :     m_pEnv->release     = m_env_release;
     273           0 :     m_pEnv->harden      = m_env_harden;
     274           0 :     m_pEnv->acquireWeak = m_env_acquireWeak;
     275           0 :     m_pEnv->releaseWeak = m_env_releaseWeak;
     276             : 
     277           0 :     m_pEnv->pReserved = NULL;
     278             : 
     279           0 :     delete m_pEnterable;
     280           0 :     m_pEnv->release(m_pEnv);
     281           0 : }
     282             : 
     283         656 : void Base::acquire(void)
     284             : {
     285         656 :     m_env_acquire(m_pEnv);
     286             : 
     287         656 :     osl_atomic_increment(&m_nRef);
     288         656 : }
     289             : 
     290       15858 : void Base::release(void)
     291             : {
     292       15858 :     if (osl_atomic_decrement(&m_nRef) == 0)
     293           0 :         delete this;
     294             : 
     295             :     else
     296       15858 :         m_env_release(m_pEnv);
     297       15858 : }
     298             : 
     299       15258 : void Base::harden(uno_Environment ** ppHardEnv)
     300             : {
     301       15258 :     m_env_harden(ppHardEnv, m_pEnv);
     302       15258 :     osl_atomic_increment(&m_nRef);
     303       15258 : }
     304             : 
     305           4 : void Base::acquireWeak(void)
     306             : {
     307           4 :     m_env_acquireWeak(m_pEnv);
     308           4 : }
     309             : 
     310           0 : void Base::releaseWeak(void)
     311             : {
     312           0 :     m_env_releaseWeak(m_pEnv);
     313           0 : }
     314             : 
     315             : 
     316         296 : extern "C" { static void s_registerProxyInterface_v(va_list * pParam)
     317             : {
     318         296 :     uno_ExtEnvironment                   * pExtEnv    = va_arg(*pParam, uno_ExtEnvironment *);
     319         296 :     void                                ** ppProxy    = va_arg(*pParam, void **);
     320         296 :     uno_freeProxyFunc                      freeProxy  = va_arg(*pParam, uno_freeProxyFunc);
     321         296 :     rtl_uString                          * pOId       = va_arg(*pParam, rtl_uString *);
     322         296 :     typelib_InterfaceTypeDescription     * pTypeDescr = va_arg(*pParam, typelib_InterfaceTypeDescription *);
     323             :     ExtEnv_registerProxyInterface  * pRegisterProxyInterface
     324         296 :         = va_arg(*pParam, ExtEnv_registerProxyInterface *);
     325             : 
     326         296 :     pRegisterProxyInterface(pExtEnv, ppProxy, freeProxy, pOId, pTypeDescr);
     327         296 : }}
     328             : 
     329         296 : void Base::registerProxyInterface(void                                  ** ppProxy,
     330             :                                   uno_freeProxyFunc                        freeProxy,
     331             :                                   rtl::OUString                    const & oid,
     332             :                                   typelib_InterfaceTypeDescription       * pTypeDescr)
     333             : {
     334             :      uno_Environment_invoke(m_pEnv,
     335             :                            s_registerProxyInterface_v,
     336             :                            m_pEnv->pExtEnv,
     337             :                            ppProxy,
     338             :                            freeProxy,
     339             :                            oid.pData,
     340             :                            pTypeDescr,
     341         296 :                            m_env_registerProxyInterface);
     342         296 : }
     343             : 
     344             : 
     345         500 : extern "C" { static void s_revokeInterface_v(va_list * pParam)
     346             : {
     347         500 :     uno_ExtEnvironment * pExtEnv    = va_arg(*pParam, uno_ExtEnvironment *);
     348         500 :     void               * pInterface = va_arg(*pParam, void *);
     349         500 :     ExtEnv_revokeInterface * pRevokeInterface = va_arg(*pParam, ExtEnv_revokeInterface *);
     350             : 
     351         500 :     pRevokeInterface(pExtEnv, pInterface);
     352         500 : }}
     353             : 
     354         500 : void Base::revokeInterface(void * pInterface)
     355             : {
     356             :      uno_Environment_invoke(m_pEnv,
     357             :                            s_revokeInterface_v,
     358             :                            m_pEnv->pExtEnv,
     359             :                            pInterface,
     360         500 :                            m_env_revokeInterface);
     361         500 : }
     362             : 
     363             : 
     364         436 : extern "C" { static void s_getObjectIdentifier_v(va_list * pParam)
     365             : {
     366         436 :     uno_ExtEnvironment * pExtEnv    = va_arg(*pParam, uno_ExtEnvironment *);
     367         436 :     void               * pInterface = va_arg(*pParam, void *);
     368         436 :     rtl::OUString      * pOId       = va_arg(*pParam, rtl::OUString *);
     369             :     ExtEnv_getObjectIdentifier * pGetObjectIdentifier
     370         436 :         = va_arg(*pParam, ExtEnv_getObjectIdentifier *);
     371             : 
     372         436 :     pGetObjectIdentifier(pExtEnv, reinterpret_cast<rtl_uString **>(pOId), pInterface);
     373         436 : }}
     374             : 
     375         436 : void Base::getObjectIdentifier(void * pInterface, rtl::OUString * pOid)
     376             : {
     377             :      uno_Environment_invoke(m_pEnv,
     378             :                            s_getObjectIdentifier_v,
     379             :                            m_pEnv->pExtEnv,
     380             :                            pInterface,
     381             :                            pOid,
     382         436 :                            m_env_getObjectIdentifier);
     383         436 : }
     384             : 
     385             : 
     386        1110 : extern "C" { static void s_getRegisteredInterface_v(va_list * pParam)
     387             : {
     388        1110 :     uno_ExtEnvironment                   * pExtEnv     = va_arg(*pParam, uno_ExtEnvironment *);
     389        1110 :     void                                ** ppInterface = va_arg(*pParam, void **);
     390        1110 :     rtl_uString                          * pOId        = va_arg(*pParam, rtl_uString *);
     391        1110 :     typelib_InterfaceTypeDescription     * pTypeDescr  = va_arg(*pParam, typelib_InterfaceTypeDescription *);
     392             :     ExtEnv_getRegisteredInterface  * pGetRegisteredInterface
     393        1110 :         = va_arg(*pParam, ExtEnv_getRegisteredInterface *);
     394             : 
     395        1110 :     pGetRegisteredInterface(pExtEnv, ppInterface, pOId, pTypeDescr);
     396        1110 : }}
     397             : 
     398        1110 : void Base::getRegisteredInterface(void ** ppInterface,
     399             :                                   rtl::OUString const & oid,
     400             :                                   typelib_InterfaceTypeDescription * pTypeDescr)
     401             : {
     402             :      uno_Environment_invoke(m_pEnv,
     403             :                            s_getRegisteredInterface_v,
     404             :                            m_pEnv->pExtEnv,
     405             :                            ppInterface,
     406             :                            oid.pData,
     407             :                            pTypeDescr,
     408        1110 :                            m_env_getRegisteredInterface);
     409        1110 : }
     410             : 
     411             : 
     412           0 : extern "C" { static void s_getRegisteredInterfaces_v(va_list * pParam)
     413             : {
     414           0 :     uno_ExtEnvironment   * pExtEnv      = va_arg(*pParam, uno_ExtEnvironment *);
     415           0 :     void               *** pppInterface = va_arg(*pParam, void ***);
     416           0 :     sal_Int32            * pnLen        = va_arg(*pParam, sal_Int32 *);
     417           0 :     uno_memAlloc           memAlloc     = va_arg(*pParam, uno_memAlloc);
     418             :     ExtEnv_getRegisteredInterfaces * pGetRegisteredInterfaces
     419           0 :         = va_arg(*pParam, ExtEnv_getRegisteredInterfaces *);
     420             : 
     421           0 :     pGetRegisteredInterfaces(pExtEnv, pppInterface, pnLen, memAlloc);
     422           0 : }}
     423             : 
     424           0 : void Base::getRegisteredInterfaces(void         *** pppInterface,
     425             :                                    sal_Int32      * pnLen,
     426             :                                    uno_memAlloc     memAlloc)
     427             : {
     428             :      uno_Environment_invoke(m_pEnv,
     429             :                            s_getRegisteredInterfaces_v,
     430             :                            m_pEnv->pExtEnv,
     431             :                            pppInterface,
     432             :                            pnLen,
     433             :                            memAlloc,
     434           0 :                            m_env_getRegisteredInterfaces);
     435           0 : }
     436             : 
     437             : 
     438           0 : extern "C" { static void s_computeObjectIdentifier_v(va_list * pParam)
     439             : {
     440           0 :     uno_ExtEnvironment * pExtEnv    = va_arg(*pParam, uno_ExtEnvironment *);
     441           0 :     void               * pInterface = va_arg(*pParam, void *);
     442           0 :     rtl::OUString      * pOId       = va_arg(*pParam, rtl::OUString *);
     443             :     ExtEnv_computeObjectIdentifier * pComputeObjectIdentifier
     444           0 :         = va_arg(*pParam, ExtEnv_computeObjectIdentifier *);
     445             : 
     446           0 :     pComputeObjectIdentifier(pExtEnv, reinterpret_cast<rtl_uString **>(pOId), pInterface);
     447           0 : }}
     448             : 
     449           0 : void Base::computeObjectIdentifier(void * pInterface, rtl::OUString * pOid)
     450             : {
     451             :      uno_Environment_invoke(m_pEnv,
     452             :                            s_computeObjectIdentifier_v,
     453             :                            m_pEnv->pExtEnv,
     454             :                            pInterface,
     455             :                            pOid,
     456           0 :                            m_env_computeObjectIdentifier);
     457           0 : }
     458             : 
     459             : 
     460         140 : extern "C" { static void s_acquireInterface_v(va_list * pParam)
     461             : {
     462         140 :     uno_ExtEnvironment * pExtEnv    = va_arg(*pParam, uno_ExtEnvironment *);
     463         140 :     void               * pInterface = va_arg(*pParam, void *);
     464             :     ExtEnv_acquireInterface * pAcquireInterface
     465         140 :         = va_arg(*pParam, ExtEnv_acquireInterface *);
     466             : 
     467         140 :     pAcquireInterface(pExtEnv, pInterface);
     468         140 : }}
     469             : 
     470         140 : void Base::acquireInterface(void * pInterface)
     471             : {
     472         140 :      uno_Environment_invoke(m_pEnv, s_acquireInterface_v, m_pEnv->pExtEnv, pInterface, m_env_acquireInterface);
     473         140 : }
     474             : 
     475             : 
     476           8 : extern "C" { static void s_releaseInterface_v(va_list * pParam)
     477             : {
     478           8 :     uno_ExtEnvironment * pExtEnv    = va_arg(*pParam, uno_ExtEnvironment *);
     479           8 :     void               * pInterface = va_arg(*pParam, void *);
     480             :     ExtEnv_releaseInterface * pReleaseInterface
     481           8 :         = va_arg(*pParam, ExtEnv_releaseInterface *);
     482             : 
     483           8 :     pReleaseInterface(pExtEnv, pInterface);
     484           8 : }}
     485             : 
     486           8 : void Base::releaseInterface(void * pInterface)
     487             : {
     488             :      uno_Environment_invoke(m_pEnv,
     489             :                            s_releaseInterface_v,
     490             :                            m_pEnv->pExtEnv,
     491             :                            pInterface,
     492           8 :                            m_env_releaseInterface);
     493           8 : }
     494             : 
     495           0 : void Base::v_enter(void)
     496             : {
     497           0 :     m_pEnterable->enter();
     498           0 : }
     499             : 
     500           0 : void Base::v_leave(void)
     501             : {
     502           0 :     m_pEnterable->leave();
     503           0 : }
     504             : 
     505       15254 : void Base::v_callInto_v(uno_EnvCallee * pCallee, va_list * pParam)
     506             : {
     507       15254 :     m_pEnterable->callInto_v(pCallee, pParam);
     508       15254 : }
     509             : 
     510         560 : void Base::v_callOut_v(uno_EnvCallee * pCallee, va_list * pParam)
     511             : {
     512         560 :     m_pEnterable->callOut_v(pCallee, pParam);
     513         560 : }
     514             : 
     515           0 : bool Base::v_isValid(rtl::OUString * pReason)
     516             : {
     517           0 :     return m_pEnterable->isValid(pReason);
     518             : }
     519             : 
     520             : namespace cppu { namespace helper { namespace purpenv {
     521             : 
     522           4 : void Environment_initWithEnterable(uno_Environment * pEnvironment, cppu::Enterable * pEnterable)
     523             : {
     524           4 :     new Base(pEnvironment, pEnterable);
     525           4 : }
     526             : 
     527             : }}}
     528             : 
     529             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10