48 private final long nativeRef;
49 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
51 private CppProxy(
long nativeRef)
53 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
54 this.nativeRef = nativeRef;
57 private native
void nativeDestroy(
long nativeRef);
58 public void _djinni_private_destroy()
60 boolean destroyed = this.destroyed.getAndSet(
true);
61 if (!destroyed) nativeDestroy(this.nativeRef);
63 protected void finalize() throws
java.lang.Throwable
65 _djinni_private_destroy();
74 assert !this.destroyed.get() :
"trying to use a destroyed object";
75 return native_createRouteSession(this.nativeRef, wayPoint, routeOptions);
82 assert !this.destroyed.get() :
"trying to use a destroyed object";
83 return native_createRouteSessionWithTag(this.nativeRef, wayPoint, routeOptions, tag);
90 assert !this.destroyed.get() :
"trying to use a destroyed object";
91 native_cancelRouteSession(this.nativeRef, session);
93 private native
void native_cancelRouteSession(
long _nativeRef, RouteSession session);