Loading...
Searching...
No Matches
Wifi.java
Go to the documentation of this file.
1package com.navigine.idl.java;
2
3import java.util.concurrent.atomic.AtomicBoolean;
4
18public abstract class Wifi {
22 public abstract Point getPoint();
23
27 public abstract int getLocationId();
28
32 public abstract int getSublocationId();
33
37 public abstract String getName();
38
42 public abstract String getMac();
43
47 public abstract TransmitterStatus getStatus();
48
49 private static final class CppProxy extends Wifi
50 {
51 private final long nativeRef;
52 private final AtomicBoolean destroyed = new AtomicBoolean(false);
53
54 private CppProxy(long nativeRef)
55 {
56 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
57 this.nativeRef = nativeRef;
58 }
59
60 private native void nativeDestroy(long nativeRef);
61 public void _djinni_private_destroy()
62 {
63 boolean destroyed = this.destroyed.getAndSet(true);
64 if (!destroyed) nativeDestroy(this.nativeRef);
65 }
66 protected void finalize() throws java.lang.Throwable
67 {
68 _djinni_private_destroy();
69 super.finalize();
70 }
71
72 // Wifi methods
73
74 @Override
75 public Point getPoint()
76 {
77 assert !this.destroyed.get() : "trying to use a destroyed object";
78 return native_getPoint(this.nativeRef);
79 }
80 private native Point native_getPoint(long _nativeRef);
81
82 @Override
83 public int getLocationId()
84 {
85 assert !this.destroyed.get() : "trying to use a destroyed object";
86 return native_getLocationId(this.nativeRef);
87 }
88 private native int native_getLocationId(long _nativeRef);
89
90 @Override
91 public int getSublocationId()
92 {
93 assert !this.destroyed.get() : "trying to use a destroyed object";
94 return native_getSublocationId(this.nativeRef);
95 }
96 private native int native_getSublocationId(long _nativeRef);
97
98 @Override
99 public String getName()
100 {
101 assert !this.destroyed.get() : "trying to use a destroyed object";
102 return native_getName(this.nativeRef);
103 }
104 private native String native_getName(long _nativeRef);
105
106 @Override
107 public String getMac()
108 {
109 assert !this.destroyed.get() : "trying to use a destroyed object";
110 return native_getMac(this.nativeRef);
111 }
112 private native String native_getMac(long _nativeRef);
113
114 @Override
115 public TransmitterStatus getStatus()
116 {
117 assert !this.destroyed.get() : "trying to use a destroyed object";
118 return native_getStatus(this.nativeRef);
119 }
120 private native TransmitterStatus native_getStatus(long _nativeRef);
121 }
122}