lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Loading...
Searching...
No Matches
method.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <jni/functions.hpp>
4#include <jni/class.hpp>
5#include <jni/object.hpp>
7#include <jni/tagging.hpp>
8
9namespace jni
10 {
11 template < class TheTag, class >
12 class Method;
13
14 template < class TheTag, class R, class... Args >
15 class Method< TheTag, R (Args...) >
16 {
17 private:
18 jmethodID& method;
19
20 public:
21 using TagType = TheTag;
22 using MethodType = R (Args...);
23 using ReturnType = R;
24
25 Method(JNIEnv& env, const Class<TagType>& clazz, const char* name)
26 : method(GetMethodID(env, *clazz, name, TypeSignature<R (Args...)>()()))
27 {}
28
29 operator jmethodID&() const { return method; }
30 };
31 }
Definition class.hpp:18
R(Args...) MethodType
Definition method.hpp:22
TheTag TagType
Definition method.hpp:21
R ReturnType
Definition method.hpp:23
Method(JNIEnv &env, const Class< TagType > &clazz, const char *name)
Definition method.hpp:25
Definition class.hpp:13
Definition advanced_ownership.hpp:6
jarray< E > & NewArray(JNIEnv &env, jsize length)
Definition functions.hpp:472
std::pointer_traits< ::jmethodID >::element_type jmethodID
Definition types.hpp:56
jmethodID & GetMethodID(JNIEnv &env, jclass &clazz, const char *name, const char *sig)
Definition functions.hpp:260
Definition tagging.hpp:13