JniClassParameter.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Co-Author: Claude Sonnet 4.6 (LLM)
  4. * Company: Lynar Studios
  5. * E-Mail: webmaster@lynarstudios.com
  6. * Created: 2023-04-07
  7. * Changed: 2026-06-23
  8. *
  9. * */
  10. #ifndef LS_STD_JNI_CLASS_PARAMETER_HPP
  11. #define LS_STD_JNI_CLASS_PARAMETER_HPP
  12. #include <jni.h>
  13. #include <ls-std/core/interface/IJniApi.hpp>
  14. #include <ls-std/os/dynamic-goal.hpp>
  15. #include <memory>
  16. #include <string>
  17. /*
  18. * @doc: class(name: 'JniClassParameter', package: 'core')
  19. * @doc: core.JniClassParameter.description('This class holds important information for the usage of the Java Native Interface (JNI), like Java environment or a specific Java object.')
  20. * */
  21. namespace ls::standard::core::experimental
  22. {
  23. class LS_STD_DYNAMIC_GOAL JniClassParameter
  24. {
  25. public:
  26. JniClassParameter();
  27. ~JniClassParameter();
  28. [[nodiscard]] JNIEnv *getJavaEnvironment();
  29. [[nodiscard]] jobject getJavaObject();
  30. [[nodiscard]] ::std::shared_ptr<ls::standard::core::experimental::interface_type::IJniApi> getJniApi() const;
  31. void setJavaEnvironment(JNIEnv *_environment);
  32. void setJavaObject(jobject _javaObject);
  33. void setJniApi(const ::std::shared_ptr<ls::standard::core::experimental::interface_type::IJniApi> &_jniApi);
  34. private:
  35. JNIEnv *environment{};
  36. jobject javaObject{};
  37. ::std::shared_ptr<ls::standard::core::experimental::interface_type::IJniApi> jniApi{};
  38. };
  39. }
  40. #endif