JniClassParameter.hpp 1.2 KB

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