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 {
31 public abstract Point getPoint();
32
45 public abstract int getLocationId();
46
59 public abstract int getSublocationId();
60
73 public abstract String getName();
74
87 public abstract String getMac();
88
101 public abstract TransmitterStatus getStatus();
102
103 private static final class CppProxy extends Wifi
104 {
105 private final long nativeRef;
106 private final AtomicBoolean destroyed = new AtomicBoolean(false);
107
108 private CppProxy(long nativeRef)
109 {
110 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
111 this.nativeRef = nativeRef;
112 }
113
114 private native void nativeDestroy(long nativeRef);
115 public void _djinni_private_destroy()
116 {
117 boolean destroyed = this.destroyed.getAndSet(true);
118 if (!destroyed) nativeDestroy(this.nativeRef);
119 }
120 protected void finalize() throws java.lang.Throwable
121 {
122 _djinni_private_destroy();
123 super.finalize();
124 }
125
126 // Wifi methods
127
128 @Override
129 public Point getPoint()
130 {
131 assert !this.destroyed.get() : "trying to use a destroyed object";
132 return native_getPoint(this.nativeRef);
133 }
134 private native Point native_getPoint(long _nativeRef);
135
136 @Override
137 public int getLocationId()
138 {
139 assert !this.destroyed.get() : "trying to use a destroyed object";
140 return native_getLocationId(this.nativeRef);
141 }
142 private native int native_getLocationId(long _nativeRef);
143
144 @Override
145 public int getSublocationId()
146 {
147 assert !this.destroyed.get() : "trying to use a destroyed object";
148 return native_getSublocationId(this.nativeRef);
149 }
150 private native int native_getSublocationId(long _nativeRef);
151
152 @Override
153 public String getName()
154 {
155 assert !this.destroyed.get() : "trying to use a destroyed object";
156 return native_getName(this.nativeRef);
157 }
158 private native String native_getName(long _nativeRef);
159
160 @Override
161 public String getMac()
162 {
163 assert !this.destroyed.get() : "trying to use a destroyed object";
164 return native_getMac(this.nativeRef);
165 }
166 private native String native_getMac(long _nativeRef);
167
168 @Override
169 public TransmitterStatus getStatus()
170 {
171 assert !this.destroyed.get() : "trying to use a destroyed object";
172 return native_getStatus(this.nativeRef);
173 }
174 private native TransmitterStatus native_getStatus(long _nativeRef);
175 }
176}