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. */
| 120 | external sources and not from existing C++ types. |
| 121 | */ |
| 122 | class AnyJavaMethod : public JavaMethodBase { |
| 123 | public: |
| 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 | |
| 138 | private: |
| 139 | Invoker _invoker = nullptr; |
| 140 | }; |
| 141 | |
| 142 | template<class Ret, class... T> |
| 143 | class JavaMethod : public JavaMethodBase { |
no outgoing calls
no test coverage detected