53 private final long nativeRef;
54 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
56 private CppProxy(
long nativeRef)
58 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
59 this.nativeRef = nativeRef;
62 private native
void nativeDestroy(
long nativeRef);
63 public void _djinni_private_destroy()
65 boolean destroyed = this.destroyed.getAndSet(
true);
66 if (!destroyed) nativeDestroy(this.nativeRef);
68 protected void finalize() throws
java.lang.Throwable
70 _djinni_private_destroy();
79 assert !this.destroyed.get() :
"trying to use a destroyed object";
80 native_addLocationListListener(this.nativeRef, listener);
82 private native
void native_addLocationListListener(
long _nativeRef,
LocationListListener listener);
87 assert !this.destroyed.get() :
"trying to use a destroyed object";
88 native_removeLocationListListener(this.nativeRef, listener);
90 private native
void native_removeLocationListListener(
long _nativeRef,
LocationListListener listener);
93 public void updateLocationList()
95 assert !this.destroyed.get() :
"trying to use a destroyed object";
96 native_updateLocationList(this.nativeRef);
98 private native
void native_updateLocationList(
long _nativeRef);
101 public HashMap<Integer, LocationInfo> getLocationList()
103 assert !this.destroyed.get() :
"trying to use a destroyed object";
104 return native_getLocationList(this.nativeRef);
106 private native HashMap<Integer, LocationInfo> native_getLocationList(
long _nativeRef);