154 private static final class CppProxy
extends Beacon
156 private final long nativeRef;
157 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
159 private CppProxy(
long nativeRef)
161 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
162 this.nativeRef = nativeRef;
165 private native
void nativeDestroy(
long nativeRef);
166 public void _djinni_private_destroy()
168 boolean destroyed = this.destroyed.getAndSet(
true);
169 if (!destroyed) nativeDestroy(this.nativeRef);
171 protected void finalize() throws
java.lang.Throwable
173 _djinni_private_destroy();
180 public Point getPoint()
182 assert !this.destroyed.get() :
"trying to use a destroyed object";
183 return native_getPoint(this.nativeRef);
185 private native
Point native_getPoint(
long _nativeRef);
188 public int getLocationId()
190 assert !this.destroyed.get() :
"trying to use a destroyed object";
191 return native_getLocationId(this.nativeRef);
193 private native
int native_getLocationId(
long _nativeRef);
196 public int getSublocationId()
198 assert !this.destroyed.get() :
"trying to use a destroyed object";
199 return native_getSublocationId(this.nativeRef);
201 private native
int native_getSublocationId(
long _nativeRef);
204 public String getName()
206 assert !this.destroyed.get() :
"trying to use a destroyed object";
207 return native_getName(this.nativeRef);
209 private native String native_getName(
long _nativeRef);
212 public int getMajor()
214 assert !this.destroyed.get() :
"trying to use a destroyed object";
215 return native_getMajor(this.nativeRef);
217 private native
int native_getMajor(
long _nativeRef);
220 public int getMinor()
222 assert !this.destroyed.get() :
"trying to use a destroyed object";
223 return native_getMinor(this.nativeRef);
225 private native
int native_getMinor(
long _nativeRef);
228 public String getUuid()
230 assert !this.destroyed.get() :
"trying to use a destroyed object";
231 return native_getUuid(this.nativeRef);
233 private native String native_getUuid(
long _nativeRef);
236 public Integer getPower()
238 assert !this.destroyed.get() :
"trying to use a destroyed object";
239 return native_getPower(this.nativeRef);
241 private native Integer native_getPower(
long _nativeRef);
244 public TransmitterStatus getStatus()
246 assert !this.destroyed.get() :
"trying to use a destroyed object";
247 return native_getStatus(this.nativeRef);
249 private native TransmitterStatus native_getStatus(
long _nativeRef);