JniClassParameter.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-04-07
  6. * Changed: 2024-09-11
  7. *
  8. * */
  9. #ifndef LS_STD_JNI_CLASS_PARAMETER_HPP
  10. #define LS_STD_JNI_CLASS_PARAMETER_HPP
  11. #include <jni.h>
  12. #include <ls-std/core/interface/IJniApi.hpp>
  13. #include <ls-std/os/dynamic-goal.hpp>
  14. #include <memory>
  15. #include <string>
  16. /*
  17. * @doc: class(name: 'JniClassParameter', package: 'core')
  18. * @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.')
  19. * */
  20. namespace ls::std::core::experimental
  21. {
  22. class LS_STD_DYNAMIC_GOAL JniClassParameter
  23. {
  24. public:
  25. JniClassParameter();
  26. ~JniClassParameter();
  27. [[nodiscard]] JNIEnv *getJavaEnvironment();
  28. [[nodiscard]] jobject getJavaObject();
  29. [[nodiscard]] ::std::shared_ptr<ls::std::core::experimental::interface_type::IJniApi> getJniApi() const;
  30. void setJavaEnvironment(JNIEnv *_environment);
  31. void setJavaObject(jobject _javaObject);
  32. void setJniApi(const ::std::shared_ptr<ls::std::core::experimental::interface_type::IJniApi> &_jniApi);
  33. private:
  34. JNIEnv *environment{};
  35. jobject javaObject{};
  36. ::std::shared_ptr<ls::std::core::experimental::interface_type::IJniApi> jniApi{};
  37. };
  38. }
  39. #endif