xref: /aoo42x/main/cppu/source/helper/purpenv/Proxy.hxx (revision c6ed87c9)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_Proxy_hxx
25 #define INCLUDED_Proxy_hxx
26 
27 #include "osl/interlck.h"
28 
29 #include "uno/environment.hxx"
30 #include "uno/mapping.hxx"
31 #include "uno/dispatcher.h"
32 
33 #include "cppu/helper/purpenv/Mapping.hxx"
34 
35 
36 namespace cssu = com::sun::star::uno;
37 
38 
39 class SAL_DLLPRIVATE Proxy : public uno_Interface
40 {
41     oslInterlockedCount                 m_nRef;
42 
43 	cssu::Environment                   m_from;
44 	cssu::Environment                   m_to;
45 
46 	cssu::Mapping                       m_from_to;
47 	cssu::Mapping                       m_to_from;
48 
49     // mapping information
50     uno_Interface                    *  m_pUnoI; // wrapped interface
51     typelib_InterfaceTypeDescription *  m_pTypeDescr;
52     rtl::OUString                       m_aOId;
53 
54 	cppu::helper::purpenv::ProbeFun   * m_probeFun;
55 	void                              * m_pProbeContext;
56 
57 public:
58     explicit Proxy(cssu::Mapping                    const & to_from,
59 				   uno_Environment                        * pTo,
60 				   uno_Environment                        * pFrom,
61 				   uno_Interface                          * pUnoI,
62 				   typelib_InterfaceTypeDescription       * pTypeDescr,
63 				   rtl::OUString                    const & rOId,
64 				   cppu::helper::purpenv::ProbeFun        * probeFun,
65 				   void                                   * pProbeContext)
66 		SAL_THROW( () );
67     ~Proxy(void);
68 
69 	void acquire(void);
70 	void release(void);
71 
72     void dispatch(
73         typelib_TypeDescriptionReference  * pReturnTypeRef,
74         typelib_MethodParameter           * pParams,
75         sal_Int32                           nParams,
76         typelib_TypeDescription     const * pMemberType,
77         void                              * pReturn,
78         void                              * pArgs[],
79         uno_Any                          ** ppException );
80 
81 };
82 
83 extern "C" SAL_DLLPRIVATE void SAL_CALL Proxy_free(uno_ExtEnvironment * pEnv, void * pProxy) SAL_THROW_EXTERN_C();
84 
85 #endif
86