131 private static final class CppProxy
extends Eddystone
133 private final long nativeRef;
134 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
136 private CppProxy(
long nativeRef)
138 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
139 this.nativeRef = nativeRef;
142 private native
void nativeDestroy(
long nativeRef);
143 public void _djinni_private_destroy()
145 boolean destroyed = this.destroyed.getAndSet(
true);
146 if (!destroyed) nativeDestroy(this.nativeRef);
148 protected void finalize() throws
java.lang.Throwable
150 _djinni_private_destroy();
157 public Point getPoint()
159 assert !this.destroyed.get() :
"trying to use a destroyed object";
160 return native_getPoint(this.nativeRef);
162 private native
Point native_getPoint(
long _nativeRef);
165 public int getLocationId()
167 assert !this.destroyed.get() :
"trying to use a destroyed object";
168 return native_getLocationId(this.nativeRef);
170 private native
int native_getLocationId(
long _nativeRef);
173 public int getSublocationId()
175 assert !this.destroyed.get() :
"trying to use a destroyed object";
176 return native_getSublocationId(this.nativeRef);
178 private native
int native_getSublocationId(
long _nativeRef);
181 public String getName()
183 assert !this.destroyed.get() :
"trying to use a destroyed object";
184 return native_getName(this.nativeRef);
186 private native String native_getName(
long _nativeRef);
189 public String getNamespaceId()
191 assert !this.destroyed.get() :
"trying to use a destroyed object";
192 return native_getNamespaceId(this.nativeRef);
194 private native String native_getNamespaceId(
long _nativeRef);
197 public String getInstanceId()
199 assert !this.destroyed.get() :
"trying to use a destroyed object";
200 return native_getInstanceId(this.nativeRef);
202 private native String native_getInstanceId(
long _nativeRef);
205 public Integer getPower()
207 assert !this.destroyed.get() :
"trying to use a destroyed object";
208 return native_getPower(this.nativeRef);
210 private native Integer native_getPower(
long _nativeRef);
213 public TransmitterStatus getStatus()
215 assert !this.destroyed.get() :
"trying to use a destroyed object";
216 return native_getStatus(this.nativeRef);
218 private native TransmitterStatus native_getStatus(
long _nativeRef);