JniClassParameter.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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-25
  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. * @class(name: 'JniClassParameter', package: 'core')
  18. * */
  19. namespace ls::std::core::experimental
  20. {
  21. class LS_STD_DYNAMIC_GOAL JniClassParameter
  22. {
  23. public:
  24. JniClassParameter();
  25. ~JniClassParameter();
  26. [[nodiscard]] JNIEnv *getJavaEnvironment();
  27. [[nodiscard]] jobject getJavaObject();
  28. [[nodiscard]] ::std::shared_ptr<ls::std::core::experimental::interface_type::IJniApi> getJniApi() const;
  29. void setJavaEnvironment(JNIEnv *_environment);
  30. void setJavaObject(jobject _javaObject);
  31. void setJniApi(const ::std::shared_ptr<ls::std::core::experimental::interface_type::IJniApi> &_jniApi);
  32. private:
  33. JNIEnv *environment{};
  34. jobject javaObject{};
  35. ::std::shared_ptr<ls::std::core::experimental::interface_type::IJniApi> jniApi{};
  36. };
  37. }
  38. #endif