|
@@ -3,14 +3,15 @@
|
|
* Company: Lynar Studios
|
|
* Company: Lynar Studios
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
* Created: 2023-04-07
|
|
* Created: 2023-04-07
|
|
-* Changed: 2023-05-16
|
|
|
|
|
|
+* Changed: 2023-05-24
|
|
*
|
|
*
|
|
* */
|
|
* */
|
|
|
|
|
|
#include <ls-std/core/ConditionalFunctionExecutor.hpp>
|
|
#include <ls-std/core/ConditionalFunctionExecutor.hpp>
|
|
#include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
|
|
#include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
|
|
#include <ls-std/core/evaluator/NullPointerArgumentEvaluator.hpp>
|
|
#include <ls-std/core/evaluator/NullPointerArgumentEvaluator.hpp>
|
|
-#include <ls-std/core/evaluator/NullPointerEvaluator.hpp>
|
|
|
|
|
|
+#include <ls-std/core/evaluator/RawNullPointerArgumentEvaluator.hpp>
|
|
|
|
+#include <ls-std/core/evaluator/RawNullPointerEvaluator.hpp>
|
|
#include <ls-std/core/jni/JniApi.hpp>
|
|
#include <ls-std/core/jni/JniApi.hpp>
|
|
#include <ls-std/core/jni/JniClass.hpp>
|
|
#include <ls-std/core/jni/JniClass.hpp>
|
|
#include <memory>
|
|
#include <memory>
|
|
@@ -18,12 +19,14 @@
|
|
using ls::std::core::ConditionalFunctionExecutor;
|
|
using ls::std::core::ConditionalFunctionExecutor;
|
|
using ls::std::core::EmptyStringArgumentEvaluator;
|
|
using ls::std::core::EmptyStringArgumentEvaluator;
|
|
using ls::std::core::NullPointerArgumentEvaluator;
|
|
using ls::std::core::NullPointerArgumentEvaluator;
|
|
-using ls::std::core::NullPointerEvaluator;
|
|
|
|
|
|
+using ls::std::core::RawNullPointerArgumentEvaluator;
|
|
|
|
+using ls::std::core::RawNullPointerEvaluator;
|
|
using ls::std::core::experimental::JniApi;
|
|
using ls::std::core::experimental::JniApi;
|
|
using ls::std::core::experimental::JniClass;
|
|
using ls::std::core::experimental::JniClass;
|
|
using ls::std::core::experimental::JniClassParameter;
|
|
using ls::std::core::experimental::JniClassParameter;
|
|
using ls::std::core::experimental::JniMethod;
|
|
using ls::std::core::experimental::JniMethod;
|
|
using ls::std::core::experimental::JniReturnValue;
|
|
using ls::std::core::experimental::JniReturnValue;
|
|
|
|
+using ls::std::core::type::RawPointer;
|
|
using std::make_pair;
|
|
using std::make_pair;
|
|
using std::make_shared;
|
|
using std::make_shared;
|
|
using std::pair;
|
|
using std::pair;
|
|
@@ -34,7 +37,7 @@ JniClass::JniClass(const shared_ptr<JniClassParameter> &_parameter, const string
|
|
{
|
|
{
|
|
NullPointerArgumentEvaluator{_parameter, "no provided reference to JNI class parameter!"}.evaluate();
|
|
NullPointerArgumentEvaluator{_parameter, "no provided reference to JNI class parameter!"}.evaluate();
|
|
EmptyStringArgumentEvaluator{_path, "path to associated Java class is empty!"}.evaluate();
|
|
EmptyStringArgumentEvaluator{_path, "path to associated Java class is empty!"}.evaluate();
|
|
- NullPointerArgumentEvaluator{_parameter->getJavaEnvironment(), "Java environment is not being provided!"}.evaluate();
|
|
|
|
|
|
+ RawNullPointerArgumentEvaluator<JNIEnv>{RawPointer<JNIEnv>{_parameter->getJavaEnvironment()}, "Java environment is not being provided!"}.evaluate();
|
|
ConditionalFunctionExecutor{_parameter->getJniApi() == nullptr}.execute([this]() { _createJniApi(); });
|
|
ConditionalFunctionExecutor{_parameter->getJniApi() == nullptr}.execute([this]() { _createJniApi(); });
|
|
}
|
|
}
|
|
|
|
|
|
@@ -72,7 +75,7 @@ bool JniClass::load()
|
|
|
|
|
|
bool JniClass::loadMethod(const string &_methodIdentifier, const string &_methodSignature)
|
|
bool JniClass::loadMethod(const string &_methodIdentifier, const string &_methodSignature)
|
|
{
|
|
{
|
|
- NullPointerEvaluator{this->javaClass, "no Java class reference available for loading class method!"}.evaluate();
|
|
|
|
|
|
+ RawNullPointerEvaluator<_jclass>{RawPointer<_jclass>{this->javaClass}, "no Java class reference available for loading class method!"}.evaluate();
|
|
jmethodID methodId = this->parameter->getJniApi()->getMethodId(this->javaClass, _methodIdentifier.c_str(), _methodSignature.c_str());
|
|
jmethodID methodId = this->parameter->getJniApi()->getMethodId(this->javaClass, _methodIdentifier.c_str(), _methodSignature.c_str());
|
|
bool succeeded = methodId != nullptr && !this->_hasMethod(_methodIdentifier);
|
|
bool succeeded = methodId != nullptr && !this->_hasMethod(_methodIdentifier);
|
|
|
|
|