本文整理汇总了C++中Method::getMethodID方法的典型用法代码示例。如果您正苦于以下问题:C++ Method::getMethodID方法的具体用法?C++ Method::getMethodID怎么用?C++ Method::getMethodID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Method
的用法示例。
在下文中一共展示了Method::getMethodID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Callable::callMethod<void>(JNIEnv* env, Signature* signature, ...)
{
Method* method = this->getMethodDescriptor(env, signature);
if (method != 0)
{
va_list arguments_list;
va_start(arguments_list, signature);
jobject object = this->getJavaObject(env);
env->CallVoidMethodV(object, method->getMethodID(), arguments_list);
env->DeleteLocalRef(object);
va_end(arguments_list);
}
}
示例2:
Object::Object(JNIEnv* env, Name* className, Signature* signature, ...)
{
this->classObject = Class::getClass(className, env);
if (this->classObject != 0)
{
jclass clazz = this->classObject->getClassObject(env);
if (clazz != 0)
{
Method* method = this->classObject->getMethod(env, signature);
if (method != 0)
{
va_list arguments_list;
va_start(arguments_list, signature);
this->setJavaObject(env->NewObjectV(clazz, method->getMethodID(), arguments_list));
va_end(arguments_list);
}
}
else
{
this->classObject = 0;
}
}
}
示例3: Object
inline ::fr::Planquart::JNI::Object Callable::callObjectMethodV(JNIEnv* env, Signature* signature, va_list arguments_list)
{
Method* method = this->getMethodDescriptor(env, signature);
if (method != 0)
{
jobject object = this->getJavaObject(env);
jobject value;
if (object != 0)
{
value = env->CallObjectMethodV(object, method->getMethodID(), arguments_list);
}
else
{
return Object();
}
env->DeleteLocalRef(object);
return Object(Class::getClass(JVM::class_Object, env), value);
}
return Object();
}