85 private final long nativeRef;
86 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
88 private CppProxy(
long nativeRef)
90 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
91 this.nativeRef = nativeRef;
94 private native
void nativeDestroy(
long nativeRef);
95 public void _djinni_private_destroy()
97 boolean destroyed = this.destroyed.getAndSet(
true);
98 if (!destroyed) nativeDestroy(this.nativeRef);
100 protected void finalize() throws
java.lang.Throwable
102 _djinni_private_destroy();
111 assert !this.destroyed.get() :
"trying to use a destroyed object";
112 native_addLocationListListener(this.nativeRef, listener);
114 private native
void native_addLocationListListener(
long _nativeRef,
LocationListListener listener);
119 assert !this.destroyed.get() :
"trying to use a destroyed object";
120 native_removeLocationListListener(this.nativeRef, listener);
122 private native
void native_removeLocationListListener(
long _nativeRef,
LocationListListener listener);
125 public void updateLocationList()
127 assert !this.destroyed.get() :
"trying to use a destroyed object";
128 native_updateLocationList(this.nativeRef);
130 private native
void native_updateLocationList(
long _nativeRef);
133 public HashMap<Integer, LocationInfo> getLocationList()
135 assert !this.destroyed.get() :
"trying to use a destroyed object";
136 return native_getLocationList(this.nativeRef);
138 private native HashMap<Integer, LocationInfo> native_getLocationList(
long _nativeRef);