Pārlūkot izejas kodu

Add experimental namespace to JNI classes

This would indicate that using JNI classes can cause issues,
although it has been extensively tested
Patrick-Christopher Mattulat 1 gadu atpakaļ
vecāks
revīzija
c661d53a70

+ 2 - 2
include/ls-std/core/interface/IJniApi.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -14,7 +14,7 @@
 #include <ls-std/os/dynamic-goal.hpp>
 #include <string>
 
-namespace ls::std::core::interface_type
+namespace ls::std::core::experimental::interface_type
 {
   class LS_STD_DYNAMIC_GOAL IJniApi
   {

+ 3 - 3
include/ls-std/core/jni/JniApi.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -13,9 +13,9 @@
 #include <ls-std/core/interface/IJniApi.hpp>
 #include <ls-std/os/dynamic-goal.hpp>
 
-namespace ls::std::core
+namespace ls::std::core::experimental
 {
-  class LS_STD_DYNAMIC_GOAL JniApi : public ls::std::core::interface_type::IJniApi
+  class LS_STD_DYNAMIC_GOAL JniApi : public ls::std::core::experimental::interface_type::IJniApi
   {
     public:
 

+ 8 - 8
include/ls-std/core/jni/JniClass.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -20,16 +20,16 @@
 #include <string>
 #include <unordered_map>
 
-namespace ls::std::core
+namespace ls::std::core::experimental
 {
   class LS_STD_DYNAMIC_GOAL JniClass
   {
     public:
 
-      explicit JniClass(const ::std::shared_ptr<ls::std::core::JniClassParameter> &_parameter, const ::std::string &_path);
+      explicit JniClass(const ::std::shared_ptr<ls::std::core::experimental::JniClassParameter> &_parameter, const ::std::string &_path);
       virtual ~JniClass();
 
-      [[nodiscard]] ls::std::core::JniReturnValue callMethod(const ::std::string &_methodIdentifier);
+      [[nodiscard]] ls::std::core::experimental::JniReturnValue callMethod(const ::std::string &_methodIdentifier);
       [[nodiscard]] bool hasMethod(const ::std::string &_methodIdentifier);
       bool load();                                                                                    // nodiscard is optional here
       bool loadMethod(const ::std::string &_methodIdentifier, const ::std::string &_methodSignature); // nodiscard is optional here
@@ -37,12 +37,12 @@ namespace ls::std::core
     private:
 
       jclass javaClass{};
-      ::std::unordered_map<::std::string, ls::std::core::JniMethod> methods{};
-      ::std::shared_ptr<ls::std::core::JniClassParameter> parameter{};
+      ::std::unordered_map<::std::string, ls::std::core::experimental::JniMethod> methods{};
+      ::std::shared_ptr<ls::std::core::experimental::JniClassParameter> parameter{};
       ::std::string path{};
 
-      void _callByteMethod(const ::std::string &_methodIdentifier, ls::std::core::JniReturnValue &_returnValue);
-      void _callIntMethod(const ::std::string &_methodIdentifier, ls::std::core::JniReturnValue &_returnValue);
+      void _callByteMethod(const ::std::string &_methodIdentifier, ls::std::core::experimental::JniReturnValue &_returnValue);
+      void _callIntMethod(const ::std::string &_methodIdentifier, ls::std::core::experimental::JniReturnValue &_returnValue);
       void _createJniApi();
       [[nodiscard]] bool _hasMethod(const ::std::string &_methodIdentifier);
   };

+ 5 - 5
include/ls-std/core/jni/JniClassParameter.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -16,7 +16,7 @@
 #include <memory>
 #include <string>
 
-namespace ls::std::core
+namespace ls::std::core::experimental
 {
   class LS_STD_DYNAMIC_GOAL JniClassParameter
   {
@@ -27,16 +27,16 @@ namespace ls::std::core
 
       [[nodiscard]] JNIEnv *getJavaEnvironment();
       [[nodiscard]] jobject getJavaObject();
-      [[nodiscard]] ::std::shared_ptr<ls::std::core::interface_type::IJniApi> getJniApi();
+      [[nodiscard]] ::std::shared_ptr<ls::std::core::experimental::interface_type::IJniApi> getJniApi();
       void setJavaEnvironment(JNIEnv *_environment);
       void setJavaObject(jobject _javaObject);
-      void setJniApi(const ::std::shared_ptr<ls::std::core::interface_type::IJniApi> &_jniApi);
+      void setJniApi(const ::std::shared_ptr<ls::std::core::experimental::interface_type::IJniApi> &_jniApi);
 
     private:
 
       JNIEnv *environment{};
       jobject javaObject{};
-      ::std::shared_ptr<ls::std::core::interface_type::IJniApi> jniApi{};
+      ::std::shared_ptr<ls::std::core::experimental::interface_type::IJniApi> jniApi{};
   };
 }
 

+ 2 - 2
include/ls-std/core/jni/JniMethod.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-08
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -14,7 +14,7 @@
 #include <ls-std/os/dynamic-goal.hpp>
 #include <string>
 
-namespace ls::std::core
+namespace ls::std::core::experimental
 {
   class LS_STD_DYNAMIC_GOAL JniMethod
   {

+ 2 - 2
include/ls-std/core/jni/JniReturnValue.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-08
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -13,7 +13,7 @@
 #include <jni.h>
 #include <ls-std/os/dynamic-goal.hpp>
 
-namespace ls::std::core
+namespace ls::std::core::experimental
 {
   class LS_STD_DYNAMIC_GOAL JniReturnValue
   {

+ 2 - 2
include/ls-std/time/common/jni/JniDateParameterMapper.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-09
-* Changed:         2023-04-09
+* Changed:         2023-04-10
 *
 * */
 
@@ -23,7 +23,7 @@ namespace ls::std::time::experimental
       JniDateParameterMapper();
       ~JniDateParameterMapper();
 
-      [[nodiscard]] static ls::std::time::DateParameter toDateParameter(const ls::std::core::JniClass &_javaClass);
+      [[nodiscard]] static ls::std::time::DateParameter toDateParameter(const ls::std::core::experimental::JniClass &_javaClass);
   };
 }
 

+ 2 - 2
source/ls-std/core/interface/IJniApi.cpp

@@ -3,13 +3,13 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-07
+* Changed:         2023-04-10
 *
 * */
 
 #include <ls-std/core/interface/IJniApi.hpp>
 
-using ls::std::core::interface_type::IJniApi;
+using ls::std::core::experimental::interface_type::IJniApi;
 
 IJniApi::IJniApi() = default;
 

+ 2 - 2
source/ls-std/core/jni/JniApi.cpp

@@ -3,15 +3,15 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
 #include <ls-std/core/evaluator/NullPointerArgumentEvaluator.hpp>
 #include <ls-std/core/jni/JniApi.hpp>
 
-using ls::std::core::JniApi;
 using ls::std::core::NullPointerArgumentEvaluator;
+using ls::std::core::experimental::JniApi;
 using std::string;
 
 JniApi::JniApi(JNIEnv *_environment)

+ 6 - 6
source/ls-std/core/jni/JniClass.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -17,13 +17,13 @@
 
 using ls::std::core::ConditionalFunctionExecutor;
 using ls::std::core::EmptyStringArgumentEvaluator;
-using ls::std::core::JniApi;
-using ls::std::core::JniClass;
-using ls::std::core::JniClassParameter;
-using ls::std::core::JniMethod;
-using ls::std::core::JniReturnValue;
 using ls::std::core::NullPointerArgumentEvaluator;
 using ls::std::core::NullPointerEvaluator;
+using ls::std::core::experimental::JniApi;
+using ls::std::core::experimental::JniClass;
+using ls::std::core::experimental::JniClassParameter;
+using ls::std::core::experimental::JniMethod;
+using ls::std::core::experimental::JniReturnValue;
 using std::make_pair;
 using std::make_shared;
 using std::pair;

+ 3 - 3
source/ls-std/core/jni/JniClassParameter.cpp

@@ -3,14 +3,14 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
 #include <ls-std/core/jni/JniClassParameter.hpp>
 
-using ls::std::core::JniClassParameter;
-using ls::std::core::interface_type::IJniApi;
+using ls::std::core::experimental::JniClassParameter;
+using ls::std::core::experimental::interface_type::IJniApi;
 using std::shared_ptr;
 using std::string;
 

+ 2 - 2
source/ls-std/core/jni/JniMethod.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-08
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -11,7 +11,7 @@
 #include <ls-std/core/jni/JniMethod.hpp>
 
 using ls::std::core::EmptyStringArgumentEvaluator;
-using ls::std::core::JniMethod;
+using ls::std::core::experimental::JniMethod;
 using std::string;
 
 JniMethod::JniMethod(const string &_methodIdentifier, const string &_methodSignature)

+ 2 - 2
source/ls-std/core/jni/JniReturnValue.cpp

@@ -3,13 +3,13 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-08
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
 #include <ls-std/core/jni/JniReturnValue.hpp>
 
-using ls::std::core::JniReturnValue;
+using ls::std::core::experimental::JniReturnValue;
 
 JniReturnValue::JniReturnValue() = default;
 

+ 2 - 2
source/ls-std/time/common/jni/JniDateParameterMapper.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-09
-* Changed:         2023-04-09
+* Changed:         2023-04-10
 *
 * */
 
@@ -11,7 +11,7 @@
 #include <ls-std/time/common/DateParameter.hpp>
 #include <ls-std/time/common/jni/JniDateParameterMapper.hpp>
 
-using ls::std::core::JniClass;
+using ls::std::core::experimental::JniClass;
 using ls::std::time::DateParameter;
 using ls::std::time::experimental::JniDateParameterMapper;
 

+ 3 - 3
source/ls-std/time/system-time/jni/com_lynarstudios_ls_std_time_systemtime_SystemTimeJni.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-03-16
-* Changed:         2023-04-09
+* Changed:         2023-04-10
 *
 * */
 
@@ -16,9 +16,9 @@
 #include <ls-std/time/system-time/jni/com_lynarstudios_ls_std_time_systemtime_SystemTimeJni.h>
 #include <memory>
 
-using ls::std::core::JniClass;
-using ls::std::core::JniClassParameter;
 using ls::std::core::NullPointerEvaluator;
+using ls::std::core::experimental::JniClass;
+using ls::std::core::experimental::JniClassParameter;
 using ls::std::time::DateParameter;
 using ls::std::time::SystemTime;
 using ls::std::time::experimental::JniDateParameterMapper;

+ 2 - 2
test/cases/core/jni/JniApiTest.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-07
+* Changed:         2023-04-10
 *
 * */
 
@@ -12,7 +12,7 @@
 #include <ls-std/ls-std-core.hpp>
 
 using ls::std::core::IllegalArgumentException;
-using ls::std::core::JniApi;
+using ls::std::core::experimental::JniApi;
 using testing::Test;
 
 namespace

+ 4 - 4
test/cases/core/jni/JniClassParameterTest.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -12,9 +12,9 @@
 #include <ls-std/ls-std-core-jni.hpp>
 #include <memory>
 
-using ls::std::core::JniApi;
-using ls::std::core::JniClassParameter;
-using ls::std::core::interface_type::IJniApi;
+using ls::std::core::experimental::JniApi;
+using ls::std::core::experimental::JniClassParameter;
+using ls::std::core::experimental::interface_type::IJniApi;
 using std::make_shared;
 using std::shared_ptr;
 using test::core::jni::MockJniApi;

+ 3 - 3
test/cases/core/jni/JniClassTest.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -15,9 +15,9 @@
 #include <memory>
 
 using ls::std::core::IllegalArgumentException;
-using ls::std::core::JniClass;
-using ls::std::core::JniClassParameter;
 using ls::std::core::NullPointerException;
+using ls::std::core::experimental::JniClass;
+using ls::std::core::experimental::JniClassParameter;
 using std::make_shared;
 using std::shared_ptr;
 using std::string;

+ 2 - 2
test/cases/core/jni/JniMethodTest.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-08
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -13,7 +13,7 @@
 #include <memory>
 
 using ls::std::core::IllegalArgumentException;
-using ls::std::core::JniMethod;
+using ls::std::core::experimental::JniMethod;
 using std::make_shared;
 using testing::Test;
 

+ 2 - 2
test/cases/core/jni/JniReturnValueTest.cpp

@@ -3,14 +3,14 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-08
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
 #include <gtest/gtest.h>
 #include <ls-std/ls-std-core-jni.hpp>
 
-using ls::std::core::JniReturnValue;
+using ls::std::core::experimental::JniReturnValue;
 using testing::Test;
 
 namespace

+ 2 - 2
test/classes/core/jni/MockJniApi.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-04-07
-* Changed:         2023-04-08
+* Changed:         2023-04-10
 *
 * */
 
@@ -15,7 +15,7 @@
 
 namespace test::core::jni
 {
-  class MockJniApi : public ls::std::core::interface_type::IJniApi
+  class MockJniApi : public ls::std::core::experimental::interface_type::IJniApi
   {
     public: