JniMethod.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-04-08
  6. * Changed: 2024-09-09
  7. *
  8. * */
  9. #ifndef LS_STD_JNI_METHOD_HPP
  10. #define LS_STD_JNI_METHOD_HPP
  11. #include <jni.h>
  12. #include <ls-std/os/dynamic-goal.hpp>
  13. #include <string>
  14. #include <string_view>
  15. /*
  16. * @doc: class(name: 'JniMethod', package: 'core')
  17. * */
  18. namespace ls::std::core::experimental
  19. {
  20. class LS_STD_DYNAMIC_GOAL JniMethod
  21. {
  22. public:
  23. explicit JniMethod(const ::std::string &_methodIdentifier, const ::std::string &_methodSignature);
  24. ~JniMethod();
  25. [[nodiscard]] jmethodID getMethodId();
  26. [[nodiscard]] ::std::string getMethodIdentifier() const;
  27. [[nodiscard]] ::std::string getMethodSignature() const;
  28. void setMethodId(jmethodID _methodId);
  29. void setMethodIdentifier(::std::string_view _methodIdentifier);
  30. void setMethodSignature(::std::string_view _methodSignature);
  31. private:
  32. jmethodID methodId{};
  33. ::std::string methodIdentifier{};
  34. ::std::string methodSignature{};
  35. };
  36. }
  37. #endif