Debian Codegraph @

native/common/include/jp_field.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 _JPFIELD_H_
17 #define _JPFIELD_H_
18
19 /**
20 * Field object
21 */
22 class JPField
23 {
24 public:
25 /**
26 * Create a new field based on class and java.lang.Field object
27 */
28 JPField(JPJavaFrame& frame,
29 JPClass *cls,
30 const string& name,
31 jobject field,
32 jfieldID fid,
33 JPClass *fieldType,
34 jint modifiers);
35
36 /**
37 * destructor
38 */
39 virtual ~JPField();
40
41 // disallow copying.
42 JPField(const JPField&) = delete;
43 JPField& operator=(const JPField&) = delete;
44
45 jobject getJavaObject()
46 {
47 return this->m_Field.get();
48 }
49
50 const string& getName() const
51 {
52 return m_Name;
53 }
54
55 JPPyObject getStaticField();
56 void setStaticField(PyObject *pyobj);
57
58 JPPyObject getField(jobject inst);
59 void setField(jobject inst, PyObject *pyobj);
60
61 bool isFinal() const
62 {
63 return JPModifier::isFinal(m_Modifiers);
64 }
65
66 bool isStatic() const
67 {
68 return JPModifier::isStatic(m_Modifiers);
69 }
70
71 JPClass *getClass() const
72 {
73 return m_Class;
74 }
75
76 private:
77 string m_Name;
78 JPClass* m_Class;
79 JPObjectRef m_Field;
80 jfieldID m_FieldID;
81 JPClass* m_Type;
82 jint m_Modifiers;
83 } ;
84
85 #endif // _JPFIELD_H_