Debian Codegraph @

src/main/c/jpy_jmethod.h

raw symbols SCIP
1 /*
2 * Copyright 2015 Brockmann Consult GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * This file was modified by Deephaven Data Labs.
17 */
18
19 #ifndef JPY_JMETHOD_H
20 #define JPY_JMETHOD_H
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #include "jpy_compat.h"
27
28 /**
29 * Python object representing a Java method. It's type is 'JMethod'.
30 */
31 typedef struct
32 {
33 PyObject_HEAD
34
35 // The declaring class.
36 JPy_JType* declaringClass;
37 // Method name.
38 PyObject* name;
39 // Method parameter count.
40 int paramCount;
41 // Method is static?
42 char isStatic;
43 // Method is varargs?
44 char isVarArgs;
45 // Method parameter types. Will be NULL, if parameter_count == 0.
46 JPy_ParamDescriptor* paramDescriptors;
47 // Method return type. Will be NULL for constructors.
48 JPy_ReturnDescriptor* returnDescriptor;
49 // The JNI method ID obtained from the declaring class.
50 jmethodID mid;
51 }
52 JPy_JMethod;
53
54 /**
55 * The Python 'JMethod' type singleton.
56 */
57 extern PyTypeObject JMethod_Type;
58
59 /**
60 * Python object representing an overloaded Java method. It's type is 'JOverloadedMethod'.
61 */
62 typedef struct
63 {
64 PyObject_HEAD
65
66 // The declaring class.
67 JPy_JType* declaringClass;
68 // Method name.
69 PyObject* name;
70 // List of method overloads (a PyList with items of type JPy_JMethod).
71 PyObject* methodList;
72 }
73 JPy_JOverloadedMethod;
74
75 /**
76 * The Python 'JOverloadedMethod' type singleton.
77 */
78 extern PyTypeObject JOverloadedMethod_Type;
79
80 JPy_JMethod* JOverloadedMethod_FindMethod(JNIEnv* jenv, JPy_JOverloadedMethod* overloadedMethod, PyObject* argTuple, jboolean visitSuperClass, int *isVarArgsArray);
81 JPy_JMethod* JOverloadedMethod_FindStaticMethod(JPy_JOverloadedMethod* overloadedMethod, PyObject* argTuple);
82 JPy_JOverloadedMethod* JOverloadedMethod_New(JPy_JType* declaringClass, PyObject* name, JPy_JMethod* method);
83 int JOverloadedMethod_AddMethod(JPy_JOverloadedMethod* overloadedMethod, JPy_JMethod* method);
84
85 JPy_JMethod* JMethod_New(JPy_JType* declaringClass,
86 PyObject* name,
87 int paramCount,
88 JPy_ParamDescriptor* paramDescriptors,
89 JPy_ReturnDescriptor* returnDescriptor,
90 jboolean isStatic,
91 jboolean isVarArgs,
92 jmethodID mid);
93
94 void JMethod_Del(JPy_JMethod* method);
95
96 int JMethod_ConvertToJavaValues(JNIEnv* jenv, JPy_JMethod* jMethod, int argCount, PyObject* argTuple, jvalue* jArgs);
97
98 int JMethod_CreateJArgs(JNIEnv* jenv, JPy_JMethod* jMethod, PyObject* argTuple, jvalue** jValues, JPy_ArgDisposer** jDisposers, int isVarArgsArray);
99 void JMethod_DisposeJArgs(JNIEnv* jenv, int paramCount, jvalue* jValues, JPy_ArgDisposer* jDisposers);
100
101 #ifdef __cplusplus
102 } /* extern "C" */
103 #endif
104
105 #endif /* !JPY_JMETHOD_H */