145 private static final class CppProxy
extends Beacon
147 private final long nativeRef;
148 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
150 private CppProxy(
long nativeRef)
152 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
153 this.nativeRef = nativeRef;
156 private native
void nativeDestroy(
long nativeRef);
157 public void _djinni_private_destroy()
159 boolean destroyed = this.destroyed.getAndSet(
true);
160 if (!destroyed) nativeDestroy(this.nativeRef);
162 protected void finalize() throws
java.lang.Throwable
164 _djinni_private_destroy();
171 public Point getPoint()
173 assert !this.destroyed.get() :
"trying to use a destroyed object";
174 return native_getPoint(this.nativeRef);
176 private native
Point native_getPoint(
long _nativeRef);
179 public int getLocationId()
181 assert !this.destroyed.get() :
"trying to use a destroyed object";
182 return native_getLocationId(this.nativeRef);
184 private native
int native_getLocationId(
long _nativeRef);
187 public int getSublocationId()
189 assert !this.destroyed.get() :
"trying to use a destroyed object";
190 return native_getSublocationId(this.nativeRef);
192 private native
int native_getSublocationId(
long _nativeRef);
195 public String getName()
197 assert !this.destroyed.get() :
"trying to use a destroyed object";
198 return native_getName(this.nativeRef);
200 private native String native_getName(
long _nativeRef);
203 public int getMajor()
205 assert !this.destroyed.get() :
"trying to use a destroyed object";
206 return native_getMajor(this.nativeRef);
208 private native
int native_getMajor(
long _nativeRef);
211 public int getMinor()
213 assert !this.destroyed.get() :
"trying to use a destroyed object";
214 return native_getMinor(this.nativeRef);
216 private native
int native_getMinor(
long _nativeRef);
219 public String getUuid()
221 assert !this.destroyed.get() :
"trying to use a destroyed object";
222 return native_getUuid(this.nativeRef);
224 private native String native_getUuid(
long _nativeRef);
227 public Integer getPower()
229 assert !this.destroyed.get() :
"trying to use a destroyed object";
230 return native_getPower(this.nativeRef);
232 private native Integer native_getPower(
long _nativeRef);
235 public TransmitterStatus getStatus()
237 assert !this.destroyed.get() :
"trying to use a destroyed object";
238 return native_getStatus(this.nativeRef);
240 private native TransmitterStatus native_getStatus(
long _nativeRef);