243 lines
9.2 KiB
Dart
243 lines
9.2 KiB
Dart
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||
|
// This code was generated by ObjectBox. To update it run the generator again
|
||
|
// with `dart run build_runner build`.
|
||
|
// See also https://docs.objectbox.io/getting-started#generate-objectbox-code
|
||
|
|
||
|
// ignore_for_file: camel_case_types, depend_on_referenced_packages
|
||
|
// coverage:ignore-file
|
||
|
|
||
|
import 'dart:typed_data';
|
||
|
|
||
|
import 'package:flat_buffers/flat_buffers.dart' as fb;
|
||
|
import 'package:objectbox/internal.dart'
|
||
|
as obx_int; // generated code can access "internal" functionality
|
||
|
import 'package:objectbox/objectbox.dart' as obx;
|
||
|
import 'package:objectbox_flutter_libs/objectbox_flutter_libs.dart';
|
||
|
|
||
|
import 'xiao_connector/models/capture_point.dart';
|
||
|
|
||
|
export 'package:objectbox/objectbox.dart'; // so that callers only have to import this file
|
||
|
|
||
|
final _entities = <obx_int.ModelEntity>[
|
||
|
obx_int.ModelEntity(
|
||
|
id: const obx_int.IdUid(2, 23371849066855038),
|
||
|
name: 'CapturePoint',
|
||
|
lastPropertyId: const obx_int.IdUid(10, 4052938287274443905),
|
||
|
flags: 0,
|
||
|
properties: <obx_int.ModelProperty>[
|
||
|
obx_int.ModelProperty(
|
||
|
id: const obx_int.IdUid(1, 9209282349575641428),
|
||
|
name: 'id',
|
||
|
type: 6,
|
||
|
flags: 1),
|
||
|
obx_int.ModelProperty(
|
||
|
id: const obx_int.IdUid(2, 8441629944202144182),
|
||
|
name: 'rotationX',
|
||
|
type: 9,
|
||
|
flags: 0),
|
||
|
obx_int.ModelProperty(
|
||
|
id: const obx_int.IdUid(3, 3805193742978753321),
|
||
|
name: 'rotationY',
|
||
|
type: 9,
|
||
|
flags: 0),
|
||
|
obx_int.ModelProperty(
|
||
|
id: const obx_int.IdUid(4, 7632102454091387966),
|
||
|
name: 'rotationZ',
|
||
|
type: 9,
|
||
|
flags: 0),
|
||
|
obx_int.ModelProperty(
|
||
|
id: const obx_int.IdUid(5, 1175247580397683930),
|
||
|
name: 'accelerationX',
|
||
|
type: 9,
|
||
|
flags: 0),
|
||
|
obx_int.ModelProperty(
|
||
|
id: const obx_int.IdUid(6, 133552602314920473),
|
||
|
name: 'accelerationY',
|
||
|
type: 9,
|
||
|
flags: 0),
|
||
|
obx_int.ModelProperty(
|
||
|
id: const obx_int.IdUid(7, 7272664476171529007),
|
||
|
name: 'accelerationZ',
|
||
|
type: 9,
|
||
|
flags: 0),
|
||
|
obx_int.ModelProperty(
|
||
|
id: const obx_int.IdUid(9, 5697556233714735057),
|
||
|
name: 'type',
|
||
|
type: 9,
|
||
|
flags: 0),
|
||
|
obx_int.ModelProperty(
|
||
|
id: const obx_int.IdUid(10, 4052938287274443905),
|
||
|
name: 'millisecondsSinceEpoch',
|
||
|
type: 6,
|
||
|
flags: 0)
|
||
|
],
|
||
|
relations: <obx_int.ModelRelation>[],
|
||
|
backlinks: <obx_int.ModelBacklink>[])
|
||
|
];
|
||
|
|
||
|
/// Shortcut for [obx.Store.new] that passes [getObjectBoxModel] and for Flutter
|
||
|
/// apps by default a [directory] using `defaultStoreDirectory()` from the
|
||
|
/// ObjectBox Flutter library.
|
||
|
///
|
||
|
/// Note: for desktop apps it is recommended to specify a unique [directory].
|
||
|
///
|
||
|
/// See [obx.Store.new] for an explanation of all parameters.
|
||
|
///
|
||
|
/// For Flutter apps, also calls `loadObjectBoxLibraryAndroidCompat()` from
|
||
|
/// the ObjectBox Flutter library to fix loading the native ObjectBox library
|
||
|
/// on Android 6 and older.
|
||
|
Future<obx.Store> openStore(
|
||
|
{String? directory,
|
||
|
int? maxDBSizeInKB,
|
||
|
int? maxDataSizeInKB,
|
||
|
int? fileMode,
|
||
|
int? maxReaders,
|
||
|
bool queriesCaseSensitiveDefault = true,
|
||
|
String? macosApplicationGroup}) async {
|
||
|
await loadObjectBoxLibraryAndroidCompat();
|
||
|
return obx.Store(getObjectBoxModel(),
|
||
|
directory: directory ?? (await defaultStoreDirectory()).path,
|
||
|
maxDBSizeInKB: maxDBSizeInKB,
|
||
|
maxDataSizeInKB: maxDataSizeInKB,
|
||
|
fileMode: fileMode,
|
||
|
maxReaders: maxReaders,
|
||
|
queriesCaseSensitiveDefault: queriesCaseSensitiveDefault,
|
||
|
macosApplicationGroup: macosApplicationGroup);
|
||
|
}
|
||
|
|
||
|
/// Returns the ObjectBox model definition for this project for use with
|
||
|
/// [obx.Store.new].
|
||
|
obx_int.ModelDefinition getObjectBoxModel() {
|
||
|
final model = obx_int.ModelInfo(
|
||
|
entities: _entities,
|
||
|
lastEntityId: const obx_int.IdUid(2, 23371849066855038),
|
||
|
lastIndexId: const obx_int.IdUid(0, 0),
|
||
|
lastRelationId: const obx_int.IdUid(0, 0),
|
||
|
lastSequenceId: const obx_int.IdUid(0, 0),
|
||
|
retiredEntityUids: const [6206931177901930822],
|
||
|
retiredIndexUids: const [],
|
||
|
retiredPropertyUids: const [
|
||
|
696937191447548336,
|
||
|
7375635633551465262,
|
||
|
7972299062087181706,
|
||
|
5044874535120106939,
|
||
|
6473009355337784814,
|
||
|
8948425706967252950,
|
||
|
5134040367670771080,
|
||
|
4879888592430478383,
|
||
|
2890906455219707986
|
||
|
],
|
||
|
retiredRelationUids: const [],
|
||
|
modelVersion: 5,
|
||
|
modelVersionParserMinimum: 5,
|
||
|
version: 1);
|
||
|
|
||
|
final bindings = <Type, obx_int.EntityDefinition>{
|
||
|
CapturePoint: obx_int.EntityDefinition<CapturePoint>(
|
||
|
model: _entities[0],
|
||
|
toOneRelations: (CapturePoint object) => [],
|
||
|
toManyRelations: (CapturePoint object) => {},
|
||
|
getId: (CapturePoint object) => object.id,
|
||
|
setId: (CapturePoint object, int id) {
|
||
|
object.id = id;
|
||
|
},
|
||
|
objectToFB: (CapturePoint object, fb.Builder fbb) {
|
||
|
final rotationXOffset = fbb.writeString(object.rotationX);
|
||
|
final rotationYOffset = fbb.writeString(object.rotationY);
|
||
|
final rotationZOffset = fbb.writeString(object.rotationZ);
|
||
|
final accelerationXOffset = fbb.writeString(object.accelerationX);
|
||
|
final accelerationYOffset = fbb.writeString(object.accelerationY);
|
||
|
final accelerationZOffset = fbb.writeString(object.accelerationZ);
|
||
|
final typeOffset = fbb.writeString(object.type);
|
||
|
fbb.startTable(11);
|
||
|
fbb.addInt64(0, object.id);
|
||
|
fbb.addOffset(1, rotationXOffset);
|
||
|
fbb.addOffset(2, rotationYOffset);
|
||
|
fbb.addOffset(3, rotationZOffset);
|
||
|
fbb.addOffset(4, accelerationXOffset);
|
||
|
fbb.addOffset(5, accelerationYOffset);
|
||
|
fbb.addOffset(6, accelerationZOffset);
|
||
|
fbb.addOffset(8, typeOffset);
|
||
|
fbb.addInt64(9, object.millisecondsSinceEpoch);
|
||
|
fbb.finish(fbb.endTable());
|
||
|
return object.id;
|
||
|
},
|
||
|
objectFromFB: (obx.Store store, ByteData fbData) {
|
||
|
final buffer = fb.BufferContext(fbData);
|
||
|
final rootOffset = buffer.derefObject(0);
|
||
|
final typeParam = const fb.StringReader(asciiOptimization: true)
|
||
|
.vTableGet(buffer, rootOffset, 20, '');
|
||
|
final rotationXParam = const fb.StringReader(asciiOptimization: true)
|
||
|
.vTableGet(buffer, rootOffset, 6, '');
|
||
|
final rotationYParam = const fb.StringReader(asciiOptimization: true)
|
||
|
.vTableGet(buffer, rootOffset, 8, '');
|
||
|
final rotationZParam = const fb.StringReader(asciiOptimization: true)
|
||
|
.vTableGet(buffer, rootOffset, 10, '');
|
||
|
final accelerationXParam =
|
||
|
const fb.StringReader(asciiOptimization: true)
|
||
|
.vTableGet(buffer, rootOffset, 12, '');
|
||
|
final accelerationYParam =
|
||
|
const fb.StringReader(asciiOptimization: true)
|
||
|
.vTableGet(buffer, rootOffset, 14, '');
|
||
|
final accelerationZParam =
|
||
|
const fb.StringReader(asciiOptimization: true)
|
||
|
.vTableGet(buffer, rootOffset, 16, '');
|
||
|
final millisecondsSinceEpochParam =
|
||
|
const fb.Int64Reader().vTableGetNullable(buffer, rootOffset, 22);
|
||
|
final object = CapturePoint(
|
||
|
type: typeParam,
|
||
|
rotationX: rotationXParam,
|
||
|
rotationY: rotationYParam,
|
||
|
rotationZ: rotationZParam,
|
||
|
accelerationX: accelerationXParam,
|
||
|
accelerationY: accelerationYParam,
|
||
|
accelerationZ: accelerationZParam,
|
||
|
millisecondsSinceEpoch: millisecondsSinceEpochParam)
|
||
|
..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0);
|
||
|
|
||
|
return object;
|
||
|
})
|
||
|
};
|
||
|
|
||
|
return obx_int.ModelDefinition(model, bindings);
|
||
|
}
|
||
|
|
||
|
/// [CapturePoint] entity fields to define ObjectBox queries.
|
||
|
class CapturePoint_ {
|
||
|
/// See [CapturePoint.id].
|
||
|
static final id =
|
||
|
obx.QueryIntegerProperty<CapturePoint>(_entities[0].properties[0]);
|
||
|
|
||
|
/// See [CapturePoint.rotationX].
|
||
|
static final rotationX =
|
||
|
obx.QueryStringProperty<CapturePoint>(_entities[0].properties[1]);
|
||
|
|
||
|
/// See [CapturePoint.rotationY].
|
||
|
static final rotationY =
|
||
|
obx.QueryStringProperty<CapturePoint>(_entities[0].properties[2]);
|
||
|
|
||
|
/// See [CapturePoint.rotationZ].
|
||
|
static final rotationZ =
|
||
|
obx.QueryStringProperty<CapturePoint>(_entities[0].properties[3]);
|
||
|
|
||
|
/// See [CapturePoint.accelerationX].
|
||
|
static final accelerationX =
|
||
|
obx.QueryStringProperty<CapturePoint>(_entities[0].properties[4]);
|
||
|
|
||
|
/// See [CapturePoint.accelerationY].
|
||
|
static final accelerationY =
|
||
|
obx.QueryStringProperty<CapturePoint>(_entities[0].properties[5]);
|
||
|
|
||
|
/// See [CapturePoint.accelerationZ].
|
||
|
static final accelerationZ =
|
||
|
obx.QueryStringProperty<CapturePoint>(_entities[0].properties[6]);
|
||
|
|
||
|
/// See [CapturePoint.type].
|
||
|
static final type =
|
||
|
obx.QueryStringProperty<CapturePoint>(_entities[0].properties[7]);
|
||
|
|
||
|
/// See [CapturePoint.millisecondsSinceEpoch].
|
||
|
static final millisecondsSinceEpoch =
|
||
|
obx.QueryIntegerProperty<CapturePoint>(_entities[0].properties[8]);
|
||
|
}
|