75 private final long nativeRef;
76 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
78 private CppProxy(
long nativeRef)
80 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
81 this.nativeRef = nativeRef;
84 private native
void nativeDestroy(
long nativeRef);
85 public void _djinni_private_destroy()
87 boolean destroyed = this.destroyed.getAndSet(
true);
88 if (!destroyed) nativeDestroy(this.nativeRef);
90 protected void finalize() throws
java.lang.Throwable
92 _djinni_private_destroy();
101 assert !this.destroyed.get() :
"trying to use a destroyed object";
102 return native_createRouteSession(this.nativeRef, wayPoint, routeOptions);
109 assert !this.destroyed.get() :
"trying to use a destroyed object";
110 return native_createRouteSessionWithTag(this.nativeRef, wayPoint, routeOptions, tag);
117 assert !this.destroyed.get() :
"trying to use a destroyed object";
118 native_cancelRouteSession(this.nativeRef, session);
120 private native
void native_cancelRouteSession(
long _nativeRef, RouteSession session);