Loading...
Searching...
No Matches
field.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 T >
class Field
{
private:
jfieldID& field;
public:
using TagType = TheTag;
using FieldType = T;
Field(JNIEnv& env, const Class<TagType>& clazz, const char* name)
: field(GetFieldID(env, *clazz, name, TypeSignature<T>()()))
{}
operator jfieldID&() const { return field; }
};
}
class.hpp
jni::Class
Definition class.hpp:18
jni::Field::TagType
TheTag TagType
Definition field.hpp:18
jni::Field::Field
Field(JNIEnv &env, const Class< TagType > &clazz, const char *name)
Definition field.hpp:21
jni::Field::FieldType
T FieldType
Definition field.hpp:19
functions.hpp
jni
Definition advanced_ownership.hpp:6
jni::jfieldID
std::pointer_traits< ::jfieldID >::element_type jfieldID
Definition types.hpp:55
jni::GetFieldID
jfieldID & GetFieldID(JNIEnv &env, jclass &clazz, const char *name, const char *sig)
Definition functions.hpp:299
object.hpp
jni::TypeSignature
Definition tagging.hpp:13
tagging.hpp
type_signature.hpp