lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Loading...
Searching...
No Matches
static_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 StaticMethod;
13
14 template < class TheTag, class R, class... Args >
15 class StaticMethod< 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 StaticMethod(JNIEnv& env, const Class<TagType>& clazz, const char* name)
26 : method(GetStaticMethodID(env, *clazz, name, TypeSignature<R (Args...)>()()))
27 {}
28
29 operator jmethodID&() const { return method; }
30 };
31 }
Definition class.hpp:18
TheTag TagType
Definition static_method.hpp:21
StaticMethod(JNIEnv &env, const Class< TagType > &clazz, const char *name)
Definition static_method.hpp:25
R(Args...) MethodType
Definition static_method.hpp:22
R ReturnType
Definition static_method.hpp:23
Definition class.hpp:14
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 & GetStaticMethodID(JNIEnv &env, jclass &clazz, const char *name, const char *sig)
Definition functions.hpp:320
Definition tagging.hpp:13