blob: 7b9757c7b53598f08ff4c67e9850c8ee568151e2 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen_dart.
// @dart = 2.12
library fidl_test_handles_async;
import 'dart:async' as $async;
import 'dart:core' hide Set;
import 'dart:developer';
import 'dart:typed_data';
import 'package:fidl/fidl.dart' as $fidl;
import 'package:meta/meta.dart';
import 'package:zircon/zircon.dart' as $zircon;
import 'package:fidl_fdf/fidl_async.dart' as lib$fdf;
import 'package:fidl_zx/fidl_async.dart' as lib$zx;
// ignore_for_file: always_specify_types
// ignore_for_file: avoid_positional_boolean_parameters
// ignore_for_file: avoid_returning_null
// ignore_for_file: cascade_invocations
// ignore_for_file: constant_identifier_names
// ignore_for_file: directives_ordering
// ignore_for_file: one_member_abstracts
// ignore_for_file: prefer_constructors_over_static_methods
// ignore_for_file: prefer_single_quotes
// ignore_for_file: public_member_api_docs
// ignore_for_file: unused_import
// ignore_for_file: unused_local_variable
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: library_prefixes
// ignore_for_file: prefer_typing_uninitialized_variables
// ignore_for_file: avoid_js_rounded_ints
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: prefer_generic_function_type_aliases
// ignore_for_file: prefer_equal_for_default_values
// ignore_for_file: avoid_catches_without_on_clauses
// ignore_for_file: unused_shown_name
// ignore_for_file: unnecessary_lambdas
// ignore_for_file: comment_references
// ignore_for_file: avoid_unused_constructor_parameters
// ignore_for_file: prefer_interpolation_to_compose_strings
class Handles extends $fidl.Struct {
const Handles({
required this.plainHandle,
required this.btiHandle,
required this.channelHandle,
required this.clockHandle,
required this.debuglogHandle,
required this.eventHandle,
required this.eventpairHandle,
required this.exceptionHandle,
required this.fifoHandle,
required this.guestHandle,
required this.interruptHandle,
required this.iommuHandle,
required this.jobHandle,
required this.pagerHandle,
required this.pmtHandle,
required this.portHandle,
required this.processHandle,
required this.profileHandle,
required this.resourceHandle,
required this.socketHandle,
required this.suspendtokenHandle,
required this.threadHandle,
required this.timerHandle,
required this.vcpuHandle,
required this.vmarHandle,
required this.vmoHandle,
required this.rightsHandle,
required this.aliasedPlainHandleField,
required this.aliasedSubtypeHandleField,
required this.aliasedRightsHandleField,
required this.someProtocol,
required this.requestSomeProtocol,
});
Handles.clone(
Handles $orig, {
$zircon.Handle? plainHandle,
$zircon.Handle? btiHandle,
$zircon.Channel? channelHandle,
$zircon.Handle? clockHandle,
$zircon.Handle? debuglogHandle,
$zircon.Handle? eventHandle,
$zircon.EventPair? eventpairHandle,
$zircon.Handle? exceptionHandle,
$zircon.Handle? fifoHandle,
$zircon.Handle? guestHandle,
$zircon.Handle? interruptHandle,
$zircon.Handle? iommuHandle,
$zircon.Handle? jobHandle,
$zircon.Handle? pagerHandle,
$zircon.Handle? pmtHandle,
$zircon.Handle? portHandle,
$zircon.Handle? processHandle,
$zircon.Handle? profileHandle,
$zircon.Handle? resourceHandle,
$zircon.Socket? socketHandle,
$zircon.Handle? suspendtokenHandle,
$zircon.Handle? threadHandle,
$zircon.Handle? timerHandle,
$zircon.Handle? vcpuHandle,
$zircon.Handle? vmarHandle,
$zircon.Vmo? vmoHandle,
$zircon.Vmo? rightsHandle,
$zircon.Handle? aliasedPlainHandleField,
$zircon.Vmo? aliasedSubtypeHandleField,
$zircon.Vmo? aliasedRightsHandleField,
$fidl.InterfaceHandle<SomeProtocol>? someProtocol,
$fidl.InterfaceRequest<SomeProtocol>? requestSomeProtocol,
}) : this(
plainHandle: plainHandle ?? $orig.plainHandle,
btiHandle: btiHandle ?? $orig.btiHandle,
channelHandle: channelHandle ?? $orig.channelHandle,
clockHandle: clockHandle ?? $orig.clockHandle,
debuglogHandle: debuglogHandle ?? $orig.debuglogHandle,
eventHandle: eventHandle ?? $orig.eventHandle,
eventpairHandle: eventpairHandle ?? $orig.eventpairHandle,
exceptionHandle: exceptionHandle ?? $orig.exceptionHandle,
fifoHandle: fifoHandle ?? $orig.fifoHandle,
guestHandle: guestHandle ?? $orig.guestHandle,
interruptHandle: interruptHandle ?? $orig.interruptHandle,
iommuHandle: iommuHandle ?? $orig.iommuHandle,
jobHandle: jobHandle ?? $orig.jobHandle,
pagerHandle: pagerHandle ?? $orig.pagerHandle,
pmtHandle: pmtHandle ?? $orig.pmtHandle,
portHandle: portHandle ?? $orig.portHandle,
processHandle: processHandle ?? $orig.processHandle,
profileHandle: profileHandle ?? $orig.profileHandle,
resourceHandle: resourceHandle ?? $orig.resourceHandle,
socketHandle: socketHandle ?? $orig.socketHandle,
suspendtokenHandle: suspendtokenHandle ?? $orig.suspendtokenHandle,
threadHandle: threadHandle ?? $orig.threadHandle,
timerHandle: timerHandle ?? $orig.timerHandle,
vcpuHandle: vcpuHandle ?? $orig.vcpuHandle,
vmarHandle: vmarHandle ?? $orig.vmarHandle,
vmoHandle: vmoHandle ?? $orig.vmoHandle,
rightsHandle: rightsHandle ?? $orig.rightsHandle,
aliasedPlainHandleField:
aliasedPlainHandleField ?? $orig.aliasedPlainHandleField,
aliasedSubtypeHandleField:
aliasedSubtypeHandleField ?? $orig.aliasedSubtypeHandleField,
aliasedRightsHandleField:
aliasedRightsHandleField ?? $orig.aliasedRightsHandleField,
someProtocol: someProtocol ?? $orig.someProtocol,
requestSomeProtocol: requestSomeProtocol ?? $orig.requestSomeProtocol,
);
Handles $cloneWith({
$zircon.Handle? plainHandle,
$zircon.Handle? btiHandle,
$zircon.Channel? channelHandle,
$zircon.Handle? clockHandle,
$zircon.Handle? debuglogHandle,
$zircon.Handle? eventHandle,
$zircon.EventPair? eventpairHandle,
$zircon.Handle? exceptionHandle,
$zircon.Handle? fifoHandle,
$zircon.Handle? guestHandle,
$zircon.Handle? interruptHandle,
$zircon.Handle? iommuHandle,
$zircon.Handle? jobHandle,
$zircon.Handle? pagerHandle,
$zircon.Handle? pmtHandle,
$zircon.Handle? portHandle,
$zircon.Handle? processHandle,
$zircon.Handle? profileHandle,
$zircon.Handle? resourceHandle,
$zircon.Socket? socketHandle,
$zircon.Handle? suspendtokenHandle,
$zircon.Handle? threadHandle,
$zircon.Handle? timerHandle,
$zircon.Handle? vcpuHandle,
$zircon.Handle? vmarHandle,
$zircon.Vmo? vmoHandle,
$zircon.Vmo? rightsHandle,
$zircon.Handle? aliasedPlainHandleField,
$zircon.Vmo? aliasedSubtypeHandleField,
$zircon.Vmo? aliasedRightsHandleField,
$fidl.InterfaceHandle<SomeProtocol>? someProtocol,
$fidl.InterfaceRequest<SomeProtocol>? requestSomeProtocol,
}) {
return Handles(
plainHandle: plainHandle ?? this.plainHandle,
btiHandle: btiHandle ?? this.btiHandle,
channelHandle: channelHandle ?? this.channelHandle,
clockHandle: clockHandle ?? this.clockHandle,
debuglogHandle: debuglogHandle ?? this.debuglogHandle,
eventHandle: eventHandle ?? this.eventHandle,
eventpairHandle: eventpairHandle ?? this.eventpairHandle,
exceptionHandle: exceptionHandle ?? this.exceptionHandle,
fifoHandle: fifoHandle ?? this.fifoHandle,
guestHandle: guestHandle ?? this.guestHandle,
interruptHandle: interruptHandle ?? this.interruptHandle,
iommuHandle: iommuHandle ?? this.iommuHandle,
jobHandle: jobHandle ?? this.jobHandle,
pagerHandle: pagerHandle ?? this.pagerHandle,
pmtHandle: pmtHandle ?? this.pmtHandle,
portHandle: portHandle ?? this.portHandle,
processHandle: processHandle ?? this.processHandle,
profileHandle: profileHandle ?? this.profileHandle,
resourceHandle: resourceHandle ?? this.resourceHandle,
socketHandle: socketHandle ?? this.socketHandle,
suspendtokenHandle: suspendtokenHandle ?? this.suspendtokenHandle,
threadHandle: threadHandle ?? this.threadHandle,
timerHandle: timerHandle ?? this.timerHandle,
vcpuHandle: vcpuHandle ?? this.vcpuHandle,
vmarHandle: vmarHandle ?? this.vmarHandle,
vmoHandle: vmoHandle ?? this.vmoHandle,
rightsHandle: rightsHandle ?? this.rightsHandle,
aliasedPlainHandleField:
aliasedPlainHandleField ?? this.aliasedPlainHandleField,
aliasedSubtypeHandleField:
aliasedSubtypeHandleField ?? this.aliasedSubtypeHandleField,
aliasedRightsHandleField:
aliasedRightsHandleField ?? this.aliasedRightsHandleField,
someProtocol: someProtocol ?? this.someProtocol,
requestSomeProtocol: requestSomeProtocol ?? this.requestSomeProtocol,
);
}
final $zircon.Handle plainHandle;
final $zircon.Handle btiHandle;
final $zircon.Channel channelHandle;
final $zircon.Handle clockHandle;
final $zircon.Handle debuglogHandle;
final $zircon.Handle eventHandle;
final $zircon.EventPair eventpairHandle;
final $zircon.Handle exceptionHandle;
final $zircon.Handle fifoHandle;
final $zircon.Handle guestHandle;
final $zircon.Handle interruptHandle;
final $zircon.Handle iommuHandle;
final $zircon.Handle jobHandle;
final $zircon.Handle pagerHandle;
final $zircon.Handle pmtHandle;
final $zircon.Handle portHandle;
final $zircon.Handle processHandle;
final $zircon.Handle profileHandle;
final $zircon.Handle resourceHandle;
final $zircon.Socket socketHandle;
final $zircon.Handle suspendtokenHandle;
final $zircon.Handle threadHandle;
final $zircon.Handle timerHandle;
final $zircon.Handle vcpuHandle;
final $zircon.Handle vmarHandle;
final $zircon.Vmo vmoHandle;
final $zircon.Vmo rightsHandle;
final $zircon.Handle aliasedPlainHandleField;
final $zircon.Vmo aliasedSubtypeHandleField;
final $zircon.Vmo aliasedRightsHandleField;
final $fidl.InterfaceHandle<SomeProtocol> someProtocol;
final $fidl.InterfaceRequest<SomeProtocol> requestSomeProtocol;
@override
List<Object?> get $fields {
return <Object?>[
plainHandle,
btiHandle,
channelHandle,
clockHandle,
debuglogHandle,
eventHandle,
eventpairHandle,
exceptionHandle,
fifoHandle,
guestHandle,
interruptHandle,
iommuHandle,
jobHandle,
pagerHandle,
pmtHandle,
portHandle,
processHandle,
profileHandle,
resourceHandle,
socketHandle,
suspendtokenHandle,
threadHandle,
timerHandle,
vcpuHandle,
vmarHandle,
vmoHandle,
rightsHandle,
aliasedPlainHandleField,
aliasedSubtypeHandleField,
aliasedRightsHandleField,
someProtocol,
requestSomeProtocol,
];
}
static const $fieldType0 =
$fidl.HandleType(objectType: 0, rights: 2147483648);
static const $fieldType1 =
$fidl.HandleType(objectType: 24, rights: 2147483648);
static const $fieldType2 =
$fidl.ChannelType(objectType: 4, rights: 2147483648);
static const $fieldType3 =
$fidl.HandleType(objectType: 30, rights: 2147483648);
static const $fieldType4 =
$fidl.HandleType(objectType: 12, rights: 2147483648);
static const $fieldType5 =
$fidl.HandleType(objectType: 5, rights: 2147483648);
static const $fieldType6 =
$fidl.EventPairType(objectType: 16, rights: 2147483648);
static const $fieldType7 =
$fidl.HandleType(objectType: 29, rights: 2147483648);
static const $fieldType8 =
$fidl.HandleType(objectType: 19, rights: 2147483648);
static const $fieldType9 =
$fidl.HandleType(objectType: 20, rights: 2147483648);
static const $fieldType10 =
$fidl.HandleType(objectType: 9, rights: 2147483648);
static const $fieldType11 =
$fidl.HandleType(objectType: 23, rights: 2147483648);
static const $fieldType12 =
$fidl.HandleType(objectType: 17, rights: 2147483648);
static const $fieldType13 =
$fidl.HandleType(objectType: 28, rights: 2147483648);
static const $fieldType14 =
$fidl.HandleType(objectType: 26, rights: 2147483648);
static const $fieldType15 =
$fidl.HandleType(objectType: 6, rights: 2147483648);
static const $fieldType16 =
$fidl.HandleType(objectType: 1, rights: 2147483648);
static const $fieldType17 =
$fidl.HandleType(objectType: 25, rights: 2147483648);
static const $fieldType18 =
$fidl.HandleType(objectType: 15, rights: 2147483648);
static const $fieldType19 =
$fidl.SocketType(objectType: 14, rights: 2147483648);
static const $fieldType20 =
$fidl.HandleType(objectType: 27, rights: 2147483648);
static const $fieldType21 =
$fidl.HandleType(objectType: 2, rights: 2147483648);
static const $fieldType22 =
$fidl.HandleType(objectType: 22, rights: 2147483648);
static const $fieldType23 =
$fidl.HandleType(objectType: 21, rights: 2147483648);
static const $fieldType24 =
$fidl.HandleType(objectType: 18, rights: 2147483648);
static const $fieldType25 = $fidl.VmoType(objectType: 3, rights: 2147483648);
static const $fieldType26 = $fidl.VmoType(objectType: 3, rights: 5);
static const $fieldType27 =
$fidl.HandleType(objectType: 0, rights: 2147483648);
static const $fieldType28 = $fidl.VmoType(objectType: 3, rights: 2147483648);
static const $fieldType29 = $fidl.VmoType(objectType: 3, rights: 1);
static const $fieldType30 = $fidl.InterfaceHandleType<SomeProtocol>();
static const $fieldType31 = $fidl.InterfaceRequestType<SomeProtocol>();
@override
void $encode($fidl.Encoder $encoder, int $offset, int $depth) {
$fieldType0.encode($encoder, plainHandle, $offset + 0, $depth);
$fieldType1.encode($encoder, btiHandle, $offset + 4, $depth);
$fieldType2.encode($encoder, channelHandle, $offset + 8, $depth);
$fieldType3.encode($encoder, clockHandle, $offset + 12, $depth);
$fieldType4.encode($encoder, debuglogHandle, $offset + 16, $depth);
$fieldType5.encode($encoder, eventHandle, $offset + 20, $depth);
$fieldType6.encode($encoder, eventpairHandle, $offset + 24, $depth);
$fieldType7.encode($encoder, exceptionHandle, $offset + 28, $depth);
$fieldType8.encode($encoder, fifoHandle, $offset + 32, $depth);
$fieldType9.encode($encoder, guestHandle, $offset + 36, $depth);
$fieldType10.encode($encoder, interruptHandle, $offset + 40, $depth);
$fieldType11.encode($encoder, iommuHandle, $offset + 44, $depth);
$fieldType12.encode($encoder, jobHandle, $offset + 48, $depth);
$fieldType13.encode($encoder, pagerHandle, $offset + 52, $depth);
$fieldType14.encode($encoder, pmtHandle, $offset + 56, $depth);
$fieldType15.encode($encoder, portHandle, $offset + 60, $depth);
$fieldType16.encode($encoder, processHandle, $offset + 64, $depth);
$fieldType17.encode($encoder, profileHandle, $offset + 68, $depth);
$fieldType18.encode($encoder, resourceHandle, $offset + 72, $depth);
$fieldType19.encode($encoder, socketHandle, $offset + 76, $depth);
$fieldType20.encode($encoder, suspendtokenHandle, $offset + 80, $depth);
$fieldType21.encode($encoder, threadHandle, $offset + 84, $depth);
$fieldType22.encode($encoder, timerHandle, $offset + 88, $depth);
$fieldType23.encode($encoder, vcpuHandle, $offset + 92, $depth);
$fieldType24.encode($encoder, vmarHandle, $offset + 96, $depth);
$fieldType25.encode($encoder, vmoHandle, $offset + 100, $depth);
$fieldType26.encode($encoder, rightsHandle, $offset + 104, $depth);
$fieldType27.encode(
$encoder, aliasedPlainHandleField, $offset + 108, $depth);
$fieldType28.encode(
$encoder, aliasedSubtypeHandleField, $offset + 112, $depth);
$fieldType29.encode(
$encoder, aliasedRightsHandleField, $offset + 116, $depth);
$fieldType30.encode($encoder, someProtocol, $offset + 120, $depth);
$fieldType31.encode($encoder, requestSomeProtocol, $offset + 124, $depth);
}
static Handles _structDecode(
$fidl.Decoder $decoder, int $offset, int $depth) {
switch ($decoder.wireFormat) {
case $fidl.WireFormat.v1:
case $fidl.WireFormat.v2:
return Handles(
plainHandle: $fieldType0.decode($decoder, $offset + 0, $depth),
btiHandle: $fieldType1.decode($decoder, $offset + 4, $depth),
channelHandle: $fieldType2.decode($decoder, $offset + 8, $depth),
clockHandle: $fieldType3.decode($decoder, $offset + 12, $depth),
debuglogHandle: $fieldType4.decode($decoder, $offset + 16, $depth),
eventHandle: $fieldType5.decode($decoder, $offset + 20, $depth),
eventpairHandle: $fieldType6.decode($decoder, $offset + 24, $depth),
exceptionHandle: $fieldType7.decode($decoder, $offset + 28, $depth),
fifoHandle: $fieldType8.decode($decoder, $offset + 32, $depth),
guestHandle: $fieldType9.decode($decoder, $offset + 36, $depth),
interruptHandle:
$fieldType10.decode($decoder, $offset + 40, $depth),
iommuHandle: $fieldType11.decode($decoder, $offset + 44, $depth),
jobHandle: $fieldType12.decode($decoder, $offset + 48, $depth),
pagerHandle: $fieldType13.decode($decoder, $offset + 52, $depth),
pmtHandle: $fieldType14.decode($decoder, $offset + 56, $depth),
portHandle: $fieldType15.decode($decoder, $offset + 60, $depth),
processHandle: $fieldType16.decode($decoder, $offset + 64, $depth),
profileHandle: $fieldType17.decode($decoder, $offset + 68, $depth),
resourceHandle: $fieldType18.decode($decoder, $offset + 72, $depth),
socketHandle: $fieldType19.decode($decoder, $offset + 76, $depth),
suspendtokenHandle:
$fieldType20.decode($decoder, $offset + 80, $depth),
threadHandle: $fieldType21.decode($decoder, $offset + 84, $depth),
timerHandle: $fieldType22.decode($decoder, $offset + 88, $depth),
vcpuHandle: $fieldType23.decode($decoder, $offset + 92, $depth),
vmarHandle: $fieldType24.decode($decoder, $offset + 96, $depth),
vmoHandle: $fieldType25.decode($decoder, $offset + 100, $depth),
rightsHandle: $fieldType26.decode($decoder, $offset + 104, $depth),
aliasedPlainHandleField:
$fieldType27.decode($decoder, $offset + 108, $depth),
aliasedSubtypeHandleField:
$fieldType28.decode($decoder, $offset + 112, $depth),
aliasedRightsHandleField:
$fieldType29.decode($decoder, $offset + 116, $depth),
someProtocol: $fieldType30.decode($decoder, $offset + 120, $depth),
requestSomeProtocol:
$fieldType31.decode($decoder, $offset + 124, $depth));
default:
throw $fidl.FidlError('unknown wire format');
}
}
}
// See fxbug.dev/7644:
// ignore: recursive_compile_time_constant
const $fidl.StructType<Handles> kHandles_Type = $fidl.StructType<Handles>(
inlineSize: 128, structDecode: Handles._structDecode);
abstract class SomeProtocol {
$fidl.ServiceData? get $serviceData => SomeProtocolData();
} // TODO: Remove ServiceData for non-service
class SomeProtocolData implements $fidl.ServiceData<SomeProtocol> {
const SomeProtocolData();
@override
String getName() {
return "";
}
@override
$fidl.AsyncBinding getBinding() {
return SomeProtocolBinding();
}
}
class SomeProtocolProxy extends $fidl.AsyncProxy<SomeProtocol>
implements SomeProtocol {
SomeProtocolProxy()
: super($fidl.AsyncProxyController<SomeProtocol>(
$interfaceName: r'SomeProtocol')) {
ctrl.onResponse = _handleResponse;
}
@override
Null get $serviceData => null;
void _handleEvent($fidl.IncomingMessage $message) {
switch ($message.ordinal) {
default:
ctrl.proxyError(
$fidl.FidlError('Unexpected message ordinal: ${$message.ordinal}'));
break;
}
}
void _handleResponse($fidl.IncomingMessage $message) {
final int $txid = $message.txid;
if ($txid == 0) {
_handleEvent($message);
return;
}
final $async.Completer? $completer = ctrl.getCompleter($txid);
if ($completer == null) {
$message.closeHandles();
return;
}
switch ($message.ordinal) {
default:
ctrl.proxyError(
$fidl.FidlError('Unexpected message ordinal: ${$message.ordinal}'));
break;
}
}
}
class SomeProtocolBinding extends $fidl.AsyncBinding<SomeProtocol> {
SomeProtocolBinding() : super(r"SomeProtocol");
@override
void handleMessage(
$fidl.IncomingMessage $message, $fidl.OutgoingMessageSink $respond) {
switch ($message.ordinal) {
default:
throw $fidl.FidlError(
r'Unexpected message name for SomeProtocolBinding');
}
}
}