lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Loading...
Searching...
No Matches
typed_methods.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <jni.h>
4
5namespace jni
6 {
7 template < class R > struct TypedMethods;
8
9 template <> struct TypedMethods< jobject* >
10 {
11 static constexpr auto CallMethod = &JNIEnv::CallObjectMethod;
12 static constexpr auto CallNonvirtualMethod = &JNIEnv::CallNonvirtualObjectMethod;
13 static constexpr auto GetField = &JNIEnv::GetObjectField;
14 static constexpr auto SetField = &JNIEnv::SetObjectField;
15 static constexpr auto CallStaticMethod = &JNIEnv::CallStaticObjectMethod;
16 static constexpr auto GetStaticField = &JNIEnv::GetStaticObjectField;
17 static constexpr auto SetStaticField = &JNIEnv::SetStaticObjectField;
18 };
19
20 template <> struct TypedMethods< jboolean >
21 {
22 static constexpr auto CallMethod = &JNIEnv::CallBooleanMethod;
23 static constexpr auto CallNonvirtualMethod = &JNIEnv::CallNonvirtualBooleanMethod;
24 static constexpr auto GetField = &JNIEnv::GetBooleanField;
25 static constexpr auto SetField = &JNIEnv::SetBooleanField;
26 static constexpr auto CallStaticMethod = &JNIEnv::CallStaticBooleanMethod;
27 static constexpr auto GetStaticField = &JNIEnv::GetStaticBooleanField;
28 static constexpr auto SetStaticField = &JNIEnv::SetStaticBooleanField;
29 static constexpr auto NewArray = &JNIEnv::NewBooleanArray;
30 static constexpr auto GetArrayElements = &JNIEnv::GetBooleanArrayElements;
31 static constexpr auto ReleaseArrayElements = &JNIEnv::ReleaseBooleanArrayElements;
32 static constexpr auto GetArrayRegion = &JNIEnv::GetBooleanArrayRegion;
33 static constexpr auto SetArrayRegion = &JNIEnv::SetBooleanArrayRegion;
34 };
35
36 template <> struct TypedMethods< jbyte >
37 {
38 static constexpr auto CallMethod = &JNIEnv::CallByteMethod;
39 static constexpr auto CallNonvirtualMethod = &JNIEnv::CallNonvirtualByteMethod;
40 static constexpr auto GetField = &JNIEnv::GetByteField;
41 static constexpr auto SetField = &JNIEnv::SetByteField;
42 static constexpr auto CallStaticMethod = &JNIEnv::CallStaticByteMethod;
43 static constexpr auto GetStaticField = &JNIEnv::GetStaticByteField;
44 static constexpr auto SetStaticField = &JNIEnv::SetStaticByteField;
45 static constexpr auto NewArray = &JNIEnv::NewByteArray;
46 static constexpr auto GetArrayElements = &JNIEnv::GetByteArrayElements;
47 static constexpr auto ReleaseArrayElements = &JNIEnv::ReleaseByteArrayElements;
48 static constexpr auto GetArrayRegion = &JNIEnv::GetByteArrayRegion;
49 static constexpr auto SetArrayRegion = &JNIEnv::SetByteArrayRegion;
50 };
51
52 template <> struct TypedMethods< jchar >
53 {
54 static constexpr auto CallMethod = &JNIEnv::CallCharMethod;
55 static constexpr auto CallNonvirtualMethod = &JNIEnv::CallNonvirtualCharMethod;
56 static constexpr auto GetField = &JNIEnv::GetCharField;
57 static constexpr auto SetField = &JNIEnv::SetCharField;
58 static constexpr auto CallStaticMethod = &JNIEnv::CallStaticCharMethod;
59 static constexpr auto GetStaticField = &JNIEnv::GetStaticCharField;
60 static constexpr auto SetStaticField = &JNIEnv::SetStaticCharField;
61 static constexpr auto NewArray = &JNIEnv::NewCharArray;
62 static constexpr auto GetArrayElements = &JNIEnv::GetCharArrayElements;
63 static constexpr auto ReleaseArrayElements = &JNIEnv::ReleaseCharArrayElements;
64 static constexpr auto GetArrayRegion = &JNIEnv::GetCharArrayRegion;
65 static constexpr auto SetArrayRegion = &JNIEnv::SetCharArrayRegion;
66 };
67
68 template <> struct TypedMethods< jshort >
69 {
70 static constexpr auto CallMethod = &JNIEnv::CallShortMethod;
71 static constexpr auto CallNonvirtualMethod = &JNIEnv::CallNonvirtualShortMethod;
72 static constexpr auto GetField = &JNIEnv::GetShortField;
73 static constexpr auto SetField = &JNIEnv::SetShortField;
74 static constexpr auto CallStaticMethod = &JNIEnv::CallStaticShortMethod;
75 static constexpr auto GetStaticField = &JNIEnv::GetStaticShortField;
76 static constexpr auto SetStaticField = &JNIEnv::SetStaticShortField;
77 static constexpr auto NewArray = &JNIEnv::NewShortArray;
78 static constexpr auto GetArrayElements = &JNIEnv::GetShortArrayElements;
79 static constexpr auto ReleaseArrayElements = &JNIEnv::ReleaseShortArrayElements;
80 static constexpr auto GetArrayRegion = &JNIEnv::GetShortArrayRegion;
81 static constexpr auto SetArrayRegion = &JNIEnv::SetShortArrayRegion;
82 };
83
84 template <> struct TypedMethods< jint >
85 {
86 static constexpr auto CallMethod = &JNIEnv::CallIntMethod;
87 static constexpr auto CallNonvirtualMethod = &JNIEnv::CallNonvirtualIntMethod;
88 static constexpr auto GetField = &JNIEnv::GetIntField;
89 static constexpr auto SetField = &JNIEnv::SetIntField;
90 static constexpr auto CallStaticMethod = &JNIEnv::CallStaticIntMethod;
91 static constexpr auto GetStaticField = &JNIEnv::GetStaticIntField;
92 static constexpr auto SetStaticField = &JNIEnv::SetStaticIntField;
93 static constexpr auto NewArray = &JNIEnv::NewIntArray;
94 static constexpr auto GetArrayElements = &JNIEnv::GetIntArrayElements;
95 static constexpr auto ReleaseArrayElements = &JNIEnv::ReleaseIntArrayElements;
96 static constexpr auto GetArrayRegion = &JNIEnv::GetIntArrayRegion;
97 static constexpr auto SetArrayRegion = &JNIEnv::SetIntArrayRegion;
98 };
99
100 template <> struct TypedMethods< jlong >
101 {
102 static constexpr auto CallMethod = &JNIEnv::CallLongMethod;
103 static constexpr auto CallNonvirtualMethod = &JNIEnv::CallNonvirtualLongMethod;
104 static constexpr auto GetField = &JNIEnv::GetLongField;
105 static constexpr auto SetField = &JNIEnv::SetLongField;
106 static constexpr auto CallStaticMethod = &JNIEnv::CallStaticLongMethod;
107 static constexpr auto GetStaticField = &JNIEnv::GetStaticLongField;
108 static constexpr auto SetStaticField = &JNIEnv::SetStaticLongField;
109 static constexpr auto NewArray = &JNIEnv::NewLongArray;
110 static constexpr auto GetArrayElements = &JNIEnv::GetLongArrayElements;
111 static constexpr auto ReleaseArrayElements = &JNIEnv::ReleaseLongArrayElements;
112 static constexpr auto GetArrayRegion = &JNIEnv::GetLongArrayRegion;
113 static constexpr auto SetArrayRegion = &JNIEnv::SetLongArrayRegion;
114 };
115
116 template <> struct TypedMethods< jfloat >
117 {
118 static constexpr auto CallMethod = &JNIEnv::CallFloatMethod;
119 static constexpr auto CallNonvirtualMethod = &JNIEnv::CallNonvirtualFloatMethod;
120 static constexpr auto GetField = &JNIEnv::GetFloatField;
121 static constexpr auto SetField = &JNIEnv::SetFloatField;
122 static constexpr auto CallStaticMethod = &JNIEnv::CallStaticFloatMethod;
123 static constexpr auto GetStaticField = &JNIEnv::GetStaticFloatField;
124 static constexpr auto SetStaticField = &JNIEnv::SetStaticFloatField;
125 static constexpr auto NewArray = &JNIEnv::NewFloatArray;
126 static constexpr auto GetArrayElements = &JNIEnv::GetFloatArrayElements;
127 static constexpr auto ReleaseArrayElements = &JNIEnv::ReleaseFloatArrayElements;
128 static constexpr auto GetArrayRegion = &JNIEnv::GetFloatArrayRegion;
129 static constexpr auto SetArrayRegion = &JNIEnv::SetFloatArrayRegion;
130 };
131
132 template <> struct TypedMethods< jdouble >
133 {
134 static constexpr auto CallMethod = &JNIEnv::CallDoubleMethod;
135 static constexpr auto CallNonvirtualMethod = &JNIEnv::CallNonvirtualDoubleMethod;
136 static constexpr auto GetField = &JNIEnv::GetDoubleField;
137 static constexpr auto SetField = &JNIEnv::SetDoubleField;
138 static constexpr auto CallStaticMethod = &JNIEnv::CallStaticDoubleMethod;
139 static constexpr auto GetStaticField = &JNIEnv::GetStaticDoubleField;
140 static constexpr auto SetStaticField = &JNIEnv::SetStaticDoubleField;
141 static constexpr auto NewArray = &JNIEnv::NewDoubleArray;
142 static constexpr auto GetArrayElements = &JNIEnv::GetDoubleArrayElements;
143 static constexpr auto ReleaseArrayElements = &JNIEnv::ReleaseDoubleArrayElements;
144 static constexpr auto GetArrayRegion = &JNIEnv::GetDoubleArrayRegion;
145 static constexpr auto SetArrayRegion = &JNIEnv::SetDoubleArrayRegion;
146 };
147 }
Definition advanced_ownership.hpp:6
static constexpr auto GetStaticField
Definition typed_methods.hpp:27
static constexpr auto SetArrayRegion
Definition typed_methods.hpp:33
static constexpr auto ReleaseArrayElements
Definition typed_methods.hpp:31
static constexpr auto CallNonvirtualMethod
Definition typed_methods.hpp:23
static constexpr auto NewArray
Definition typed_methods.hpp:29
static constexpr auto GetField
Definition typed_methods.hpp:24
static constexpr auto SetStaticField
Definition typed_methods.hpp:28
static constexpr auto CallStaticMethod
Definition typed_methods.hpp:26
static constexpr auto GetArrayElements
Definition typed_methods.hpp:30
static constexpr auto SetField
Definition typed_methods.hpp:25
static constexpr auto CallMethod
Definition typed_methods.hpp:22
static constexpr auto GetArrayRegion
Definition typed_methods.hpp:32
static constexpr auto SetArrayRegion
Definition typed_methods.hpp:49
static constexpr auto GetStaticField
Definition typed_methods.hpp:43
static constexpr auto ReleaseArrayElements
Definition typed_methods.hpp:47
static constexpr auto GetArrayElements
Definition typed_methods.hpp:46
static constexpr auto NewArray
Definition typed_methods.hpp:45
static constexpr auto CallStaticMethod
Definition typed_methods.hpp:42
static constexpr auto SetStaticField
Definition typed_methods.hpp:44
static constexpr auto CallNonvirtualMethod
Definition typed_methods.hpp:39
static constexpr auto SetField
Definition typed_methods.hpp:41
static constexpr auto GetField
Definition typed_methods.hpp:40
static constexpr auto CallMethod
Definition typed_methods.hpp:38
static constexpr auto GetArrayRegion
Definition typed_methods.hpp:48
static constexpr auto GetStaticField
Definition typed_methods.hpp:59
static constexpr auto CallStaticMethod
Definition typed_methods.hpp:58
static constexpr auto CallNonvirtualMethod
Definition typed_methods.hpp:55
static constexpr auto SetArrayRegion
Definition typed_methods.hpp:65
static constexpr auto CallMethod
Definition typed_methods.hpp:54
static constexpr auto SetField
Definition typed_methods.hpp:57
static constexpr auto GetArrayElements
Definition typed_methods.hpp:62
static constexpr auto SetStaticField
Definition typed_methods.hpp:60
static constexpr auto ReleaseArrayElements
Definition typed_methods.hpp:63
static constexpr auto GetField
Definition typed_methods.hpp:56
static constexpr auto GetArrayRegion
Definition typed_methods.hpp:64
static constexpr auto NewArray
Definition typed_methods.hpp:61
static constexpr auto SetStaticField
Definition typed_methods.hpp:140
static constexpr auto CallMethod
Definition typed_methods.hpp:134
static constexpr auto GetArrayRegion
Definition typed_methods.hpp:144
static constexpr auto ReleaseArrayElements
Definition typed_methods.hpp:143
static constexpr auto NewArray
Definition typed_methods.hpp:141
static constexpr auto CallNonvirtualMethod
Definition typed_methods.hpp:135
static constexpr auto GetField
Definition typed_methods.hpp:136
static constexpr auto GetArrayElements
Definition typed_methods.hpp:142
static constexpr auto SetArrayRegion
Definition typed_methods.hpp:145
static constexpr auto GetStaticField
Definition typed_methods.hpp:139
static constexpr auto CallStaticMethod
Definition typed_methods.hpp:138
static constexpr auto SetField
Definition typed_methods.hpp:137
static constexpr auto CallMethod
Definition typed_methods.hpp:118
static constexpr auto SetArrayRegion
Definition typed_methods.hpp:129
static constexpr auto ReleaseArrayElements
Definition typed_methods.hpp:127
static constexpr auto CallStaticMethod
Definition typed_methods.hpp:122
static constexpr auto GetStaticField
Definition typed_methods.hpp:123
static constexpr auto SetField
Definition typed_methods.hpp:121
static constexpr auto NewArray
Definition typed_methods.hpp:125
static constexpr auto GetArrayRegion
Definition typed_methods.hpp:128
static constexpr auto GetArrayElements
Definition typed_methods.hpp:126
static constexpr auto SetStaticField
Definition typed_methods.hpp:124
static constexpr auto CallNonvirtualMethod
Definition typed_methods.hpp:119
static constexpr auto GetField
Definition typed_methods.hpp:120
static constexpr auto SetArrayRegion
Definition typed_methods.hpp:97
static constexpr auto CallMethod
Definition typed_methods.hpp:86
static constexpr auto GetArrayRegion
Definition typed_methods.hpp:96
static constexpr auto GetArrayElements
Definition typed_methods.hpp:94
static constexpr auto GetField
Definition typed_methods.hpp:88
static constexpr auto ReleaseArrayElements
Definition typed_methods.hpp:95
static constexpr auto CallStaticMethod
Definition typed_methods.hpp:90
static constexpr auto NewArray
Definition typed_methods.hpp:93
static constexpr auto GetStaticField
Definition typed_methods.hpp:91
static constexpr auto SetField
Definition typed_methods.hpp:89
static constexpr auto CallNonvirtualMethod
Definition typed_methods.hpp:87
static constexpr auto SetStaticField
Definition typed_methods.hpp:92
static constexpr auto GetStaticField
Definition typed_methods.hpp:107
static constexpr auto GetField
Definition typed_methods.hpp:104
static constexpr auto CallNonvirtualMethod
Definition typed_methods.hpp:103
static constexpr auto GetArrayRegion
Definition typed_methods.hpp:112
static constexpr auto CallMethod
Definition typed_methods.hpp:102
static constexpr auto SetStaticField
Definition typed_methods.hpp:108
static constexpr auto NewArray
Definition typed_methods.hpp:109
static constexpr auto SetArrayRegion
Definition typed_methods.hpp:113
static constexpr auto GetArrayElements
Definition typed_methods.hpp:110
static constexpr auto SetField
Definition typed_methods.hpp:105
static constexpr auto ReleaseArrayElements
Definition typed_methods.hpp:111
static constexpr auto CallStaticMethod
Definition typed_methods.hpp:106
static constexpr auto SetStaticField
Definition typed_methods.hpp:17
static constexpr auto GetStaticField
Definition typed_methods.hpp:16
static constexpr auto CallNonvirtualMethod
Definition typed_methods.hpp:12
static constexpr auto GetField
Definition typed_methods.hpp:13
static constexpr auto CallMethod
Definition typed_methods.hpp:11
static constexpr auto CallStaticMethod
Definition typed_methods.hpp:15
static constexpr auto SetField
Definition typed_methods.hpp:14
static constexpr auto GetField
Definition typed_methods.hpp:72
static constexpr auto CallMethod
Definition typed_methods.hpp:70
static constexpr auto CallStaticMethod
Definition typed_methods.hpp:74
static constexpr auto ReleaseArrayElements
Definition typed_methods.hpp:79
static constexpr auto SetArrayRegion
Definition typed_methods.hpp:81
static constexpr auto GetArrayElements
Definition typed_methods.hpp:78
static constexpr auto GetArrayRegion
Definition typed_methods.hpp:80
static constexpr auto NewArray
Definition typed_methods.hpp:77
static constexpr auto SetField
Definition typed_methods.hpp:73
static constexpr auto GetStaticField
Definition typed_methods.hpp:75
static constexpr auto SetStaticField
Definition typed_methods.hpp:76
static constexpr auto CallNonvirtualMethod
Definition typed_methods.hpp:71
Definition typed_methods.hpp:7
Definition types.hpp:31