JniClassParameter.hpp 1.1 KB

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