| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <fidl/test.errorsyntax.parent/cpp/hlcpp_conversion.h> |
| #include <fidl/test.errorsyntax/cpp/natural_types.h> |
| #include <lib/fidl/cpp/hlcpp_conversion.h> |
| #include <lib/fidl/llcpp/internal/transport_channel.h> |
| #include <test/errorsyntax/cpp/fidl.h> |
| namespace fidl { |
| namespace internal { |
| |
| template <> |
| struct NaturalToHLCPPTraits<fidl::ClientEnd<::test_errorsyntax::ExampleUseOfErrorSyntax>> { |
| using HLCPPType = fidl::InterfaceHandle<::test::errorsyntax::ExampleUseOfErrorSyntax>; |
| static inline fidl::InterfaceHandle<::test::errorsyntax::ExampleUseOfErrorSyntax> Convert(fidl::ClientEnd<::test_errorsyntax::ExampleUseOfErrorSyntax>&& c) { |
| return fidl::InterfaceHandle<::test::errorsyntax::ExampleUseOfErrorSyntax>(c.TakeChannel()); |
| } |
| }; |
| |
| template <> |
| struct NaturalToHLCPPTraits<fidl::ServerEnd<::test_errorsyntax::ExampleUseOfErrorSyntax>> { |
| using HLCPPType = fidl::InterfaceRequest<::test::errorsyntax::ExampleUseOfErrorSyntax>; |
| static inline fidl::InterfaceRequest<::test::errorsyntax::ExampleUseOfErrorSyntax> Convert(fidl::ServerEnd<::test_errorsyntax::ExampleUseOfErrorSyntax>&& c) { |
| return fidl::InterfaceRequest<::test::errorsyntax::ExampleUseOfErrorSyntax>(c.TakeChannel()); |
| } |
| }; |
| |
| template <> |
| struct HLCPPToNaturalTraits<fidl::InterfaceHandle<::test::errorsyntax::ExampleUseOfErrorSyntax>> { |
| using NaturalType = fidl::ClientEnd<::test_errorsyntax::ExampleUseOfErrorSyntax>; |
| static inline fidl::ClientEnd<::test_errorsyntax::ExampleUseOfErrorSyntax> Convert(fidl::InterfaceHandle<::test::errorsyntax::ExampleUseOfErrorSyntax>&& c) { |
| return fidl::ClientEnd<::test_errorsyntax::ExampleUseOfErrorSyntax>(c.TakeChannel()); |
| } |
| }; |
| |
| template <> |
| struct HLCPPToNaturalTraits<fidl::InterfaceRequest<::test::errorsyntax::ExampleUseOfErrorSyntax>> { |
| using NaturalType = fidl::ServerEnd<::test_errorsyntax::ExampleUseOfErrorSyntax>; |
| static inline fidl::ServerEnd<::test_errorsyntax::ExampleUseOfErrorSyntax> Convert(fidl::InterfaceRequest<::test::errorsyntax::ExampleUseOfErrorSyntax>&& c) { |
| return fidl::ServerEnd<::test_errorsyntax::ExampleUseOfErrorSyntax>(c.TakeChannel()); |
| } |
| }; |
| |
| template <> |
| struct NaturalToHLCPPTraits<::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse> { |
| using HLCPPType = ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Response; |
| static inline ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Response Convert(::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Response> { |
| using NaturalType = ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse; |
| static inline ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse Convert(::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Response&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse> { |
| using HLCPPType = ::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse; |
| static inline ::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse Convert(::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse> { |
| using NaturalType = ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse; |
| static inline ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse Convert(::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest> { |
| using HLCPPType = ::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest; |
| static inline ::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest Convert(::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest> { |
| using NaturalType = ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest; |
| static inline ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest Convert(::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult> { |
| using HLCPPType = ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result; |
| static inline ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result Convert(::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result> { |
| using NaturalType = ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult; |
| static inline ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult Convert(::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result&&); |
| }; |
| |
| ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Response NaturalToHLCPPTraits<::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse>::Convert(::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse&& value) { |
| ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Response hlcpp; |
| hlcpp.value = ::fidl::NaturalToHLCPP(std::move(value.value())); |
| return hlcpp; |
| } |
| |
| ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse HLCPPToNaturalTraits<::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Response>::Convert(::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Response&& value) { |
| return ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResponse{{ |
| .value = ::fidl::HLCPPToNatural(std::move(value.value)), |
| }}; |
| } |
| ::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse NaturalToHLCPPTraits<::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse>::Convert(::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse&& value) { |
| ::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse hlcpp; |
| hlcpp.result = ::fidl::NaturalToHLCPP(std::move(value.result())); |
| return hlcpp; |
| } |
| |
| ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse HLCPPToNaturalTraits<::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse>::Convert(::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse&& value) { |
| return ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailTopResponse{{ |
| .result = ::fidl::HLCPPToNatural(std::move(value.result)), |
| }}; |
| } |
| ::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest NaturalToHLCPPTraits<::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest>::Convert(::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest&& value) { |
| ::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest hlcpp; |
| hlcpp.s = ::fidl::NaturalToHLCPP(std::move(value.s())); |
| return hlcpp; |
| } |
| |
| ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest HLCPPToNaturalTraits<::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest>::Convert(::test::errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest&& value) { |
| return ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailRequest{{ |
| .s = ::fidl::HLCPPToNatural(std::move(value.s)), |
| }}; |
| } |
| |
| ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result NaturalToHLCPPTraits<::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult>::Convert(::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult&& value) { |
| ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result hlcpp; |
| switch (value.Which()) { |
| case ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult::Tag::kResponse: |
| hlcpp.set_response(::fidl::NaturalToHLCPP(std::move(value.response().value()))); |
| break; |
| case ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult::Tag::kErr: |
| hlcpp.set_err(::fidl::NaturalToHLCPP(std::move(value.err().value()))); |
| break; |
| default: |
| break; |
| } |
| return hlcpp; |
| } |
| |
| ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult HLCPPToNaturalTraits<::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result>::Convert(::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result&& value) { |
| using _NaturalUnion = ::test_errorsyntax::ExampleUseOfErrorSyntaxCallWhichMayFailResult; |
| switch (value.Which()) { |
| case ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result::Tag::kResponse: |
| return _NaturalUnion::WithResponse( |
| ::fidl::HLCPPToNatural(std::move(value.response()))); |
| case ::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result::Tag::kErr: |
| return _NaturalUnion::WithErr( |
| ::fidl::HLCPPToNatural(std::move(value.err()))); |
| default: |
| ZX_PANIC("Can't convert invalid strict union %s from HLCPP to Natural", "::test::errorsyntax::ExampleUseOfErrorSyntax_CallWhichMayFail_Result"); |
| } |
| } |
| |
| } // namespace internal |
| } // namespace fidl |