25#include "../compat.hpp"
26#include "common_types.hpp"
34namespace essence::jni {
38 ES_API(JNISUPPORT)
explicit global_ref(jobject obj);
39 ES_API(JNISUPPORT)
global_ref(jobject obj,
bool take_over_only);
45 ES_API(JNISUPPORT)
explicit operator bool()
const noexcept;
46 [[nodiscard]] ES_API(JNISUPPORT) jobject get()
const noexcept;
47 ES_API(JNISUPPORT) jobject detach()
noexcept;
56 template <derived_from_j
object JObject>
63 global_ref_ex(JObject obj,
bool take_over_only) : ref_{obj, take_over_only} {}
72 ref_ = std::move(right.ref_);
77 explicit operator bool()
const noexcept {
78 return ref_.operator bool();
89 JObject get()
const noexcept {
90 return static_cast<JObject
>(ref_.get());
93 JObject detach()
noexcept {
94 return static_cast<JObject
>(ref_.detach());
Definition global_ref.hpp:57
Definition global_ref.hpp:35
Definition global_ref.hpp:54