Loading...
Searching...
No Matches
containers__conversion.dart
Go to the documentation of this file.
1import 'dart:ffi';
2import 'package:navigine_sdk/com/lazy_list.dart';
3import 'package:navigine_sdk/com/lazy_map.dart';
4import 'package:navigine_sdk/com/native_types.dart';
5import 'package:navigine_sdk/com/navigine/idl/beacon.dart';
6import 'package:navigine_sdk/com/navigine/idl/beacon_proximity_entry.dart';
7import 'package:navigine_sdk/com/navigine/idl/category.dart';
8import 'package:navigine_sdk/com/navigine/idl/cluster_map_object.dart';
9import 'package:navigine_sdk/com/navigine/idl/eddystone.dart';
10import 'package:navigine_sdk/com/navigine/idl/graph_edge.dart';
11import 'package:navigine_sdk/com/navigine/idl/graph_vertex.dart';
12import 'package:navigine_sdk/com/navigine/idl/icon_map_object.dart';
13import 'package:navigine_sdk/com/navigine/idl/location_info.dart';
14import 'package:navigine_sdk/com/navigine/idl/location_point.dart';
15import 'package:navigine_sdk/com/navigine/idl/log_info.dart';
16import 'package:navigine_sdk/com/navigine/idl/map_filter_condition.dart';
17import 'package:navigine_sdk/com/navigine/idl/point.dart';
18import 'package:navigine_sdk/com/navigine/idl/reference_entry.dart';
19import 'package:navigine_sdk/com/navigine/idl/reference_point.dart';
20import 'package:navigine_sdk/com/navigine/idl/route_event.dart';
21import 'package:navigine_sdk/com/navigine/idl/route_node.dart';
22import 'package:navigine_sdk/com/navigine/idl/route_path.dart';
23import 'package:navigine_sdk/com/navigine/idl/segment.dart';
24import 'package:navigine_sdk/com/navigine/idl/sensor_measurement.dart';
25import 'package:navigine_sdk/com/navigine/idl/sensor_type.dart';
26import 'package:navigine_sdk/com/navigine/idl/signal_measurement.dart';
27import 'package:navigine_sdk/com/navigine/idl/sublocation.dart';
28import 'package:navigine_sdk/com/navigine/idl/venue.dart';
29import 'package:navigine_sdk/com/navigine/idl/wifi.dart';
30import 'package:navigine_sdk/com/navigine/idl/zone.dart';
31import 'package:navigine_sdk/com/to_native.dart';
32import 'package:navigine_sdk/com/to_platform.dart';
33
34
35final class ListBeaconImpl {
36 ListBeaconImpl._();
37
38 static List<Beacon> fromNativePtr(Pointer<Void> handle) =>
39 fromPlatformList(handle, (element) => Beacon$Impl.fromExternalPtr(element));
40
41 static List<Beacon>? fromOptionalPtr(Pointer<Void> handle) =>
42 fromPlatformListNullable(handle, (element) => Beacon$Impl.fromExternalPtr(element));
43
44 static Pointer<Void> getNativePtr(List<Beacon>? value) =>
45 toNativeListNullable(value, (element) => Beacon$Impl.getNativePtr(element));
46}
47
48final class ListBeaconProximityEntryImpl {
49 ListBeaconProximityEntryImpl._();
50
51 static List<BeaconProximityEntry> fromNativePtr(Pointer<Void> handle) =>
52 fromPlatformList(handle, (element) => BeaconProximityEntryImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
53
54 static List<BeaconProximityEntry>? fromOptionalPtr(Pointer<Void> handle) =>
55 fromPlatformListNullable(handle, (element) => BeaconProximityEntryImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
56
57 static Pointer<Void> getNativePtr(List<BeaconProximityEntry>? value) =>
58 toNativeListNullable(value, (element) => BeaconProximityEntryImpl.toPointer(element));
59}
60
61final class ListCategoryImpl {
62 ListCategoryImpl._();
63
64 static List<Category> fromNativePtr(Pointer<Void> handle) =>
65 fromPlatformList(handle, (element) => CategoryImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
66
67 static List<Category>? fromOptionalPtr(Pointer<Void> handle) =>
68 fromPlatformListNullable(handle, (element) => CategoryImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
69
70 static Pointer<Void> getNativePtr(List<Category>? value) =>
71 toNativeListNullable(value, (element) => CategoryImpl.toPointer(element));
72}
73
74final class ListClusterMapObjectImpl {
75 ListClusterMapObjectImpl._();
76
77 static List<ClusterMapObject> fromNativePtr(Pointer<Void> handle) =>
78 fromPlatformList(handle, (element) => ClusterMapObject$Impl.fromExternalPtr(element));
79
80 static List<ClusterMapObject>? fromOptionalPtr(Pointer<Void> handle) =>
81 fromPlatformListNullable(handle, (element) => ClusterMapObject$Impl.fromExternalPtr(element));
82
83 static Pointer<Void> getNativePtr(List<ClusterMapObject>? value) =>
84 toNativeListNullable(value, (element) => ClusterMapObject$Impl.getNativePtr(element));
85}
86
87final class ListEddystoneImpl {
88 ListEddystoneImpl._();
89
90 static List<Eddystone> fromNativePtr(Pointer<Void> handle) =>
91 fromPlatformList(handle, (element) => Eddystone$Impl.fromExternalPtr(element));
92
93 static List<Eddystone>? fromOptionalPtr(Pointer<Void> handle) =>
94 fromPlatformListNullable(handle, (element) => Eddystone$Impl.fromExternalPtr(element));
95
96 static Pointer<Void> getNativePtr(List<Eddystone>? value) =>
97 toNativeListNullable(value, (element) => Eddystone$Impl.getNativePtr(element));
98}
99
100final class ListGraphEdgeImpl {
101 ListGraphEdgeImpl._();
102
103 static List<GraphEdge> fromNativePtr(Pointer<Void> handle) =>
104 fromPlatformList(handle, (element) => GraphEdge$Impl.fromExternalPtr(element));
105
106 static List<GraphEdge>? fromOptionalPtr(Pointer<Void> handle) =>
107 fromPlatformListNullable(handle, (element) => GraphEdge$Impl.fromExternalPtr(element));
108
109 static Pointer<Void> getNativePtr(List<GraphEdge>? value) =>
110 toNativeListNullable(value, (element) => GraphEdge$Impl.getNativePtr(element));
111}
112
113final class ListGraphVertexImpl {
114 ListGraphVertexImpl._();
115
116 static List<GraphVertex> fromNativePtr(Pointer<Void> handle) =>
117 fromPlatformList(handle, (element) => GraphVertex$Impl.fromExternalPtr(element));
118
119 static List<GraphVertex>? fromOptionalPtr(Pointer<Void> handle) =>
120 fromPlatformListNullable(handle, (element) => GraphVertex$Impl.fromExternalPtr(element));
121
122 static Pointer<Void> getNativePtr(List<GraphVertex>? value) =>
123 toNativeListNullable(value, (element) => GraphVertex$Impl.getNativePtr(element));
124}
125
126final class ListIconMapObjectImpl {
127 ListIconMapObjectImpl._();
128
129 static List<IconMapObject> fromNativePtr(Pointer<Void> handle) =>
130 fromPlatformList(handle, (element) => IconMapObject$Impl.fromExternalPtr(element));
131
132 static List<IconMapObject>? fromOptionalPtr(Pointer<Void> handle) =>
133 fromPlatformListNullable(handle, (element) => IconMapObject$Impl.fromExternalPtr(element));
134
135 static Pointer<Void> getNativePtr(List<IconMapObject>? value) =>
136 toNativeListNullable(value, (element) => IconMapObject$Impl.getNativePtr(element));
137}
138
139final class ListLocationPointImpl {
140 ListLocationPointImpl._();
141
142 static List<LocationPoint> fromNativePtr(Pointer<Void> handle) =>
143 fromPlatformList(handle, (element) => LocationPointImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
144
145 static List<LocationPoint>? fromOptionalPtr(Pointer<Void> handle) =>
146 fromPlatformListNullable(handle, (element) => LocationPointImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
147
148 static Pointer<Void> getNativePtr(List<LocationPoint>? value) =>
149 toNativeListNullable(value, (element) => LocationPointImpl.toPointer(element));
150}
151
152final class ListLogInfoImpl {
153 ListLogInfoImpl._();
154
155 static List<LogInfo> fromNativePtr(Pointer<Void> handle) =>
156 fromPlatformList(handle, (element) => LogInfoImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
157
158 static List<LogInfo>? fromOptionalPtr(Pointer<Void> handle) =>
159 fromPlatformListNullable(handle, (element) => LogInfoImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
160
161 static Pointer<Void> getNativePtr(List<LogInfo>? value) =>
162 toNativeListNullable(value, (element) => LogInfoImpl.toPointer(element));
163}
164
165final class ListMapFilterConditionImpl {
166 ListMapFilterConditionImpl._();
167
168 static List<MapFilterCondition> fromNativePtr(Pointer<Void> handle) =>
169 fromPlatformList(handle, (element) => MapFilterConditionImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
170
171 static List<MapFilterCondition>? fromOptionalPtr(Pointer<Void> handle) =>
172 fromPlatformListNullable(handle, (element) => MapFilterConditionImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
173
174 static Pointer<Void> getNativePtr(List<MapFilterCondition>? value) =>
175 toNativeListNullable(value, (element) => MapFilterConditionImpl.toPointer(element));
176}
177
178final class ListPointImpl {
179 ListPointImpl._();
180
181 static List<Point> fromNativePtr(Pointer<Void> handle) =>
182 fromPlatformList(handle, (element) => PointImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
183
184 static List<Point>? fromOptionalPtr(Pointer<Void> handle) =>
185 fromPlatformListNullable(handle, (element) => PointImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
186
187 static Pointer<Void> getNativePtr(List<Point>? value) =>
188 toNativeListNullable(value, (element) => PointImpl.toPointer(element));
189}
190
191final class ListReferenceEntryImpl {
192 ListReferenceEntryImpl._();
193
194 static List<ReferenceEntry> fromNativePtr(Pointer<Void> handle) =>
195 fromPlatformList(handle, (element) => ReferenceEntry$Impl.fromExternalPtr(element));
196
197 static List<ReferenceEntry>? fromOptionalPtr(Pointer<Void> handle) =>
198 fromPlatformListNullable(handle, (element) => ReferenceEntry$Impl.fromExternalPtr(element));
199
200 static Pointer<Void> getNativePtr(List<ReferenceEntry>? value) =>
201 toNativeListNullable(value, (element) => ReferenceEntry$Impl.getNativePtr(element));
202}
203
204final class ListReferencePointImpl {
205 ListReferencePointImpl._();
206
207 static List<ReferencePoint> fromNativePtr(Pointer<Void> handle) =>
208 fromPlatformList(handle, (element) => ReferencePoint$Impl.fromExternalPtr(element));
209
210 static List<ReferencePoint>? fromOptionalPtr(Pointer<Void> handle) =>
211 fromPlatformListNullable(handle, (element) => ReferencePoint$Impl.fromExternalPtr(element));
212
213 static Pointer<Void> getNativePtr(List<ReferencePoint>? value) =>
214 toNativeListNullable(value, (element) => ReferencePoint$Impl.getNativePtr(element));
215}
216
217final class ListRouteEventImpl {
218 ListRouteEventImpl._();
219
220 static List<RouteEvent> fromNativePtr(Pointer<Void> handle) =>
221 fromPlatformList(handle, (element) => RouteEventImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
222
223 static List<RouteEvent>? fromOptionalPtr(Pointer<Void> handle) =>
224 fromPlatformListNullable(handle, (element) => RouteEventImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
225
226 static Pointer<Void> getNativePtr(List<RouteEvent>? value) =>
227 toNativeListNullable(value, (element) => RouteEventImpl.toPointer(element));
228}
229
230final class ListRouteNodeImpl {
231 ListRouteNodeImpl._();
232
233 static List<RouteNode> fromNativePtr(Pointer<Void> handle) =>
234 fromPlatformList(handle, (element) => RouteNodeImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
235
236 static List<RouteNode>? fromOptionalPtr(Pointer<Void> handle) =>
237 fromPlatformListNullable(handle, (element) => RouteNodeImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
238
239 static Pointer<Void> getNativePtr(List<RouteNode>? value) =>
240 toNativeListNullable(value, (element) => RouteNodeImpl.toPointer(element));
241}
242
243final class ListRoutePathImpl {
244 ListRoutePathImpl._();
245
246 static List<RoutePath> fromNativePtr(Pointer<Void> handle) =>
247 fromPlatformList(handle, (element) => RoutePath$Impl.fromExternalPtr(element));
248
249 static List<RoutePath>? fromOptionalPtr(Pointer<Void> handle) =>
250 fromPlatformListNullable(handle, (element) => RoutePath$Impl.fromExternalPtr(element));
251
252 static Pointer<Void> getNativePtr(List<RoutePath>? value) =>
253 toNativeListNullable(value, (element) => RoutePath$Impl.getNativePtr(element));
254}
255
256final class ListSegmentImpl {
257 ListSegmentImpl._();
258
259 static List<Segment> fromNativePtr(Pointer<Void> handle) =>
260 fromPlatformList(handle, (element) => SegmentImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
261
262 static List<Segment>? fromOptionalPtr(Pointer<Void> handle) =>
263 fromPlatformListNullable(handle, (element) => SegmentImpl.fromPointer(element, needFree: false, takeOwnership: false)!);
264
265 static Pointer<Void> getNativePtr(List<Segment>? value) =>
266 toNativeListNullable(value, (element) => SegmentImpl.toPointer(element));
267}
268
269final class ListStringImpl {
270 ListStringImpl._();
271
272 static List<String> fromNativePtr(Pointer<Void> handle) =>
273 fromPlatformList(handle, (element) => toPlatformFromPointerString(element, needFree: false)!);
274
275 static List<String>? fromOptionalPtr(Pointer<Void> handle) =>
276 fromPlatformListNullable(handle, (element) => toPlatformFromPointerString(element, needFree: false)!);
277
278 static Pointer<Void> getNativePtr(List<String>? value) =>
279 toNativeListNullable(value, (element) => toNativePtrString(element));
280}
281
282final class ListSublocationImpl {
283 ListSublocationImpl._();
284
285 static List<Sublocation> fromNativePtr(Pointer<Void> handle) =>
286 fromPlatformList(handle, (element) => Sublocation$Impl.fromExternalPtr(element));
287
288 static List<Sublocation>? fromOptionalPtr(Pointer<Void> handle) =>
289 fromPlatformListNullable(handle, (element) => Sublocation$Impl.fromExternalPtr(element));
290
291 static Pointer<Void> getNativePtr(List<Sublocation>? value) =>
292 toNativeListNullable(value, (element) => Sublocation$Impl.getNativePtr(element));
293}
294
295final class ListVenueImpl {
296 ListVenueImpl._();
297
298 static List<Venue> fromNativePtr(Pointer<Void> handle) =>
299 fromPlatformList(handle, (element) => Venue$Impl.fromExternalPtr(element));
300
301 static List<Venue>? fromOptionalPtr(Pointer<Void> handle) =>
302 fromPlatformListNullable(handle, (element) => Venue$Impl.fromExternalPtr(element));
303
304 static Pointer<Void> getNativePtr(List<Venue>? value) =>
305 toNativeListNullable(value, (element) => Venue$Impl.getNativePtr(element));
306}
307
308final class ListWifiImpl {
309 ListWifiImpl._();
310
311 static List<Wifi> fromNativePtr(Pointer<Void> handle) =>
312 fromPlatformList(handle, (element) => Wifi$Impl.fromExternalPtr(element));
313
314 static List<Wifi>? fromOptionalPtr(Pointer<Void> handle) =>
315 fromPlatformListNullable(handle, (element) => Wifi$Impl.fromExternalPtr(element));
316
317 static Pointer<Void> getNativePtr(List<Wifi>? value) =>
318 toNativeListNullable(value, (element) => Wifi$Impl.getNativePtr(element));
319}
320
321final class ListZoneImpl {
322 ListZoneImpl._();
323
324 static List<Zone> fromNativePtr(Pointer<Void> handle) =>
325 fromPlatformList(handle, (element) => Zone$Impl.fromExternalPtr(element));
326
327 static List<Zone>? fromOptionalPtr(Pointer<Void> handle) =>
328 fromPlatformListNullable(handle, (element) => Zone$Impl.fromExternalPtr(element));
329
330 static Pointer<Void> getNativePtr(List<Zone>? value) =>
331 toNativeListNullable(value, (element) => Zone$Impl.getNativePtr(element));
332}
333
334final class MapSensorType_SensorMeasurementImpl {
335 MapSensorType_SensorMeasurementImpl._();
336
337 static Map<SensorType, SensorMeasurement> fromNativePtr(Pointer<Void> handle) =>
338 fromPlatformIntMap(handle, (nativeValue) => SensorMeasurementImpl.fromPointer(nativeValue, needFree: false, takeOwnership: false)!, keyFromInt: SensorTypeImpl.fromInt, keyToInt: SensorTypeImpl.toInt);
339
340 static Map<SensorType, SensorMeasurement>? fromOptionalPtr(Pointer<Void> handle) =>
341 fromPlatformIntMapNullable(handle, (nativeValue) => SensorMeasurementImpl.fromPointer(nativeValue, needFree: false, takeOwnership: false)!, keyFromInt: SensorTypeImpl.fromInt, keyToInt: SensorTypeImpl.toInt);
342
343 static Pointer<Void> getNativePtr(Map<SensorType, SensorMeasurement>? value) =>
344 toNativeIntMapNullable(value, SensorTypeImpl.toInt, (value) => SensorMeasurementImpl.toPointer(value));
345}
346
347final class MapString_SignalMeasurementImpl {
348 MapString_SignalMeasurementImpl._();
349
350 static Map<String, SignalMeasurement> fromNativePtr(Pointer<Void> handle) =>
351 fromPlatformStringMap(handle, (nativeValue) => SignalMeasurementImpl.fromPointer(nativeValue, needFree: false, takeOwnership: false)!);
352
353 static Map<String, SignalMeasurement>? fromOptionalPtr(Pointer<Void> handle) =>
354 fromPlatformStringMapNullable(handle, (nativeValue) => SignalMeasurementImpl.fromPointer(nativeValue, needFree: false, takeOwnership: false)!);
355
356 static Pointer<Void> getNativePtr(Map<String, SignalMeasurement>? value) =>
357 toNativeStringMapNullable(value, (value) => SignalMeasurementImpl.toPointer(value));
358}
359
360final class MapString_StringImpl {
361 MapString_StringImpl._();
362
363 static Map<String, String> fromNativePtr(Pointer<Void> handle) =>
364 fromPlatformStringMap(handle, (nativeValue) => toPlatformFromPointerString(nativeValue, needFree: false)!);
365
366 static Map<String, String>? fromOptionalPtr(Pointer<Void> handle) =>
367 fromPlatformStringMapNullable(handle, (nativeValue) => toPlatformFromPointerString(nativeValue, needFree: false)!);
368
369 static Pointer<Void> getNativePtr(Map<String, String>? value) =>
370 toNativeStringMapNullable(value, (value) => toNativePtrString(value));
371}
372
373final class MapInt_LocationInfoImpl {
374 MapInt_LocationInfoImpl._();
375
376 static Map<int, LocationInfo> fromNativePtr(Pointer<Void> handle) =>
377 fromPlatformIntMap(handle, (nativeValue) => LocationInfoImpl.fromPointer(nativeValue, needFree: false, takeOwnership: false)!);
378
379 static Map<int, LocationInfo>? fromOptionalPtr(Pointer<Void> handle) =>
380 fromPlatformIntMapNullable(handle, (nativeValue) => LocationInfoImpl.fromPointer(nativeValue, needFree: false, takeOwnership: false)!);
381
382 static Pointer<Void> getNativePtr(Map<int, LocationInfo>? value) =>
383 toNativeIntMapNullable(value, (key) => key, (value) => LocationInfoImpl.toPointer(value));
384}