Loading...
Searching...
No Matches
method.hpp
Go to the documentation of this file.
#pragma once
#include <jni/functions.hpp>
#include <jni/class.hpp>
#include <jni/object.hpp>
#include <jni/type_signature.hpp>
#include <jni/tagging.hpp>
namespace jni
{
template < class TheTag, class >
class Method;
template < class TheTag, class R, class... Args >
class Method< TheTag, R (Args...) >
{
private:
jmethodID& method;
public:
using TagType = TheTag;
using MethodType = R (Args...);
using ReturnType = R;
Method(JNIEnv& env, const Class<TagType>& clazz, const char* name)
: method(GetMethodID(env, *clazz, name, TypeSignature<R (Args...)>()()))
{}
operator jmethodID&() const { return method; }
};
}
class.hpp
jni::Class
Definition class.hpp:18
jni::Method< TheTag, R(Args...) >::MethodType
R(Args...) MethodType
Definition method.hpp:22
jni::Method< TheTag, R(Args...) >::TagType
TheTag TagType
Definition method.hpp:21
jni::Method< TheTag, R(Args...) >::ReturnType
R ReturnType
Definition method.hpp:23
jni::Method< TheTag, R(Args...) >::Method
Method(JNIEnv &env, const Class< TagType > &clazz, const char *name)
Definition method.hpp:25
jni::Method
Definition class.hpp:13
functions.hpp
jni
Definition advanced_ownership.hpp:6
jni::jmethodID
std::pointer_traits< ::jmethodID >::element_type jmethodID
Definition types.hpp:56
jni::GetMethodID
jmethodID & GetMethodID(JNIEnv &env, jclass &clazz, const char *name, const char *sig)
Definition functions.hpp:260
object.hpp
jni::TypeSignature
Definition tagging.hpp:13
tagging.hpp
type_signature.hpp