JniApi.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_API_HPP
  10. #define LS_STD_JNI_API_HPP
  11. #include <ls-std/core/interface/IJniApi.hpp>
  12. #include <ls-std/os/dynamic-goal.hpp>
  13. /*
  14. * @class(name: 'JniApi', package: 'core')
  15. * */
  16. namespace ls::std::core::experimental
  17. {
  18. class LS_STD_DYNAMIC_GOAL JniApi : public ls::std::core::experimental::interface_type::IJniApi
  19. {
  20. public:
  21. explicit JniApi(JNIEnv *_environment);
  22. ~JniApi() noexcept override;
  23. jboolean callBooleanMethod(jobject _javaObject, jmethodID _methodId) override;
  24. jbyte callByteMethod(jobject _javaObject, jmethodID _methodId) override;
  25. jchar callCharMethod(jobject _javaObject, jmethodID _methodId) override;
  26. jdouble callDoubleMethod(jobject _javaObject, jmethodID _methodId) override;
  27. jfloat callFloatMethod(jobject _javaObject, jmethodID _methodId) override;
  28. jint callIntMethod(jobject _javaObject, jmethodID _methodId) override;
  29. jlong callLongMethod(jobject _javaObject, jmethodID _methodId) override;
  30. jshort callShortMethod(jobject _javaObject, jmethodID _methodId) override;
  31. jclass findClass(const ::std::string &_classPath) override;
  32. jmethodID getMethodId(jclass _javaClass, const char *_methodIdentifier, const char *_methodSignature) override;
  33. private:
  34. JNIEnv *environment{};
  35. };
  36. }
  37. #endif