JniClass.hpp 892 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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-07
  7. *
  8. * */
  9. #ifndef LS_STD_JNI_CLASS_HPP
  10. #define LS_STD_JNI_CLASS_HPP
  11. #include "JniClassParameter.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. namespace ls::std::core
  18. {
  19. class LS_STD_DYNAMIC_GOAL JniClass
  20. {
  21. public:
  22. explicit JniClass(const ::std::shared_ptr<ls::std::core::JniClassParameter> &_parameter, const ::std::string &_path);
  23. virtual ~JniClass();
  24. bool load(); // nodiscard is optional here
  25. private:
  26. jclass javaClass{};
  27. ::std::shared_ptr<ls::std::core::JniClassParameter> parameter{};
  28. ::std::string path{};
  29. void _createJniApi();
  30. };
  31. }
  32. #endif