JniMethod.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-08
  6. * Changed: 2024-09-11
  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. * @doc: core.JniMethod.description('This class represents a class method within Java Native Interface (JNI) context.')
  18. * */
  19. namespace ls::std::core::experimental
  20. {
  21. class LS_STD_DYNAMIC_GOAL JniMethod
  22. {
  23. public:
  24. explicit JniMethod(const ::std::string &_methodIdentifier, const ::std::string &_methodSignature);
  25. ~JniMethod();
  26. [[nodiscard]] jmethodID getMethodId();
  27. [[nodiscard]] ::std::string getMethodIdentifier() const;
  28. [[nodiscard]] ::std::string getMethodSignature() const;
  29. void setMethodId(jmethodID _methodId);
  30. void setMethodIdentifier(::std::string_view _methodIdentifier);
  31. void setMethodSignature(::std::string_view _methodSignature);
  32. private:
  33. jmethodID methodId{};
  34. ::std::string methodIdentifier{};
  35. ::std::string methodSignature{};
  36. };
  37. }
  38. #endif