78 private final long nativeRef;
79 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
81 private CppProxy(
long nativeRef)
83 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
84 this.nativeRef = nativeRef;
87 private native
void nativeDestroy(
long nativeRef);
88 public void _djinni_private_destroy()
90 boolean destroyed = this.destroyed.getAndSet(
true);
91 if (!destroyed) nativeDestroy(this.nativeRef);
93 protected void finalize() throws
java.lang.Throwable
95 _djinni_private_destroy();
104 assert !this.destroyed.get() :
"trying to use a destroyed object";
105 return native_createRouteSession(this.nativeRef, wayPoint, routeOptions);
112 assert !this.destroyed.get() :
"trying to use a destroyed object";
113 return native_createRouteSessionWithTag(this.nativeRef, wayPoint, routeOptions, tag);
120 assert !this.destroyed.get() :
"trying to use a destroyed object";
121 native_cancelRouteSession(this.nativeRef, session);
123 private native
void native_cancelRouteSession(
long _nativeRef, RouteSession session);