xref: /aoo4110/main/cppu/inc/uno/dispatcher.h (revision b1cdbd2c)
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 #ifndef _UNO_DISPATCHER_H_
24 #define _UNO_DISPATCHER_H_
25 
26 #include <sal/types.h>
27 #include <rtl/ustring.h>
28 #include <uno/any2.h>
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 struct _typelib_TypeDescription;
36 struct _uno_Interface;
37 
38 /** Function pointer declaration for the binary C uno dispatch function. Any pure out or return
39     value will be constructed by the callee, iff no exception is signalled.
40 	If an exception is signalled, the any *ppException is properly constructed by the callee,
41     otherwise the pointer *ppException is set to 0.
42 	An attribute get call is indicated by a non-null return pointer.
43 
44 	@param pUnoI		uno interface the call is performed on
45 	@param pMemberType	member type description of a method or attribute
46 	@param pReturn	    pointer to return value memory;
47 						pointer may be undefined if void method, null if attribute set call.
48 	@param pArgs		an array of pointers to arguments values.
49 						(remark: the value of an interface reference stores a
50 						 uno_interface *, so you get it by *(uno_Interface **)pArgs[n])
51 	@param ppException	pointer to pointer to unconstructed any to signal an exception.
52 */
53 typedef void (SAL_CALL * uno_DispatchMethod)(
54 	struct _uno_Interface * pUnoI,
55 	const struct _typelib_TypeDescription * pMemberType,
56 	void * pReturn,
57 	void * pArgs[],
58 	uno_Any ** ppException );
59 
60 #if defined( SAL_W32)
61 #pragma pack(push, 8)
62 #elif defined(SAL_OS2)
63 #pragma pack(push, 8)
64 #endif
65 
66 /** The binary C uno interface description.
67 */
68 typedef struct _uno_Interface
69 {
70 	/** Acquires uno interface.
71 
72 		@param pInterface uno interface
73 	*/
74 	void (SAL_CALL * acquire)( struct _uno_Interface * pInterface );
75 	/** Releases uno interface.
76 
77 		@param pInterface uno interface
78 	*/
79 	void (SAL_CALL * release)( struct _uno_Interface * pInterface );
80 	/** dispatch function
81 	*/
82 	uno_DispatchMethod pDispatcher;
83 } uno_Interface;
84 
85 #if defined( SAL_W32) ||  defined(SAL_OS2)
86 #pragma pack(pop)
87 #endif
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif
94