59 private static final class CppProxy
extends Eddystone
61 private final long nativeRef;
62 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
64 private CppProxy(
long nativeRef)
66 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
67 this.nativeRef = nativeRef;
70 private native
void nativeDestroy(
long nativeRef);
71 public void _djinni_private_destroy()
73 boolean destroyed = this.destroyed.getAndSet(
true);
74 if (!destroyed) nativeDestroy(this.nativeRef);
76 protected void finalize() throws
java.lang.Throwable
78 _djinni_private_destroy();
85 public Point getPoint()
87 assert !this.destroyed.get() :
"trying to use a destroyed object";
88 return native_getPoint(this.nativeRef);
90 private native
Point native_getPoint(
long _nativeRef);
93 public int getLocationId()
95 assert !this.destroyed.get() :
"trying to use a destroyed object";
96 return native_getLocationId(this.nativeRef);
98 private native
int native_getLocationId(
long _nativeRef);
101 public int getSublocationId()
103 assert !this.destroyed.get() :
"trying to use a destroyed object";
104 return native_getSublocationId(this.nativeRef);
106 private native
int native_getSublocationId(
long _nativeRef);
109 public String getName()
111 assert !this.destroyed.get() :
"trying to use a destroyed object";
112 return native_getName(this.nativeRef);
114 private native String native_getName(
long _nativeRef);
117 public String getNamespaceId()
119 assert !this.destroyed.get() :
"trying to use a destroyed object";
120 return native_getNamespaceId(this.nativeRef);
122 private native String native_getNamespaceId(
long _nativeRef);
125 public String getInstanceId()
127 assert !this.destroyed.get() :
"trying to use a destroyed object";
128 return native_getInstanceId(this.nativeRef);
130 private native String native_getInstanceId(
long _nativeRef);
133 public Integer getPower()
135 assert !this.destroyed.get() :
"trying to use a destroyed object";
136 return native_getPower(this.nativeRef);
138 private native Integer native_getPower(
long _nativeRef);
141 public TransmitterStatus getStatus()
143 assert !this.destroyed.get() :
"trying to use a destroyed object";
144 return native_getStatus(this.nativeRef);
146 private native TransmitterStatus native_getStatus(
long _nativeRef);