MCPcopy Create free account
hub / github.com/Snapchat/Valdi / AnyJavaMethod

Class AnyJavaMethod

valdi_core/src/valdi_core/jni/JavaMethod.hpp:122–140  ·  view source on GitHub ↗

Implementation of JavaMethodBase that does not leverage the C++ type system to resolve the parameters and return value. This implementation is suitable for use in a purely reflective environment, where types are resolved from external sources and not from existing C++ types. */

Source from the content-addressed store, hash-verified

120 external sources and not from existing C++ types.
121 */
122class AnyJavaMethod : public JavaMethodBase {
123public:
124 using Invoker = JavaValue (*)(JNIEnv& env, jmethodID methodId, jobject obj, jvalue* args);
125
126 AnyJavaMethod();
127 AnyJavaMethod(JavaEnv env, jmethodID methodID, Invoker invoker);
128
129 JavaValue call(jobject object, size_t parametersSize, const JavaValue* parameters) const;
130
131 djinni::LocalRef<jobject> toReflectedMethod(jclass cls, bool isStatic) const;
132
133 static AnyJavaMethod fromReflectedMethod(jobject reflectedMethod,
134 bool isStatic,
135 std::optional<JavaValueType> returnType);
136 static Invoker getInvokerForMethodType(bool isStatic, std::optional<JavaValueType> returnType);
137
138private:
139 Invoker _invoker = nullptr;
140};
141
142template<class Ret, class... T>
143class JavaMethod : public JavaMethodBase {

Callers 3

JavaMethod.cppFile · 0.85
fromReflectedMethodMethod · 0.85
doGetMethodMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected