| // WARNING: This file is machine generated by fidlgen. |
| |
| #include <test/unknowninteractions/cpp/fidl.h> |
| |
| #include "lib/fidl/cpp/internal/implementation.h" |
| |
| |
| // |
| // Domain objects definitions |
| // |
| namespace test { |
| namespace unknowninteractions { |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_StrictTwoWayErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsProtocol_StrictTwoWayErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_StrictTwoWayErr_ResponseTable; |
| |
| void UnknownInteractionsProtocol_StrictTwoWayErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocol_StrictTwoWayErr_Response>(_offset), this, sizeof(UnknownInteractionsProtocol_StrictTwoWayErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocol_StrictTwoWayErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_StrictTwoWayErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocol_StrictTwoWayErr_Response>(_offset), sizeof(UnknownInteractionsProtocol_StrictTwoWayErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_StrictTwoWayErr_Response::Clone(UnknownInteractionsProtocol_StrictTwoWayErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_StrictTwoWayErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsProtocol_StrictTwoWayErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_StrictTwoWayErr_ResultTable; |
| |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result::UnknownInteractionsProtocol_StrictTwoWayErr_Result() {} |
| |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result::~UnknownInteractionsProtocol_StrictTwoWayErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result::UnknownInteractionsProtocol_StrictTwoWayErr_Result(UnknownInteractionsProtocol_StrictTwoWayErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result& UnknownInteractionsProtocol_StrictTwoWayErr_Result::operator=(UnknownInteractionsProtocol_StrictTwoWayErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result UnknownInteractionsProtocol_StrictTwoWayErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Response&& val) { |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result UnknownInteractionsProtocol_StrictTwoWayErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsProtocol_StrictTwoWayErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsProtocol_StrictTwoWayErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_StrictTwoWayErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_StrictTwoWayErr_Result::Clone(UnknownInteractionsProtocol_StrictTwoWayErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result& UnknownInteractionsProtocol_StrictTwoWayErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_StrictTwoWayErr_Result& UnknownInteractionsProtocol_StrictTwoWayErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsProtocol_StrictTwoWayErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsProtocol_StrictTwoWayErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolStrictTwoWayErrTopResponseTable; |
| const fidl_type_t* UnknownInteractionsProtocolStrictTwoWayErrTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsProtocolStrictTwoWayErrTopResponseTable; |
| |
| void UnknownInteractionsProtocolStrictTwoWayErrTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocolStrictTwoWayErrTopResponse>(_offset), this, sizeof(UnknownInteractionsProtocolStrictTwoWayErrTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocolStrictTwoWayErrTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocolStrictTwoWayErrTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocolStrictTwoWayErrTopResponse>(_offset), sizeof(UnknownInteractionsProtocolStrictTwoWayErrTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocolStrictTwoWayErrTopResponse::Clone(UnknownInteractionsProtocolStrictTwoWayErrTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_StrictEventErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsProtocol_StrictEventErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_StrictEventErr_ResponseTable; |
| |
| void UnknownInteractionsProtocol_StrictEventErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_StrictEventErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocol_StrictEventErr_Response>(_offset), this, sizeof(UnknownInteractionsProtocol_StrictEventErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocol_StrictEventErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_StrictEventErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_StrictEventErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocol_StrictEventErr_Response>(_offset), sizeof(UnknownInteractionsProtocol_StrictEventErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_StrictEventErr_Response::Clone(UnknownInteractionsProtocol_StrictEventErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_StrictEventErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsProtocol_StrictEventErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_StrictEventErr_ResultTable; |
| |
| UnknownInteractionsProtocol_StrictEventErr_Result::UnknownInteractionsProtocol_StrictEventErr_Result() {} |
| |
| UnknownInteractionsProtocol_StrictEventErr_Result::~UnknownInteractionsProtocol_StrictEventErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsProtocol_StrictEventErr_Result::UnknownInteractionsProtocol_StrictEventErr_Result(UnknownInteractionsProtocol_StrictEventErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsProtocol_StrictEventErr_Result& UnknownInteractionsProtocol_StrictEventErr_Result::operator=(UnknownInteractionsProtocol_StrictEventErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_StrictEventErr_Result UnknownInteractionsProtocol_StrictEventErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Response&& val) { |
| UnknownInteractionsProtocol_StrictEventErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsProtocol_StrictEventErr_Result UnknownInteractionsProtocol_StrictEventErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsProtocol_StrictEventErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsProtocol_StrictEventErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsProtocol_StrictEventErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_StrictEventErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_StrictEventErr_Result::Clone(UnknownInteractionsProtocol_StrictEventErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsProtocol_StrictEventErr_Result& UnknownInteractionsProtocol_StrictEventErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_StrictEventErr_Result& UnknownInteractionsProtocol_StrictEventErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsProtocol_StrictEventErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsProtocol_StrictEventErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolStrictEventErrRequestTable; |
| const fidl_type_t* UnknownInteractionsProtocolStrictEventErrRequest::FidlType = &test_unknowninteractions_UnknownInteractionsProtocolStrictEventErrRequestTable; |
| |
| void UnknownInteractionsProtocolStrictEventErrRequest::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolStrictEventErrRequest>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocolStrictEventErrRequest>(_offset), this, sizeof(UnknownInteractionsProtocolStrictEventErrRequest)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocolStrictEventErrRequest::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocolStrictEventErrRequest* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolStrictEventErrRequest>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocolStrictEventErrRequest>(_offset), sizeof(UnknownInteractionsProtocolStrictEventErrRequest)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocolStrictEventErrRequest::Clone(UnknownInteractionsProtocolStrictEventErrRequest* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_FlexibleTwoWay_ResponseTable; |
| const fidl_type_t* UnknownInteractionsProtocol_FlexibleTwoWay_Response::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_FlexibleTwoWay_ResponseTable; |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWay_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_FlexibleTwoWay_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocol_FlexibleTwoWay_Response>(_offset), this, sizeof(UnknownInteractionsProtocol_FlexibleTwoWay_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWay_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_FlexibleTwoWay_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_FlexibleTwoWay_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocol_FlexibleTwoWay_Response>(_offset), sizeof(UnknownInteractionsProtocol_FlexibleTwoWay_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_FlexibleTwoWay_Response::Clone(UnknownInteractionsProtocol_FlexibleTwoWay_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_FlexibleTwoWay_ResultTable; |
| const fidl_type_t* UnknownInteractionsProtocol_FlexibleTwoWay_Result::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_FlexibleTwoWay_ResultTable; |
| |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result::UnknownInteractionsProtocol_FlexibleTwoWay_Result() {} |
| |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result::~UnknownInteractionsProtocol_FlexibleTwoWay_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result::UnknownInteractionsProtocol_FlexibleTwoWay_Result(UnknownInteractionsProtocol_FlexibleTwoWay_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| transport_err_ = std::move(other.transport_err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result& UnknownInteractionsProtocol_FlexibleTwoWay_Result::operator=(UnknownInteractionsProtocol_FlexibleTwoWay_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| transport_err_ = std::move(other.transport_err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result UnknownInteractionsProtocol_FlexibleTwoWay_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Response&& val) { |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result UnknownInteractionsProtocol_FlexibleTwoWay_Result::WithTransportErr(int32_t&& val) { |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result result; |
| result.set_transport_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWay_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &transport_err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &transport_err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWay_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_FlexibleTwoWay_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: { |
| ::fidl::Decode(_decoder, &value->transport_err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_FlexibleTwoWay_Result::Clone(UnknownInteractionsProtocol_FlexibleTwoWay_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| return ::fidl::Clone(transport_err_, &result->transport_err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result& UnknownInteractionsProtocol_FlexibleTwoWay_Result::set_response(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWay_Result& UnknownInteractionsProtocol_FlexibleTwoWay_Result::set_transport_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kTransportErr); |
| transport_err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWay_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWay_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| new (&transport_err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayTopResponseTable; |
| const fidl_type_t* UnknownInteractionsProtocolFlexibleTwoWayTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayTopResponseTable; |
| |
| void UnknownInteractionsProtocolFlexibleTwoWayTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolFlexibleTwoWayTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocolFlexibleTwoWayTopResponse>(_offset), this, sizeof(UnknownInteractionsProtocolFlexibleTwoWayTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocolFlexibleTwoWayTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocolFlexibleTwoWayTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolFlexibleTwoWayTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocolFlexibleTwoWayTopResponse>(_offset), sizeof(UnknownInteractionsProtocolFlexibleTwoWayTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocolFlexibleTwoWayTopResponse::Clone(UnknownInteractionsProtocolFlexibleTwoWayTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_FlexibleTwoWayErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsProtocol_FlexibleTwoWayErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_FlexibleTwoWayErr_ResponseTable; |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWayErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_FlexibleTwoWayErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocol_FlexibleTwoWayErr_Response>(_offset), this, sizeof(UnknownInteractionsProtocol_FlexibleTwoWayErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWayErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_FlexibleTwoWayErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_FlexibleTwoWayErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocol_FlexibleTwoWayErr_Response>(_offset), sizeof(UnknownInteractionsProtocol_FlexibleTwoWayErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_FlexibleTwoWayErr_Response::Clone(UnknownInteractionsProtocol_FlexibleTwoWayErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_FlexibleTwoWayErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_FlexibleTwoWayErr_ResultTable; |
| |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result() {} |
| |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::~UnknownInteractionsProtocol_FlexibleTwoWayErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result(UnknownInteractionsProtocol_FlexibleTwoWayErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| transport_err_ = std::move(other.transport_err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result& UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::operator=(UnknownInteractionsProtocol_FlexibleTwoWayErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| transport_err_ = std::move(other.transport_err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Response&& val) { |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::WithTransportErr(int32_t&& val) { |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result result; |
| result.set_transport_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &transport_err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &transport_err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_FlexibleTwoWayErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: { |
| ::fidl::Decode(_decoder, &value->transport_err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Clone(UnknownInteractionsProtocol_FlexibleTwoWayErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| return ::fidl::Clone(transport_err_, &result->transport_err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result& UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result& UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Result& UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::set_transport_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr); |
| transport_err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| new (&transport_err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayErrTopResponseTable; |
| const fidl_type_t* UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayErrTopResponseTable; |
| |
| void UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse>(_offset), this, sizeof(UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse>(_offset), sizeof(UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse::Clone(UnknownInteractionsProtocolFlexibleTwoWayErrTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_FlexibleEventErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsProtocol_FlexibleEventErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_FlexibleEventErr_ResponseTable; |
| |
| void UnknownInteractionsProtocol_FlexibleEventErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_FlexibleEventErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocol_FlexibleEventErr_Response>(_offset), this, sizeof(UnknownInteractionsProtocol_FlexibleEventErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleEventErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_FlexibleEventErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocol_FlexibleEventErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocol_FlexibleEventErr_Response>(_offset), sizeof(UnknownInteractionsProtocol_FlexibleEventErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_FlexibleEventErr_Response::Clone(UnknownInteractionsProtocol_FlexibleEventErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocol_FlexibleEventErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsProtocol_FlexibleEventErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsProtocol_FlexibleEventErr_ResultTable; |
| |
| UnknownInteractionsProtocol_FlexibleEventErr_Result::UnknownInteractionsProtocol_FlexibleEventErr_Result() {} |
| |
| UnknownInteractionsProtocol_FlexibleEventErr_Result::~UnknownInteractionsProtocol_FlexibleEventErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsProtocol_FlexibleEventErr_Result::UnknownInteractionsProtocol_FlexibleEventErr_Result(UnknownInteractionsProtocol_FlexibleEventErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsProtocol_FlexibleEventErr_Result& UnknownInteractionsProtocol_FlexibleEventErr_Result::operator=(UnknownInteractionsProtocol_FlexibleEventErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_FlexibleEventErr_Result UnknownInteractionsProtocol_FlexibleEventErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Response&& val) { |
| UnknownInteractionsProtocol_FlexibleEventErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsProtocol_FlexibleEventErr_Result UnknownInteractionsProtocol_FlexibleEventErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsProtocol_FlexibleEventErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsProtocol_FlexibleEventErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleEventErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocol_FlexibleEventErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_FlexibleEventErr_Result::Clone(UnknownInteractionsProtocol_FlexibleEventErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsProtocol_FlexibleEventErr_Result& UnknownInteractionsProtocol_FlexibleEventErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsProtocol_FlexibleEventErr_Result& UnknownInteractionsProtocol_FlexibleEventErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleEventErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsProtocol_FlexibleEventErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolFlexibleEventErrRequestTable; |
| const fidl_type_t* UnknownInteractionsProtocolFlexibleEventErrRequest::FidlType = &test_unknowninteractions_UnknownInteractionsProtocolFlexibleEventErrRequestTable; |
| |
| void UnknownInteractionsProtocolFlexibleEventErrRequest::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolFlexibleEventErrRequest>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsProtocolFlexibleEventErrRequest>(_offset), this, sizeof(UnknownInteractionsProtocolFlexibleEventErrRequest)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsProtocolFlexibleEventErrRequest::Decode(::fidl::Decoder* _decoder, UnknownInteractionsProtocolFlexibleEventErrRequest* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsProtocolFlexibleEventErrRequest>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsProtocolFlexibleEventErrRequest>(_offset), sizeof(UnknownInteractionsProtocolFlexibleEventErrRequest)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsProtocolFlexibleEventErrRequest::Clone(UnknownInteractionsProtocolFlexibleEventErrRequest* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsDriverProtocol_StrictTwoWayErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsDriverProtocol_StrictTwoWayErr_ResponseTable; |
| |
| void UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response>(_offset), this, sizeof(UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response>(_offset), sizeof(UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response::Clone(UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsDriverProtocol_StrictTwoWayErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsDriverProtocol_StrictTwoWayErr_ResultTable; |
| |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result() {} |
| |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::~UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result(UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result& UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::operator=(UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response&& val) { |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Clone(UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result& UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result& UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponseTable; |
| const fidl_type_t* UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponseTable; |
| |
| void UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse>(_offset), this, sizeof(UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse>(_offset), sizeof(UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse::Clone(UnknownInteractionsDriverProtocolStrictTwoWayErrTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsDriverProtocol_FlexibleTwoWay_ResponseTable; |
| const fidl_type_t* UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response::FidlType = &test_unknowninteractions_UnknownInteractionsDriverProtocol_FlexibleTwoWay_ResponseTable; |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response>(_offset), this, sizeof(UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response>(_offset), sizeof(UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response::Clone(UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsDriverProtocol_FlexibleTwoWay_ResultTable; |
| const fidl_type_t* UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::FidlType = &test_unknowninteractions_UnknownInteractionsDriverProtocol_FlexibleTwoWay_ResultTable; |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result() {} |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::~UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result(UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| transport_err_ = std::move(other.transport_err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result& UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::operator=(UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| transport_err_ = std::move(other.transport_err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response&& val) { |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::WithTransportErr(int32_t&& val) { |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result result; |
| result.set_transport_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &transport_err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &transport_err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: { |
| ::fidl::Decode(_decoder, &value->transport_err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Clone(UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| return ::fidl::Clone(transport_err_, &result->transport_err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result& UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::set_response(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result& UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::set_transport_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kTransportErr); |
| transport_err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWay_Result::Tag::kTransportErr: |
| new (&transport_err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponseTable; |
| const fidl_type_t* UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponseTable; |
| |
| void UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse>(_offset), this, sizeof(UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse>(_offset), sizeof(UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse::Clone(UnknownInteractionsDriverProtocolFlexibleTwoWayTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_ResponseTable; |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response>(_offset), this, sizeof(UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response>(_offset), sizeof(UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response::Clone(UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_ResultTable; |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result() {} |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::~UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result(UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| transport_err_ = std::move(other.transport_err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result& UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::operator=(UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| transport_err_ = std::move(other.transport_err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response&& val) { |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::WithTransportErr(int32_t&& val) { |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result result; |
| result.set_transport_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &transport_err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &transport_err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: { |
| ::fidl::Decode(_decoder, &value->transport_err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Clone(UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| return ::fidl::Clone(transport_err_, &result->transport_err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result& UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result& UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result& UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::set_transport_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr); |
| transport_err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsDriverProtocol_FlexibleTwoWayErr_Result::Tag::kTransportErr: |
| new (&transport_err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponseTable; |
| const fidl_type_t* UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponseTable; |
| |
| void UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse>(_offset), this, sizeof(UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse>(_offset), sizeof(UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse::Clone(UnknownInteractionsDriverProtocolFlexibleTwoWayErrTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedProtocol_StrictTwoWayErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsClosedProtocol_StrictTwoWayErr_ResponseTable; |
| |
| void UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response>(_offset), this, sizeof(UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response>(_offset), sizeof(UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response::Clone(UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedProtocol_StrictTwoWayErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsClosedProtocol_StrictTwoWayErr_ResultTable; |
| |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result() {} |
| |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::~UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result(UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result& UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::operator=(UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response&& val) { |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Clone(UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result& UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result& UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponseTable; |
| const fidl_type_t* UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponseTable; |
| |
| void UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse>(_offset), this, sizeof(UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse>(_offset), sizeof(UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse::Clone(UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedProtocol_StrictEventErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsClosedProtocol_StrictEventErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsClosedProtocol_StrictEventErr_ResponseTable; |
| |
| void UnknownInteractionsClosedProtocol_StrictEventErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedProtocol_StrictEventErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsClosedProtocol_StrictEventErr_Response>(_offset), this, sizeof(UnknownInteractionsClosedProtocol_StrictEventErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsClosedProtocol_StrictEventErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsClosedProtocol_StrictEventErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedProtocol_StrictEventErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsClosedProtocol_StrictEventErr_Response>(_offset), sizeof(UnknownInteractionsClosedProtocol_StrictEventErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsClosedProtocol_StrictEventErr_Response::Clone(UnknownInteractionsClosedProtocol_StrictEventErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedProtocol_StrictEventErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsClosedProtocol_StrictEventErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsClosedProtocol_StrictEventErr_ResultTable; |
| |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result::UnknownInteractionsClosedProtocol_StrictEventErr_Result() {} |
| |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result::~UnknownInteractionsClosedProtocol_StrictEventErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result::UnknownInteractionsClosedProtocol_StrictEventErr_Result(UnknownInteractionsClosedProtocol_StrictEventErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result& UnknownInteractionsClosedProtocol_StrictEventErr_Result::operator=(UnknownInteractionsClosedProtocol_StrictEventErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result UnknownInteractionsClosedProtocol_StrictEventErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Response&& val) { |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result UnknownInteractionsClosedProtocol_StrictEventErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsClosedProtocol_StrictEventErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsClosedProtocol_StrictEventErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsClosedProtocol_StrictEventErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsClosedProtocol_StrictEventErr_Result::Clone(UnknownInteractionsClosedProtocol_StrictEventErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result& UnknownInteractionsClosedProtocol_StrictEventErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsClosedProtocol_StrictEventErr_Result& UnknownInteractionsClosedProtocol_StrictEventErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsClosedProtocol_StrictEventErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsClosedProtocol_StrictEventErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedProtocolStrictEventErrRequestTable; |
| const fidl_type_t* UnknownInteractionsClosedProtocolStrictEventErrRequest::FidlType = &test_unknowninteractions_UnknownInteractionsClosedProtocolStrictEventErrRequestTable; |
| |
| void UnknownInteractionsClosedProtocolStrictEventErrRequest::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedProtocolStrictEventErrRequest>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsClosedProtocolStrictEventErrRequest>(_offset), this, sizeof(UnknownInteractionsClosedProtocolStrictEventErrRequest)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsClosedProtocolStrictEventErrRequest::Decode(::fidl::Decoder* _decoder, UnknownInteractionsClosedProtocolStrictEventErrRequest* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedProtocolStrictEventErrRequest>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsClosedProtocolStrictEventErrRequest>(_offset), sizeof(UnknownInteractionsClosedProtocolStrictEventErrRequest)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsClosedProtocolStrictEventErrRequest::Clone(UnknownInteractionsClosedProtocolStrictEventErrRequest* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_ResponseTable; |
| |
| void UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response>(_offset), this, sizeof(UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response>(_offset), sizeof(UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response::Clone(UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_ResultTable; |
| |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result() {} |
| |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::~UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result(UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result& UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::operator=(UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response&& val) { |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Clone(UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result& UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result& UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsClosedDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponseTable; |
| const fidl_type_t* UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponseTable; |
| |
| void UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse>(_offset), this, sizeof(UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse>(_offset), sizeof(UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse::Clone(UnknownInteractionsClosedDriverProtocolStrictTwoWayErrTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocol_StrictTwoWayErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsAjarProtocol_StrictTwoWayErr_ResponseTable; |
| |
| void UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response>(_offset), this, sizeof(UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response>(_offset), sizeof(UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response::Clone(UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocol_StrictTwoWayErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsAjarProtocol_StrictTwoWayErr_ResultTable; |
| |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result() {} |
| |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::~UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result(UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result& UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::operator=(UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response&& val) { |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Clone(UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result& UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result& UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponseTable; |
| const fidl_type_t* UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponseTable; |
| |
| void UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse>(_offset), this, sizeof(UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse>(_offset), sizeof(UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse::Clone(UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocol_StrictEventErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsAjarProtocol_StrictEventErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsAjarProtocol_StrictEventErr_ResponseTable; |
| |
| void UnknownInteractionsAjarProtocol_StrictEventErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocol_StrictEventErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsAjarProtocol_StrictEventErr_Response>(_offset), this, sizeof(UnknownInteractionsAjarProtocol_StrictEventErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsAjarProtocol_StrictEventErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarProtocol_StrictEventErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocol_StrictEventErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsAjarProtocol_StrictEventErr_Response>(_offset), sizeof(UnknownInteractionsAjarProtocol_StrictEventErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocol_StrictEventErr_Response::Clone(UnknownInteractionsAjarProtocol_StrictEventErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocol_StrictEventErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsAjarProtocol_StrictEventErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsAjarProtocol_StrictEventErr_ResultTable; |
| |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result::UnknownInteractionsAjarProtocol_StrictEventErr_Result() {} |
| |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result::~UnknownInteractionsAjarProtocol_StrictEventErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result::UnknownInteractionsAjarProtocol_StrictEventErr_Result(UnknownInteractionsAjarProtocol_StrictEventErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result& UnknownInteractionsAjarProtocol_StrictEventErr_Result::operator=(UnknownInteractionsAjarProtocol_StrictEventErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result UnknownInteractionsAjarProtocol_StrictEventErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Response&& val) { |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result UnknownInteractionsAjarProtocol_StrictEventErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsAjarProtocol_StrictEventErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsAjarProtocol_StrictEventErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarProtocol_StrictEventErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocol_StrictEventErr_Result::Clone(UnknownInteractionsAjarProtocol_StrictEventErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result& UnknownInteractionsAjarProtocol_StrictEventErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsAjarProtocol_StrictEventErr_Result& UnknownInteractionsAjarProtocol_StrictEventErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsAjarProtocol_StrictEventErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsAjarProtocol_StrictEventErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocolStrictEventErrRequestTable; |
| const fidl_type_t* UnknownInteractionsAjarProtocolStrictEventErrRequest::FidlType = &test_unknowninteractions_UnknownInteractionsAjarProtocolStrictEventErrRequestTable; |
| |
| void UnknownInteractionsAjarProtocolStrictEventErrRequest::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocolStrictEventErrRequest>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsAjarProtocolStrictEventErrRequest>(_offset), this, sizeof(UnknownInteractionsAjarProtocolStrictEventErrRequest)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsAjarProtocolStrictEventErrRequest::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarProtocolStrictEventErrRequest* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocolStrictEventErrRequest>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsAjarProtocolStrictEventErrRequest>(_offset), sizeof(UnknownInteractionsAjarProtocolStrictEventErrRequest)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocolStrictEventErrRequest::Clone(UnknownInteractionsAjarProtocolStrictEventErrRequest* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocol_FlexibleEventErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsAjarProtocol_FlexibleEventErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsAjarProtocol_FlexibleEventErr_ResponseTable; |
| |
| void UnknownInteractionsAjarProtocol_FlexibleEventErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocol_FlexibleEventErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsAjarProtocol_FlexibleEventErr_Response>(_offset), this, sizeof(UnknownInteractionsAjarProtocol_FlexibleEventErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsAjarProtocol_FlexibleEventErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarProtocol_FlexibleEventErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocol_FlexibleEventErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsAjarProtocol_FlexibleEventErr_Response>(_offset), sizeof(UnknownInteractionsAjarProtocol_FlexibleEventErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocol_FlexibleEventErr_Response::Clone(UnknownInteractionsAjarProtocol_FlexibleEventErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocol_FlexibleEventErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsAjarProtocol_FlexibleEventErr_ResultTable; |
| |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result() {} |
| |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::~UnknownInteractionsAjarProtocol_FlexibleEventErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result(UnknownInteractionsAjarProtocol_FlexibleEventErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result& UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::operator=(UnknownInteractionsAjarProtocol_FlexibleEventErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Response&& val) { |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarProtocol_FlexibleEventErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Clone(UnknownInteractionsAjarProtocol_FlexibleEventErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result& UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsAjarProtocol_FlexibleEventErr_Result& UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocolFlexibleEventErrRequestTable; |
| const fidl_type_t* UnknownInteractionsAjarProtocolFlexibleEventErrRequest::FidlType = &test_unknowninteractions_UnknownInteractionsAjarProtocolFlexibleEventErrRequestTable; |
| |
| void UnknownInteractionsAjarProtocolFlexibleEventErrRequest::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocolFlexibleEventErrRequest>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsAjarProtocolFlexibleEventErrRequest>(_offset), this, sizeof(UnknownInteractionsAjarProtocolFlexibleEventErrRequest)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsAjarProtocolFlexibleEventErrRequest::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarProtocolFlexibleEventErrRequest* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarProtocolFlexibleEventErrRequest>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsAjarProtocolFlexibleEventErrRequest>(_offset), sizeof(UnknownInteractionsAjarProtocolFlexibleEventErrRequest)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocolFlexibleEventErrRequest::Clone(UnknownInteractionsAjarProtocolFlexibleEventErrRequest* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_ResponseTable; |
| const fidl_type_t* UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response::FidlType = &test_unknowninteractions_UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_ResponseTable; |
| |
| void UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response>(_offset), this, sizeof(UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response)); |
| } else {::fidl::Encode(_encoder, &__reserved, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response>(_offset), sizeof(UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->__reserved, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response::Clone(UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response* _result) const { |
| zx_status_t _status = ::fidl::Clone(__reserved, &_result->__reserved); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_ResultTable; |
| const fidl_type_t* UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::FidlType = &test_unknowninteractions_UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_ResultTable; |
| |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result() {} |
| |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::~UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result() { |
| Destroy(); |
| } |
| |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result(UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result&& other) : tag_(other.tag_) { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result& UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::operator=(UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result&& other) { |
| if (this != &other) { |
| Destroy(); |
| tag_ = other.tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response(); |
| response_ = std::move(other.response_); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| err_ = std::move(other.err_); |
| break; |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| } |
| } |
| return *this; |
| } |
| |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::WithResponse(::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response&& val) { |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::WithErr(int32_t&& val) { |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| |
| void UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Encode(::fidl::Encoder* encoder, size_t offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| const size_t length_before = encoder->CurrentLength(); |
| const size_t handles_before = encoder->CurrentHandleCount(); |
| |
| switch (Which()) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| if (::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &response_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &response_, |
| encoder->Alloc(::fidl::EncodingInlineSize<::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| if (::fidl::EncodingInlineSize<int32_t>(encoder) <= FIDL_ENVELOPE_INLINING_SIZE_THRESHOLD) { |
| ::fidl::Encode(encoder, &err_, offset + offsetof(fidl_xunion_v2_t, envelope)); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = FIDL_ENVELOPE_FLAGS_INLINING_MASK; |
| break; |
| } |
| |
| ::fidl::Encode( |
| encoder, |
| &err_, |
| encoder->Alloc(::fidl::EncodingInlineSize<int32_t, ::fidl::Encoder>(encoder))); |
| |
| fidl_xunion_v2_t* xunion = encoder->GetPtr<fidl_xunion_v2_t>(offset); |
| xunion->tag = tag_; |
| xunion->envelope.num_bytes = static_cast<uint32_t>(encoder->CurrentLength() - length_before); |
| xunion->envelope.num_handles = static_cast<uint16_t>(encoder->CurrentHandleCount() - handles_before); |
| xunion->envelope.flags = 0; |
| break; |
| } |
| default: |
| break; |
| } |
| } |
| |
| void UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result* value, size_t offset) { |
| fidl_xunion_v2_t* xunion = _decoder->GetPtr<fidl_xunion_v2_t>(offset); |
| |
| if (xunion->envelope.num_bytes == 0 && |
| xunion->envelope.num_handles == 0 && |
| xunion->envelope.flags == 0) { |
| value->EnsureStorageInitialized(static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid)); |
| return; |
| } |
| |
| value->EnsureStorageInitialized(xunion->tag); |
| |
| |
| size_t value_offset = _decoder->EnvelopeValueOffset(&xunion->envelope); |
| |
| switch (value->tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: { |
| new (&value->response_) ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response(); |
| ::fidl::Decode(_decoder, &value->response_, value_offset); |
| break; |
| } |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: { |
| ::fidl::Decode(_decoder, &value->err_, value_offset); |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| |
| } |
| |
| zx_status_t UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Clone(UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result* result) const { |
| result->Destroy(); |
| result->tag_ = tag_; |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid: |
| return ZX_OK; |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&result->response_) ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response(); |
| return ::fidl::Clone(response_, &result->response_); |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| return ::fidl::Clone(err_, &result->err_); |
| default:return ZX_OK; |
| } |
| } |
| |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result& UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::set_response(::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse); |
| response_ = std::move(value); |
| return *this; |
| } |
| |
| UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result& UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::set_err(int32_t value) { |
| EnsureStorageInitialized(::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kErr); |
| err_ = std::move(value); |
| return *this; |
| } |
| |
| void UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Destroy() { |
| switch (tag_) { |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| response_.~decltype(response_)(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| break; |
| |
| default: |
| break; |
| |
| } |
| tag_ = static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid); |
| } |
| |
| void UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::EnsureStorageInitialized(::fidl_xunion_tag_t tag) { |
| if (tag_ != tag) { |
| Destroy(); |
| tag_ = tag; |
| switch (tag_) { |
| case static_cast<fidl_xunion_tag_t>(::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::Invalid): |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kResponse: |
| new (&response_) ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Response(); |
| break; |
| case ::test::unknowninteractions::UnknownInteractionsAjarDriverProtocol_StrictTwoWayErr_Result::Tag::kErr: |
| new (&err_) int32_t(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| |
| extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponseTable; |
| const fidl_type_t* UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse::FidlType = &test_unknowninteractions_UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponseTable; |
| |
| void UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse::Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_encoder->template GetPtr<UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse>(_offset), this, sizeof(UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse)); |
| } else {::fidl::Encode(_encoder, &result, _offset + 0); |
| |
| } |
| } |
| |
| void UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse::Decode(::fidl::Decoder* _decoder, UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse* _value, size_t _offset) { |
| if (::fidl::IsMemcpyCompatible<UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse>::value) { |
| memcpy(_value, _decoder->template GetPtr<UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse>(_offset), sizeof(UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse)); |
| } else { |
| ::fidl::Decode(_decoder, &_value->result, _offset + 0); |
| } |
| } |
| |
| zx_status_t UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse::Clone(UnknownInteractionsAjarDriverProtocolStrictTwoWayErrTopResponse* _result) const { |
| zx_status_t _status = ::fidl::Clone(result, &_result->result); |
| if (_status != ZX_OK) |
| return _status; |
| return ZX_OK; |
| } |
| |
| // |
| // Proxies and stubs definitions |
| // |
| #ifdef __Fuchsia__ |
| |
| |
| |
| |
| |
| |
| |
| |
| namespace _internal {__LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolStrictTwoWayErrTopResponseTable; |
| |
| __LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayTopResponseTable; |
| |
| __LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayErrTopResponseTable; |
| |
| |
| |
| __LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolStrictEventErrRequestTable; |
| |
| |
| |
| __LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsProtocolFlexibleEventErrRequestTable; |
| |
| } // namespace _internal |
| UnknownInteractionsProtocol::~UnknownInteractionsProtocol() = default; |
| |
| const fidl_type_t* ::test::unknowninteractions::UnknownInteractionsProtocol_RequestDecoder::GetType(uint64_t ordinal, bool* out_needs_response) { |
| *out_needs_response = false; |
| switch (ordinal) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictOneWay_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleOneWay_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWay_Ordinal: |
| *out_needs_response = true; |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWayErr_Ordinal: |
| *out_needs_response = true; |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWay_Ordinal: |
| *out_needs_response = true; |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWayErr_Ordinal: |
| *out_needs_response = true; |
| return nullptr; |
| ; |
| default: |
| return nullptr; |
| } |
| } |
| |
| const fidl_type_t* UnknownInteractionsProtocol_ResponseDecoder::GetType(uint64_t ordinal) { |
| switch (ordinal) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWay_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWayErr_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolStrictTwoWayErrTopResponseTable; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWay_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayTopResponseTable; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWayErr_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayErrTopResponseTable; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictEvent_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictEventErr_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolStrictEventErrRequestTable; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleEvent_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleEventErr_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleEventErrRequestTable; |
| ; |
| default: |
| return nullptr; |
| } |
| } |
| |
| UnknownInteractionsProtocol_EventSender::~UnknownInteractionsProtocol_EventSender() = default; |
| |
| UnknownInteractionsProtocol_Sync::~UnknownInteractionsProtocol_Sync() = default; |
| |
| UnknownInteractionsProtocol_Proxy::UnknownInteractionsProtocol_Proxy(::fidl::internal::ProxyController* controller) |
| : controller_(controller) { |
| (void)controller_; |
| } |
| |
| UnknownInteractionsProtocol_Proxy::~UnknownInteractionsProtocol_Proxy() = default; |
| |
| zx_status_t UnknownInteractionsProtocol_Proxy::Dispatch_(::fidl::HLCPPIncomingMessage message) { |
| zx_status_t status = ZX_OK; |
| switch (message.ordinal()) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictEvent_Ordinal: { |
| if (!StrictEvent) { |
| status = ZX_OK; |
| break; |
| } |
| StrictEvent(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictEventErr_Ordinal: { |
| if (!StrictEventErr) { |
| status = ZX_OK; |
| break; |
| } |
| const char* error_msg = nullptr; |
| status = message.Decode(&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolStrictEventErrRequestTable, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolStrictEventErrRequestTable, error_msg); |
| break; |
| } |
| ::fidl::Decoder decoder(std::move(message)); |
| StrictEventErr(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleEvent_Ordinal: { |
| if (!FlexibleEvent) { |
| status = ZX_OK; |
| break; |
| } |
| FlexibleEvent(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleEventErr_Ordinal: { |
| if (!FlexibleEventErr) { |
| status = ZX_OK; |
| break; |
| } |
| const char* error_msg = nullptr; |
| status = message.Decode(&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleEventErrRequestTable, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleEventErrRequestTable, error_msg); |
| break; |
| } |
| ::fidl::Decoder decoder(std::move(message)); |
| FlexibleEventErr(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| break; |
| } |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| |
| void UnknownInteractionsProtocol_Proxy::StrictOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::StrictOneWay(&_encoder), nullptr); |
| } |
| void UnknownInteractionsProtocol_Proxy::FlexibleOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::FlexibleOneWay(&_encoder), nullptr); |
| } |
| namespace { |
| |
| ::std::unique_ptr<::fidl::internal::SingleUseMessageHandler> |
| UnknownInteractionsProtocol_StrictTwoWay_ResponseHandler(UnknownInteractionsProtocol::StrictTwoWayCallback&& callback) { |
| ZX_DEBUG_ASSERT_MSG(callback, |
| "Callback must not be empty for UnknownInteractionsProtocol::StrictTwoWay\n"); |
| return ::std::make_unique<::fidl::internal::SingleUseMessageHandler>( |
| [callback_ = std::move(callback)](::fidl::HLCPPIncomingMessage&& message) { |
| callback_(); |
| return ZX_OK; |
| }, nullptr); |
| } |
| |
| } // namespace |
| void UnknownInteractionsProtocol_Proxy::StrictTwoWay(StrictTwoWayCallback callback) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::StrictTwoWay(&_encoder), UnknownInteractionsProtocol_StrictTwoWay_ResponseHandler(std::move(callback))); |
| } |
| namespace { |
| |
| ::std::unique_ptr<::fidl::internal::SingleUseMessageHandler> |
| UnknownInteractionsProtocol_StrictTwoWayErr_ResponseHandler(UnknownInteractionsProtocol::StrictTwoWayErrCallback&& callback) { |
| ZX_DEBUG_ASSERT_MSG(callback, |
| "Callback must not be empty for UnknownInteractionsProtocol::StrictTwoWayErr\n"); |
| return ::std::make_unique<::fidl::internal::SingleUseMessageHandler>( |
| [callback_ = std::move(callback)](::fidl::HLCPPIncomingMessage&& message) { |
| ::fidl::Decoder decoder(std::move(message)); |
| callback_(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| return ZX_OK; |
| }, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolStrictTwoWayErrTopResponseTable); |
| } |
| |
| } // namespace |
| void UnknownInteractionsProtocol_Proxy::StrictTwoWayErr(StrictTwoWayErrCallback callback) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWayErr_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::StrictTwoWayErr(&_encoder), UnknownInteractionsProtocol_StrictTwoWayErr_ResponseHandler(std::move(callback))); |
| } |
| namespace { |
| |
| ::std::unique_ptr<::fidl::internal::SingleUseMessageHandler> |
| UnknownInteractionsProtocol_FlexibleTwoWay_ResponseHandler(UnknownInteractionsProtocol::FlexibleTwoWayCallback&& callback) { |
| ZX_DEBUG_ASSERT_MSG(callback, |
| "Callback must not be empty for UnknownInteractionsProtocol::FlexibleTwoWay\n"); |
| return ::std::make_unique<::fidl::internal::SingleUseMessageHandler>( |
| [callback_ = std::move(callback)](::fidl::HLCPPIncomingMessage&& message) { |
| ::fidl::Decoder decoder(std::move(message)); |
| callback_(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| return ZX_OK; |
| }, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayTopResponseTable); |
| } |
| |
| } // namespace |
| void UnknownInteractionsProtocol_Proxy::FlexibleTwoWay(FlexibleTwoWayCallback callback) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::FlexibleTwoWay(&_encoder), UnknownInteractionsProtocol_FlexibleTwoWay_ResponseHandler(std::move(callback))); |
| } |
| namespace { |
| |
| ::std::unique_ptr<::fidl::internal::SingleUseMessageHandler> |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_ResponseHandler(UnknownInteractionsProtocol::FlexibleTwoWayErrCallback&& callback) { |
| ZX_DEBUG_ASSERT_MSG(callback, |
| "Callback must not be empty for UnknownInteractionsProtocol::FlexibleTwoWayErr\n"); |
| return ::std::make_unique<::fidl::internal::SingleUseMessageHandler>( |
| [callback_ = std::move(callback)](::fidl::HLCPPIncomingMessage&& message) { |
| ::fidl::Decoder decoder(std::move(message)); |
| callback_(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| return ZX_OK; |
| }, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayErrTopResponseTable); |
| } |
| |
| } // namespace |
| void UnknownInteractionsProtocol_Proxy::FlexibleTwoWayErr(FlexibleTwoWayErrCallback callback) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWayErr_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::FlexibleTwoWayErr(&_encoder), UnknownInteractionsProtocol_FlexibleTwoWayErr_ResponseHandler(std::move(callback))); |
| } |
| |
| UnknownInteractionsProtocol_Stub::UnknownInteractionsProtocol_Stub(::test::unknowninteractions::UnknownInteractionsProtocol_Stub::UnknownInteractionsProtocol_clazz* impl) : impl_(impl) { |
| (void)impl_; |
| } |
| |
| UnknownInteractionsProtocol_Stub::~UnknownInteractionsProtocol_Stub() = default; |
| |
| namespace { |
| |
| class UnknownInteractionsProtocol_StrictTwoWay_Responder final { |
| public: |
| UnknownInteractionsProtocol_StrictTwoWay_Responder(::fidl::internal::PendingResponse response) |
| : response_(std::move(response)) {} |
| |
| void operator()() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWay_DynamicFlags); |
| const fidl_type_t* resp_type =nullptr; |
| response_.Send(resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_ResponseEncoder::StrictTwoWay(&_encoder)); |
| } |
| |
| private: |
| ::fidl::internal::PendingResponse response_; |
| }; |
| |
| class UnknownInteractionsProtocol_StrictTwoWayErr_Responder final { |
| public: |
| UnknownInteractionsProtocol_StrictTwoWayErr_Responder(::fidl::internal::PendingResponse response) |
| : response_(std::move(response)) {} |
| |
| void operator()(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWayErr_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolStrictTwoWayErrTopResponseTable; |
| response_.Send(resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_ResponseEncoder::StrictTwoWayErr(&_encoder, &result)); |
| } |
| |
| private: |
| ::fidl::internal::PendingResponse response_; |
| }; |
| |
| class UnknownInteractionsProtocol_FlexibleTwoWay_Responder final { |
| public: |
| UnknownInteractionsProtocol_FlexibleTwoWay_Responder(::fidl::internal::PendingResponse response) |
| : response_(std::move(response)) {} |
| |
| void operator()(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWay_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayTopResponseTable; |
| response_.Send(resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_ResponseEncoder::FlexibleTwoWay(&_encoder, &result)); |
| } |
| |
| private: |
| ::fidl::internal::PendingResponse response_; |
| }; |
| |
| class UnknownInteractionsProtocol_FlexibleTwoWayErr_Responder final { |
| public: |
| UnknownInteractionsProtocol_FlexibleTwoWayErr_Responder(::fidl::internal::PendingResponse response) |
| : response_(std::move(response)) {} |
| |
| void operator()(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWayErr_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayErrTopResponseTable; |
| response_.Send(resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_ResponseEncoder::FlexibleTwoWayErr(&_encoder, &result)); |
| } |
| |
| private: |
| ::fidl::internal::PendingResponse response_; |
| }; |
| |
| } // namespace |
| |
| zx_status_t UnknownInteractionsProtocol_Stub::Dispatch_( |
| ::fidl::HLCPPIncomingMessage message, |
| ::fidl::internal::PendingResponse response) { |
| bool needs_response; |
| const fidl_type_t* request_type = ::test::unknowninteractions::UnknownInteractionsProtocol_RequestDecoder::GetType(message.ordinal(), &needs_response); |
| if (!message.has_only_header()) { |
| if (request_type == nullptr) { |
| return ZX_ERR_NOT_SUPPORTED; |
| } |
| const char* error_msg = nullptr; |
| zx_status_t status = message.Decode(request_type, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, error_msg); |
| return status; |
| } |
| } |
| |
| if (response.needs_response() != needs_response) { |
| if (needs_response) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, "Message needing a response with no txid"); |
| } else { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, "Message not needing a response with a txid"); |
| } |
| return ZX_ERR_INVALID_ARGS; |
| } |
| |
| uint64_t ordinal = message.ordinal(); |
| switch (ordinal) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictOneWay_Ordinal: |
| { |
| impl_->StrictOneWay(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleOneWay_Ordinal: |
| { |
| impl_->FlexibleOneWay(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWay_Ordinal: |
| { |
| impl_->StrictTwoWay(UnknownInteractionsProtocol_StrictTwoWay_Responder(std::move(response))); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWayErr_Ordinal: |
| { |
| impl_->StrictTwoWayErr(UnknownInteractionsProtocol_StrictTwoWayErr_Responder(std::move(response))); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWay_Ordinal: |
| { |
| impl_->FlexibleTwoWay(UnknownInteractionsProtocol_FlexibleTwoWay_Responder(std::move(response))); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWayErr_Ordinal: |
| { |
| impl_->FlexibleTwoWayErr(UnknownInteractionsProtocol_FlexibleTwoWayErr_Responder(std::move(response))); |
| break; |
| } |
| default: { |
| return ZX_ERR_NOT_SUPPORTED; |
| } |
| } |
| return ZX_OK; |
| } |
| void UnknownInteractionsProtocol_Stub::StrictEvent() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictEvent_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictEvent_DynamicFlags); |
| const fidl_type_t* resp_type =nullptr;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_ResponseEncoder::StrictEvent(&_encoder)); |
| } |
| void UnknownInteractionsProtocol_Stub::StrictEventErr(::test::unknowninteractions::UnknownInteractionsProtocol_StrictEventErr_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictEventErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictEventErr_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolStrictEventErrRequestTable;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_ResponseEncoder::StrictEventErr(&_encoder, &result)); |
| } |
| void UnknownInteractionsProtocol_Stub::FlexibleEvent() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleEvent_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleEvent_DynamicFlags); |
| const fidl_type_t* resp_type =nullptr;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_ResponseEncoder::FlexibleEvent(&_encoder)); |
| } |
| void UnknownInteractionsProtocol_Stub::FlexibleEventErr(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleEventErr_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleEventErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleEventErr_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleEventErrRequestTable;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_ResponseEncoder::FlexibleEventErr(&_encoder, &result)); |
| } |
| |
| UnknownInteractionsProtocol_SyncProxy::UnknownInteractionsProtocol_SyncProxy(::zx::channel channel) |
| : proxy_(::std::move(channel)) {} |
| |
| UnknownInteractionsProtocol_SyncProxy::~UnknownInteractionsProtocol_SyncProxy() = default; |
| |
| zx_status_t UnknownInteractionsProtocol_SyncProxy::StrictOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| return proxy_.Send(req_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::StrictOneWay(&_encoder)); |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_SyncProxy::FlexibleOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| return proxy_.Send(req_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::FlexibleOneWay(&_encoder)); |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_SyncProxy::StrictTwoWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWay_DynamicFlags); |
| ::fidl::IncomingMessageBuffer buffer_; |
| ::fidl::HLCPPIncomingMessage response_ = buffer_.CreateEmptyIncomingMessage(); |
| const fidl_type_t* req_type =nullptr; |
| const fidl_type_t* resp_type =nullptr; |
| zx_status_t status_ = proxy_.Call(req_type, resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::StrictTwoWay(&_encoder), &response_); |
| if (status_ != ZX_OK) |
| return status_; |
| return ZX_OK; |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_SyncProxy::StrictTwoWayErr(::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result* out_result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_StrictTwoWayErr_DynamicFlags); |
| ::fidl::IncomingMessageBuffer buffer_; |
| ::fidl::HLCPPIncomingMessage response_ = buffer_.CreateEmptyIncomingMessage(); |
| const fidl_type_t* req_type =nullptr; |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolStrictTwoWayErrTopResponseTable; |
| zx_status_t status_ = proxy_.Call(req_type, resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::StrictTwoWayErr(&_encoder), &response_); |
| if (status_ != ZX_OK) |
| return status_; |
| ::fidl::Decoder decoder_(std::move(response_)); |
| *out_result = ::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsProtocol_StrictTwoWayErr_Result>(&decoder_, 0 + sizeof(fidl_message_header_t)); |
| return ZX_OK; |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_SyncProxy::FlexibleTwoWay(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result* out_result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWay_DynamicFlags); |
| ::fidl::IncomingMessageBuffer buffer_; |
| ::fidl::HLCPPIncomingMessage response_ = buffer_.CreateEmptyIncomingMessage(); |
| const fidl_type_t* req_type =nullptr; |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayTopResponseTable; |
| zx_status_t status_ = proxy_.Call(req_type, resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::FlexibleTwoWay(&_encoder), &response_); |
| if (status_ != ZX_OK) |
| return status_; |
| ::fidl::Decoder decoder_(std::move(response_)); |
| *out_result = ::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWay_Result>(&decoder_, 0 + sizeof(fidl_message_header_t)); |
| return ZX_OK; |
| } |
| |
| zx_status_t UnknownInteractionsProtocol_SyncProxy::FlexibleTwoWayErr(::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result* out_result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsProtocol_FlexibleTwoWayErr_DynamicFlags); |
| ::fidl::IncomingMessageBuffer buffer_; |
| ::fidl::HLCPPIncomingMessage response_ = buffer_.CreateEmptyIncomingMessage(); |
| const fidl_type_t* req_type =nullptr; |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsProtocolFlexibleTwoWayErrTopResponseTable; |
| zx_status_t status_ = proxy_.Call(req_type, resp_type, ::test::unknowninteractions::UnknownInteractionsProtocol_RequestEncoder::FlexibleTwoWayErr(&_encoder), &response_); |
| if (status_ != ZX_OK) |
| return status_; |
| ::fidl::Decoder decoder_(std::move(response_)); |
| *out_result = ::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsProtocol_FlexibleTwoWayErr_Result>(&decoder_, 0 + sizeof(fidl_message_header_t)); |
| return ZX_OK; |
| } |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| |
| |
| |
| |
| |
| namespace _internal {__LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponseTable; |
| |
| |
| |
| __LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsClosedProtocolStrictEventErrRequestTable; |
| |
| } // namespace _internal |
| UnknownInteractionsClosedProtocol::~UnknownInteractionsClosedProtocol() = default; |
| |
| const fidl_type_t* ::test::unknowninteractions::UnknownInteractionsClosedProtocol_RequestDecoder::GetType(uint64_t ordinal, bool* out_needs_response) { |
| *out_needs_response = false; |
| switch (ordinal) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictOneWay_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWay_Ordinal: |
| *out_needs_response = true; |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWayErr_Ordinal: |
| *out_needs_response = true; |
| return nullptr; |
| ; |
| default: |
| return nullptr; |
| } |
| } |
| |
| const fidl_type_t* UnknownInteractionsClosedProtocol_ResponseDecoder::GetType(uint64_t ordinal) { |
| switch (ordinal) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWay_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWayErr_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponseTable; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictEvent_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictEventErr_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsClosedProtocolStrictEventErrRequestTable; |
| ; |
| default: |
| return nullptr; |
| } |
| } |
| |
| UnknownInteractionsClosedProtocol_EventSender::~UnknownInteractionsClosedProtocol_EventSender() = default; |
| |
| UnknownInteractionsClosedProtocol_Sync::~UnknownInteractionsClosedProtocol_Sync() = default; |
| |
| UnknownInteractionsClosedProtocol_Proxy::UnknownInteractionsClosedProtocol_Proxy(::fidl::internal::ProxyController* controller) |
| : controller_(controller) { |
| (void)controller_; |
| } |
| |
| UnknownInteractionsClosedProtocol_Proxy::~UnknownInteractionsClosedProtocol_Proxy() = default; |
| |
| zx_status_t UnknownInteractionsClosedProtocol_Proxy::Dispatch_(::fidl::HLCPPIncomingMessage message) { |
| zx_status_t status = ZX_OK; |
| switch (message.ordinal()) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictEvent_Ordinal: { |
| if (!StrictEvent) { |
| status = ZX_OK; |
| break; |
| } |
| StrictEvent(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictEventErr_Ordinal: { |
| if (!StrictEventErr) { |
| status = ZX_OK; |
| break; |
| } |
| const char* error_msg = nullptr; |
| status = message.Decode(&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsClosedProtocolStrictEventErrRequestTable, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsClosedProtocolStrictEventErrRequestTable, error_msg); |
| break; |
| } |
| ::fidl::Decoder decoder(std::move(message)); |
| StrictEventErr(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| break; |
| } |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| |
| void UnknownInteractionsClosedProtocol_Proxy::StrictOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_RequestEncoder::StrictOneWay(&_encoder), nullptr); |
| } |
| namespace { |
| |
| ::std::unique_ptr<::fidl::internal::SingleUseMessageHandler> |
| UnknownInteractionsClosedProtocol_StrictTwoWay_ResponseHandler(UnknownInteractionsClosedProtocol::StrictTwoWayCallback&& callback) { |
| ZX_DEBUG_ASSERT_MSG(callback, |
| "Callback must not be empty for UnknownInteractionsClosedProtocol::StrictTwoWay\n"); |
| return ::std::make_unique<::fidl::internal::SingleUseMessageHandler>( |
| [callback_ = std::move(callback)](::fidl::HLCPPIncomingMessage&& message) { |
| callback_(); |
| return ZX_OK; |
| }, nullptr); |
| } |
| |
| } // namespace |
| void UnknownInteractionsClosedProtocol_Proxy::StrictTwoWay(StrictTwoWayCallback callback) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_RequestEncoder::StrictTwoWay(&_encoder), UnknownInteractionsClosedProtocol_StrictTwoWay_ResponseHandler(std::move(callback))); |
| } |
| namespace { |
| |
| ::std::unique_ptr<::fidl::internal::SingleUseMessageHandler> |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_ResponseHandler(UnknownInteractionsClosedProtocol::StrictTwoWayErrCallback&& callback) { |
| ZX_DEBUG_ASSERT_MSG(callback, |
| "Callback must not be empty for UnknownInteractionsClosedProtocol::StrictTwoWayErr\n"); |
| return ::std::make_unique<::fidl::internal::SingleUseMessageHandler>( |
| [callback_ = std::move(callback)](::fidl::HLCPPIncomingMessage&& message) { |
| ::fidl::Decoder decoder(std::move(message)); |
| callback_(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| return ZX_OK; |
| }, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponseTable); |
| } |
| |
| } // namespace |
| void UnknownInteractionsClosedProtocol_Proxy::StrictTwoWayErr(StrictTwoWayErrCallback callback) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWayErr_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_RequestEncoder::StrictTwoWayErr(&_encoder), UnknownInteractionsClosedProtocol_StrictTwoWayErr_ResponseHandler(std::move(callback))); |
| } |
| |
| UnknownInteractionsClosedProtocol_Stub::UnknownInteractionsClosedProtocol_Stub(::test::unknowninteractions::UnknownInteractionsClosedProtocol_Stub::UnknownInteractionsClosedProtocol_clazz* impl) : impl_(impl) { |
| (void)impl_; |
| } |
| |
| UnknownInteractionsClosedProtocol_Stub::~UnknownInteractionsClosedProtocol_Stub() = default; |
| |
| namespace { |
| |
| class UnknownInteractionsClosedProtocol_StrictTwoWay_Responder final { |
| public: |
| UnknownInteractionsClosedProtocol_StrictTwoWay_Responder(::fidl::internal::PendingResponse response) |
| : response_(std::move(response)) {} |
| |
| void operator()() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWay_DynamicFlags); |
| const fidl_type_t* resp_type =nullptr; |
| response_.Send(resp_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_ResponseEncoder::StrictTwoWay(&_encoder)); |
| } |
| |
| private: |
| ::fidl::internal::PendingResponse response_; |
| }; |
| |
| class UnknownInteractionsClosedProtocol_StrictTwoWayErr_Responder final { |
| public: |
| UnknownInteractionsClosedProtocol_StrictTwoWayErr_Responder(::fidl::internal::PendingResponse response) |
| : response_(std::move(response)) {} |
| |
| void operator()(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWayErr_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponseTable; |
| response_.Send(resp_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_ResponseEncoder::StrictTwoWayErr(&_encoder, &result)); |
| } |
| |
| private: |
| ::fidl::internal::PendingResponse response_; |
| }; |
| |
| } // namespace |
| |
| zx_status_t UnknownInteractionsClosedProtocol_Stub::Dispatch_( |
| ::fidl::HLCPPIncomingMessage message, |
| ::fidl::internal::PendingResponse response) { |
| bool needs_response; |
| const fidl_type_t* request_type = ::test::unknowninteractions::UnknownInteractionsClosedProtocol_RequestDecoder::GetType(message.ordinal(), &needs_response); |
| if (!message.has_only_header()) { |
| if (request_type == nullptr) { |
| return ZX_ERR_NOT_SUPPORTED; |
| } |
| const char* error_msg = nullptr; |
| zx_status_t status = message.Decode(request_type, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, error_msg); |
| return status; |
| } |
| } |
| |
| if (response.needs_response() != needs_response) { |
| if (needs_response) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, "Message needing a response with no txid"); |
| } else { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, "Message not needing a response with a txid"); |
| } |
| return ZX_ERR_INVALID_ARGS; |
| } |
| |
| uint64_t ordinal = message.ordinal(); |
| switch (ordinal) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictOneWay_Ordinal: |
| { |
| impl_->StrictOneWay(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWay_Ordinal: |
| { |
| impl_->StrictTwoWay(UnknownInteractionsClosedProtocol_StrictTwoWay_Responder(std::move(response))); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWayErr_Ordinal: |
| { |
| impl_->StrictTwoWayErr(UnknownInteractionsClosedProtocol_StrictTwoWayErr_Responder(std::move(response))); |
| break; |
| } |
| default: { |
| return ZX_ERR_NOT_SUPPORTED; |
| } |
| } |
| return ZX_OK; |
| } |
| void UnknownInteractionsClosedProtocol_Stub::StrictEvent() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictEvent_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictEvent_DynamicFlags); |
| const fidl_type_t* resp_type =nullptr;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_ResponseEncoder::StrictEvent(&_encoder)); |
| } |
| void UnknownInteractionsClosedProtocol_Stub::StrictEventErr(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictEventErr_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictEventErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictEventErr_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsClosedProtocolStrictEventErrRequestTable;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_ResponseEncoder::StrictEventErr(&_encoder, &result)); |
| } |
| |
| UnknownInteractionsClosedProtocol_SyncProxy::UnknownInteractionsClosedProtocol_SyncProxy(::zx::channel channel) |
| : proxy_(::std::move(channel)) {} |
| |
| UnknownInteractionsClosedProtocol_SyncProxy::~UnknownInteractionsClosedProtocol_SyncProxy() = default; |
| |
| zx_status_t UnknownInteractionsClosedProtocol_SyncProxy::StrictOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| return proxy_.Send(req_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_RequestEncoder::StrictOneWay(&_encoder)); |
| } |
| |
| zx_status_t UnknownInteractionsClosedProtocol_SyncProxy::StrictTwoWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWay_DynamicFlags); |
| ::fidl::IncomingMessageBuffer buffer_; |
| ::fidl::HLCPPIncomingMessage response_ = buffer_.CreateEmptyIncomingMessage(); |
| const fidl_type_t* req_type =nullptr; |
| const fidl_type_t* resp_type =nullptr; |
| zx_status_t status_ = proxy_.Call(req_type, resp_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_RequestEncoder::StrictTwoWay(&_encoder), &response_); |
| if (status_ != ZX_OK) |
| return status_; |
| return ZX_OK; |
| } |
| |
| zx_status_t UnknownInteractionsClosedProtocol_SyncProxy::StrictTwoWayErr(::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result* out_result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsClosedProtocol_StrictTwoWayErr_DynamicFlags); |
| ::fidl::IncomingMessageBuffer buffer_; |
| ::fidl::HLCPPIncomingMessage response_ = buffer_.CreateEmptyIncomingMessage(); |
| const fidl_type_t* req_type =nullptr; |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsClosedProtocolStrictTwoWayErrTopResponseTable; |
| zx_status_t status_ = proxy_.Call(req_type, resp_type, ::test::unknowninteractions::UnknownInteractionsClosedProtocol_RequestEncoder::StrictTwoWayErr(&_encoder), &response_); |
| if (status_ != ZX_OK) |
| return status_; |
| ::fidl::Decoder decoder_(std::move(response_)); |
| *out_result = ::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsClosedProtocol_StrictTwoWayErr_Result>(&decoder_, 0 + sizeof(fidl_message_header_t)); |
| return ZX_OK; |
| } |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| |
| |
| |
| |
| |
| |
| |
| namespace _internal {__LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponseTable; |
| |
| |
| |
| __LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocolStrictEventErrRequestTable; |
| |
| |
| |
| __LOCAL extern "C" const fidl_type_t test_unknowninteractions_UnknownInteractionsAjarProtocolFlexibleEventErrRequestTable; |
| |
| } // namespace _internal |
| UnknownInteractionsAjarProtocol::~UnknownInteractionsAjarProtocol() = default; |
| |
| const fidl_type_t* ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestDecoder::GetType(uint64_t ordinal, bool* out_needs_response) { |
| *out_needs_response = false; |
| switch (ordinal) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictOneWay_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleOneWay_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWay_Ordinal: |
| *out_needs_response = true; |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWayErr_Ordinal: |
| *out_needs_response = true; |
| return nullptr; |
| ; |
| default: |
| return nullptr; |
| } |
| } |
| |
| const fidl_type_t* UnknownInteractionsAjarProtocol_ResponseDecoder::GetType(uint64_t ordinal) { |
| switch (ordinal) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWay_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWayErr_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponseTable; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictEvent_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictEventErr_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolStrictEventErrRequestTable; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleEvent_Ordinal: |
| return nullptr; |
| ; |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleEventErr_Ordinal: |
| return &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolFlexibleEventErrRequestTable; |
| ; |
| default: |
| return nullptr; |
| } |
| } |
| |
| UnknownInteractionsAjarProtocol_EventSender::~UnknownInteractionsAjarProtocol_EventSender() = default; |
| |
| UnknownInteractionsAjarProtocol_Sync::~UnknownInteractionsAjarProtocol_Sync() = default; |
| |
| UnknownInteractionsAjarProtocol_Proxy::UnknownInteractionsAjarProtocol_Proxy(::fidl::internal::ProxyController* controller) |
| : controller_(controller) { |
| (void)controller_; |
| } |
| |
| UnknownInteractionsAjarProtocol_Proxy::~UnknownInteractionsAjarProtocol_Proxy() = default; |
| |
| zx_status_t UnknownInteractionsAjarProtocol_Proxy::Dispatch_(::fidl::HLCPPIncomingMessage message) { |
| zx_status_t status = ZX_OK; |
| switch (message.ordinal()) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictEvent_Ordinal: { |
| if (!StrictEvent) { |
| status = ZX_OK; |
| break; |
| } |
| StrictEvent(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictEventErr_Ordinal: { |
| if (!StrictEventErr) { |
| status = ZX_OK; |
| break; |
| } |
| const char* error_msg = nullptr; |
| status = message.Decode(&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolStrictEventErrRequestTable, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolStrictEventErrRequestTable, error_msg); |
| break; |
| } |
| ::fidl::Decoder decoder(std::move(message)); |
| StrictEventErr(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleEvent_Ordinal: { |
| if (!FlexibleEvent) { |
| status = ZX_OK; |
| break; |
| } |
| FlexibleEvent(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleEventErr_Ordinal: { |
| if (!FlexibleEventErr) { |
| status = ZX_OK; |
| break; |
| } |
| const char* error_msg = nullptr; |
| status = message.Decode(&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolFlexibleEventErrRequestTable, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolFlexibleEventErrRequestTable, error_msg); |
| break; |
| } |
| ::fidl::Decoder decoder(std::move(message)); |
| FlexibleEventErr(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| break; |
| } |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| |
| void UnknownInteractionsAjarProtocol_Proxy::StrictOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestEncoder::StrictOneWay(&_encoder), nullptr); |
| } |
| void UnknownInteractionsAjarProtocol_Proxy::FlexibleOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestEncoder::FlexibleOneWay(&_encoder), nullptr); |
| } |
| namespace { |
| |
| ::std::unique_ptr<::fidl::internal::SingleUseMessageHandler> |
| UnknownInteractionsAjarProtocol_StrictTwoWay_ResponseHandler(UnknownInteractionsAjarProtocol::StrictTwoWayCallback&& callback) { |
| ZX_DEBUG_ASSERT_MSG(callback, |
| "Callback must not be empty for UnknownInteractionsAjarProtocol::StrictTwoWay\n"); |
| return ::std::make_unique<::fidl::internal::SingleUseMessageHandler>( |
| [callback_ = std::move(callback)](::fidl::HLCPPIncomingMessage&& message) { |
| callback_(); |
| return ZX_OK; |
| }, nullptr); |
| } |
| |
| } // namespace |
| void UnknownInteractionsAjarProtocol_Proxy::StrictTwoWay(StrictTwoWayCallback callback) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestEncoder::StrictTwoWay(&_encoder), UnknownInteractionsAjarProtocol_StrictTwoWay_ResponseHandler(std::move(callback))); |
| } |
| namespace { |
| |
| ::std::unique_ptr<::fidl::internal::SingleUseMessageHandler> |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_ResponseHandler(UnknownInteractionsAjarProtocol::StrictTwoWayErrCallback&& callback) { |
| ZX_DEBUG_ASSERT_MSG(callback, |
| "Callback must not be empty for UnknownInteractionsAjarProtocol::StrictTwoWayErr\n"); |
| return ::std::make_unique<::fidl::internal::SingleUseMessageHandler>( |
| [callback_ = std::move(callback)](::fidl::HLCPPIncomingMessage&& message) { |
| ::fidl::Decoder decoder(std::move(message)); |
| callback_(::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result>(&decoder, 0 + sizeof(fidl_message_header_t))); |
| return ZX_OK; |
| }, &::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponseTable); |
| } |
| |
| } // namespace |
| void UnknownInteractionsAjarProtocol_Proxy::StrictTwoWayErr(StrictTwoWayErrCallback callback) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWayErr_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| controller_->Send(req_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestEncoder::StrictTwoWayErr(&_encoder), UnknownInteractionsAjarProtocol_StrictTwoWayErr_ResponseHandler(std::move(callback))); |
| } |
| |
| UnknownInteractionsAjarProtocol_Stub::UnknownInteractionsAjarProtocol_Stub(::test::unknowninteractions::UnknownInteractionsAjarProtocol_Stub::UnknownInteractionsAjarProtocol_clazz* impl) : impl_(impl) { |
| (void)impl_; |
| } |
| |
| UnknownInteractionsAjarProtocol_Stub::~UnknownInteractionsAjarProtocol_Stub() = default; |
| |
| namespace { |
| |
| class UnknownInteractionsAjarProtocol_StrictTwoWay_Responder final { |
| public: |
| UnknownInteractionsAjarProtocol_StrictTwoWay_Responder(::fidl::internal::PendingResponse response) |
| : response_(std::move(response)) {} |
| |
| void operator()() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWay_DynamicFlags); |
| const fidl_type_t* resp_type =nullptr; |
| response_.Send(resp_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_ResponseEncoder::StrictTwoWay(&_encoder)); |
| } |
| |
| private: |
| ::fidl::internal::PendingResponse response_; |
| }; |
| |
| class UnknownInteractionsAjarProtocol_StrictTwoWayErr_Responder final { |
| public: |
| UnknownInteractionsAjarProtocol_StrictTwoWayErr_Responder(::fidl::internal::PendingResponse response) |
| : response_(std::move(response)) {} |
| |
| void operator()(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWayErr_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponseTable; |
| response_.Send(resp_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_ResponseEncoder::StrictTwoWayErr(&_encoder, &result)); |
| } |
| |
| private: |
| ::fidl::internal::PendingResponse response_; |
| }; |
| |
| } // namespace |
| |
| zx_status_t UnknownInteractionsAjarProtocol_Stub::Dispatch_( |
| ::fidl::HLCPPIncomingMessage message, |
| ::fidl::internal::PendingResponse response) { |
| bool needs_response; |
| const fidl_type_t* request_type = ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestDecoder::GetType(message.ordinal(), &needs_response); |
| if (!message.has_only_header()) { |
| if (request_type == nullptr) { |
| return ZX_ERR_NOT_SUPPORTED; |
| } |
| const char* error_msg = nullptr; |
| zx_status_t status = message.Decode(request_type, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, error_msg); |
| return status; |
| } |
| } |
| |
| if (response.needs_response() != needs_response) { |
| if (needs_response) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, "Message needing a response with no txid"); |
| } else { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, "Message not needing a response with a txid"); |
| } |
| return ZX_ERR_INVALID_ARGS; |
| } |
| |
| uint64_t ordinal = message.ordinal(); |
| switch (ordinal) { |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictOneWay_Ordinal: |
| { |
| impl_->StrictOneWay(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleOneWay_Ordinal: |
| { |
| impl_->FlexibleOneWay(); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWay_Ordinal: |
| { |
| impl_->StrictTwoWay(UnknownInteractionsAjarProtocol_StrictTwoWay_Responder(std::move(response))); |
| break; |
| } |
| case ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWayErr_Ordinal: |
| { |
| impl_->StrictTwoWayErr(UnknownInteractionsAjarProtocol_StrictTwoWayErr_Responder(std::move(response))); |
| break; |
| } |
| default: { |
| return ZX_ERR_NOT_SUPPORTED; |
| } |
| } |
| return ZX_OK; |
| } |
| void UnknownInteractionsAjarProtocol_Stub::StrictEvent() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictEvent_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictEvent_DynamicFlags); |
| const fidl_type_t* resp_type =nullptr;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_ResponseEncoder::StrictEvent(&_encoder)); |
| } |
| void UnknownInteractionsAjarProtocol_Stub::StrictEventErr(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictEventErr_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictEventErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictEventErr_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolStrictEventErrRequestTable;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_ResponseEncoder::StrictEventErr(&_encoder, &result)); |
| } |
| void UnknownInteractionsAjarProtocol_Stub::FlexibleEvent() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleEvent_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleEvent_DynamicFlags); |
| const fidl_type_t* resp_type =nullptr;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_ResponseEncoder::FlexibleEvent(&_encoder)); |
| } |
| void UnknownInteractionsAjarProtocol_Stub::FlexibleEventErr(::test::unknowninteractions::UnknownInteractionsAjarProtocol_FlexibleEventErr_Result result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleEventErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleEventErr_DynamicFlags); |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolFlexibleEventErrRequestTable;sender_()->Send(resp_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_ResponseEncoder::FlexibleEventErr(&_encoder, &result)); |
| } |
| |
| UnknownInteractionsAjarProtocol_SyncProxy::UnknownInteractionsAjarProtocol_SyncProxy(::zx::channel channel) |
| : proxy_(::std::move(channel)) {} |
| |
| UnknownInteractionsAjarProtocol_SyncProxy::~UnknownInteractionsAjarProtocol_SyncProxy() = default; |
| |
| zx_status_t UnknownInteractionsAjarProtocol_SyncProxy::StrictOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| return proxy_.Send(req_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestEncoder::StrictOneWay(&_encoder)); |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocol_SyncProxy::FlexibleOneWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleOneWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_FlexibleOneWay_DynamicFlags); |
| const fidl_type_t* req_type =nullptr; |
| return proxy_.Send(req_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestEncoder::FlexibleOneWay(&_encoder)); |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocol_SyncProxy::StrictTwoWay() { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWay_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWay_DynamicFlags); |
| ::fidl::IncomingMessageBuffer buffer_; |
| ::fidl::HLCPPIncomingMessage response_ = buffer_.CreateEmptyIncomingMessage(); |
| const fidl_type_t* req_type =nullptr; |
| const fidl_type_t* resp_type =nullptr; |
| zx_status_t status_ = proxy_.Call(req_type, resp_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestEncoder::StrictTwoWay(&_encoder), &response_); |
| if (status_ != ZX_OK) |
| return status_; |
| return ZX_OK; |
| } |
| |
| zx_status_t UnknownInteractionsAjarProtocol_SyncProxy::StrictTwoWayErr(::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result* out_result) { |
| ::fidl::MessageEncoder _encoder(::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWayErr_Ordinal, ::test::unknowninteractions::internal::kUnknownInteractionsAjarProtocol_StrictTwoWayErr_DynamicFlags); |
| ::fidl::IncomingMessageBuffer buffer_; |
| ::fidl::HLCPPIncomingMessage response_ = buffer_.CreateEmptyIncomingMessage(); |
| const fidl_type_t* req_type =nullptr; |
| const fidl_type_t* resp_type =&::test::unknowninteractions::_internal::test_unknowninteractions_UnknownInteractionsAjarProtocolStrictTwoWayErrTopResponseTable; |
| zx_status_t status_ = proxy_.Call(req_type, resp_type, ::test::unknowninteractions::UnknownInteractionsAjarProtocol_RequestEncoder::StrictTwoWayErr(&_encoder), &response_); |
| if (status_ != ZX_OK) |
| return status_; |
| ::fidl::Decoder decoder_(std::move(response_)); |
| *out_result = ::fidl::DecodeAs<::test::unknowninteractions::UnknownInteractionsAjarProtocol_StrictTwoWayErr_Result>(&decoder_, 0 + sizeof(fidl_message_header_t)); |
| return ZX_OK; |
| } |
| #endif // __Fuchsia__ |
| |
| |
| } // namespace unknowninteractions |
| } // namespace test |
| |