slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
| 函数
facebook::yoga::vanillajni 命名空间参考

class  LayoutContext
 
class  ScopedGlobalRef
 
class  ScopedLocalRef
 
class  YogaJniException
 

函数

void registerNatives (JNIEnv *env, const char *className, const JNINativeMethod methods[], size_t numMethods)
 
jmethodID getStaticMethodId (JNIEnv *env, jclass clazz, const char *methodName, const char *methodDescriptor)
 
jmethodID getMethodId (JNIEnv *env, jclass clazz, const char *methodName, const char *methodDescriptor)
 
jfieldID getFieldId (JNIEnv *env, jclass clazz, const char *fieldName, const char *fieldSignature)
 
 DEFINE_CALL_METHOD_FOR_PRIMITIVE_IMPLEMENTATION (jlong, Long)
 
 DEFINE_CALL_METHOD_FOR_PRIMITIVE_IMPLEMENTATION (jfloat, Float)
 
 DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE (void, Void)
 
ScopedLocalRef< jobjectcallStaticObjectMethod (JNIEnv *env, jclass clazz, jmethodID methodId,...)
 
ScopedGlobalRef< jobjectnewGlobalRef (JNIEnv *env, jobject obj)
 
 DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE (jlong, Long)
 
 DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE (jfloat, Float)
 
jint ensureInitialized (JNIEnv **env, JavaVM *vm)
 
JNIEXPORT JNIEnvgetCurrentEnv ()
 
void logErrorMessageAndDie (const char *message)
 
void assertNoPendingJniException (JNIEnv *env)
 
void assertNoPendingJniExceptionIf (JNIEnv *env, bool condition)
 
template<typename T >
ScopedGlobalRef< T > make_global_ref (T globalRef)
 
template<typename T >
ScopedLocalRef< T > make_local_ref (JNIEnv *env, T localRef)
 

详细描述

This is a modified version of Android's ScopedLocalRef class that can be found in the Android's JNI code.

函数说明

◆ assertNoPendingJniException()

void facebook::yoga::vanillajni::assertNoPendingJniException ( JNIEnv * env)

Checks whether there is a pending JNI exception. If so, it logs an error message and aborts the current process. Otherwise it does nothing.

函数调用图:
这是这个函数的调用关系图:

◆ assertNoPendingJniExceptionIf()

void facebook::yoga::vanillajni::assertNoPendingJniExceptionIf ( JNIEnv * env,
bool condition )
函数调用图:
这是这个函数的调用关系图:

◆ callStaticObjectMethod()

ScopedLocalRef< jobject > facebook::yoga::vanillajni::callStaticObjectMethod ( JNIEnv * env,
jclass clazz,
jmethodID methodId,
... )
函数调用图:
这是这个函数的调用关系图:

◆ DEFINE_CALL_METHOD_FOR_PRIMITIVE_IMPLEMENTATION() [1/2]

facebook::yoga::vanillajni::DEFINE_CALL_METHOD_FOR_PRIMITIVE_IMPLEMENTATION ( jfloat ,
Float  )

◆ DEFINE_CALL_METHOD_FOR_PRIMITIVE_IMPLEMENTATION() [2/2]

facebook::yoga::vanillajni::DEFINE_CALL_METHOD_FOR_PRIMITIVE_IMPLEMENTATION ( jlong ,
Long  )

◆ DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE() [1/3]

facebook::yoga::vanillajni::DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE ( jfloat ,
Float  )

◆ DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE() [2/3]

facebook::yoga::vanillajni::DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE ( jlong ,
Long  )

◆ DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE() [3/3]

facebook::yoga::vanillajni::DEFINE_CALL_METHOD_FOR_PRIMITIVE_INTERFACE ( void ,
Void  )
函数调用图:

◆ ensureInitialized()

jint facebook::yoga::vanillajni::ensureInitialized ( JNIEnv ** env,
JavaVM * vm )

This method has to be called before using the vanillajni library. This method is typically called when doing initialization in the "on load" JNI hook of a particular library.

This method is thread safe, and after the first time it's called it has no initialization effect.

参数
envuse this output parameter to get a JNIEnv to use for things such as registering native methods and such.
vmthe VM instance passed by JNI. This is usually the VM instance that is passed to the "on load" JNI hook.
返回
an integer value to return from the "on load" hook.
函数调用图:
这是这个函数的调用关系图:

◆ getCurrentEnv()

JNIEnv * facebook::yoga::vanillajni::getCurrentEnv ( )

Returns a JNIEnv* suitable for the current thread. If the current thread is not attached to the Java VM, this method aborts execution.

函数调用图:
这是这个函数的调用关系图:

◆ getFieldId()

jfieldID facebook::yoga::vanillajni::getFieldId ( JNIEnv * env,
jclass clazz,
const char * fieldName,
const char * fieldSignature )

Returns a class non-static field ID. Aborts if any error happens.

函数调用图:
这是这个函数的调用关系图:

◆ getMethodId()

jmethodID facebook::yoga::vanillajni::getMethodId ( JNIEnv * env,
jclass clazz,
const char * methodName,
const char * methodDescriptor )

Returns a jmethodID for a class non-static method. Aborts if any error happens.

函数调用图:
这是这个函数的调用关系图:

◆ getStaticMethodId()

jmethodID facebook::yoga::vanillajni::getStaticMethodId ( JNIEnv * env,
jclass clazz,
const char * methodName,
const char * methodDescriptor )

Returns a jmethodID for a class static method. Aborts if any error happens.

函数调用图:
这是这个函数的调用关系图:

◆ logErrorMessageAndDie()

void facebook::yoga::vanillajni::logErrorMessageAndDie ( const char * message)

Logs an error message and aborts the current process.

这是这个函数的调用关系图:

◆ make_global_ref()

template<typename T >
ScopedGlobalRef< T > facebook::yoga::vanillajni::make_global_ref ( T globalRef)
这是这个函数的调用关系图:

◆ make_local_ref()

template<typename T >
ScopedLocalRef< T > facebook::yoga::vanillajni::make_local_ref ( JNIEnv * env,
T localRef )
这是这个函数的调用关系图:

◆ newGlobalRef()

ScopedGlobalRef< jthrowable > facebook::yoga::vanillajni::newGlobalRef ( JNIEnv * env,
jobject obj )

Given a local or a global reference, this method creates a new global reference out of it. If any error happens, aborts the process.

函数调用图:
这是这个函数的调用关系图:

◆ registerNatives()

void facebook::yoga::vanillajni::registerNatives ( JNIEnv * env,
const char * className,
const JNINativeMethod methods[],
size_t numMethods )

Registers a set of methods for a JNI class. Aborts if registration fails.

函数调用图:
这是这个函数的调用关系图: