aboutsummaryrefslogtreecommitdiffstats
path: root/java/jni
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-06-18 06:50:15 +0200
committerSven Gothel <[email protected]>2020-06-18 06:50:15 +0200
commitb899d56e49d06ce9fe955eb903f84f1e47644056 (patch)
tree690a147cc819042416d8f8cbc1b9c050b7a05c94 /java/jni
parentacdce5a21b676b6b83b62a48b11d2000895ca9eb (diff)
Direct-BT: API doc and clarify interface JavaAnonObj, JavaUplink and JavaAnonObj implementation JavaGlobalObj
JavaAnonObj is now a full virtual interface. JavaGlobalObj gets default spec for copy and move ctor and assignment.
Diffstat (limited to 'java/jni')
-rw-r--r--java/jni/direct_bt/helper_dbt.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/java/jni/direct_bt/helper_dbt.hpp b/java/jni/direct_bt/helper_dbt.hpp
index b2f002d..40e2c60 100644
--- a/java/jni/direct_bt/helper_dbt.hpp
+++ b/java/jni/direct_bt/helper_dbt.hpp
@@ -52,6 +52,10 @@ namespace direct_bt {
};
extern DirectBTJNISettings directBTJNISettings;
+ /**
+ * Implementation for JavaAnonObj,
+ * by simply wrapping a JNIGlobalRef instance.
+ */
class JavaGlobalObj : public JavaAnonObj {
private:
JNIGlobalRef javaObjectRef;
@@ -77,7 +81,11 @@ namespace direct_bt {
return true;
}
JavaGlobalObj(jobject obj) : javaObjectRef(obj) { }
- ~JavaGlobalObj() override { }
+
+ JavaGlobalObj(const JavaGlobalObj &o) noexcept = default;
+ JavaGlobalObj(JavaGlobalObj &&o) noexcept = default;
+ JavaGlobalObj& operator=(const JavaGlobalObj &o) noexcept = default;
+ JavaGlobalObj& operator=(JavaGlobalObj &&o) noexcept = default;
std::string toString() const override {
const uint64_t ref = (uint64_t)(void*)javaObjectRef.getObject();