Debian Codegraph @

native/common/include/jp_match.h

raw symbols SCIP
1 /*****************************************************************************
2 Licensed under the Apache License, Version 2.0 (the "License");
3 you may not use this file except in compliance with the License.
4 You may obtain a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS,
10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 See the License for the specific language governing permissions and
12 limitations under the License.
13
14 See NOTICE file for details.
15 *****************************************************************************/
16 #ifndef JP_MATCH_H
17 #define JP_MATCH_H
18
19 class JPConversion;
20
21 class JPMatch
22 {
23 public:
24
25 enum Type
26 {
27 _none = 0,
28 _explicit = 1,
29 _implicit = 2,
30 _derived = 3,
31 _exact = 4
32 } ;
33
34 public:
35 JPMatch();
36 JPMatch(JPJavaFrame *frame, PyObject *object);
37
38 /**
39 * Get the Java slot associated with the Python object.
40 *
41 * Thus uses caching.
42 *
43 * @return the Java slot or 0 if not available.
44 */
45 JPValue *getJavaSlot();
46
47 jvalue convert();
48
49 public:
50 JPMatch::Type type;
51 JPConversion *conversion;
52 JPJavaFrame *frame;
53 PyObject *object;
54 JPValue *slot;
55 void *closure;
56 } ;
57
58 class JPMethodCache
59 {
60 public:
61 long m_Hash;
62 JPMethod* m_Overload;
63 } ;
64
65 class JPMethodMatch : public JPMethodCache
66 {
67 public:
68
69 JPMethodMatch(JPJavaFrame &frame, JPPyObjectVector& args, bool callInstance);
70
71 JPMatch& operator[](size_t i)
72 {
73 return m_Arguments[i];
74 }
75
76 const JPMatch& operator[](size_t i) const
77 {
78 return m_Arguments[i];
79 }
80
81 std::vector<JPMatch> m_Arguments;
82 JPMatch::Type m_Type;
83 bool m_IsVarIndirect;
84 char m_Offset;
85 char m_Skip;
86 } ;
87
88 #endif /* JP_MATCH_H */