| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #pragma once |
| |
| #include <fidl/test.nullable/cpp/natural_types.h> |
| #include <lib/fidl/cpp/hlcpp_conversion.h> |
| #include <lib/fidl/cpp/wire/service_handler.h> |
| #include <test/nullable/cpp/fidl.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace fidl { |
| namespace internal { |
| |
| template <> |
| struct NaturalToHLCPPTraits<fidl::ClientEnd<::test_nullable::SimpleProtocol>> { |
| using HLCPPType = fidl::InterfaceHandle<::test::nullable::SimpleProtocol>; |
| static inline fidl::InterfaceHandle<::test::nullable::SimpleProtocol> Convert(fidl::ClientEnd<::test_nullable::SimpleProtocol>&& c) { |
| return fidl::InterfaceHandle<::test::nullable::SimpleProtocol>(c.TakeChannel()); |
| } |
| }; |
| |
| template <> |
| struct NaturalToHLCPPTraits<fidl::ServerEnd<::test_nullable::SimpleProtocol>> { |
| using HLCPPType = fidl::InterfaceRequest<::test::nullable::SimpleProtocol>; |
| static inline fidl::InterfaceRequest<::test::nullable::SimpleProtocol> Convert(fidl::ServerEnd<::test_nullable::SimpleProtocol>&& c) { |
| return fidl::InterfaceRequest<::test::nullable::SimpleProtocol>(c.TakeChannel()); |
| } |
| }; |
| |
| template <> |
| struct HLCPPToNaturalTraits<fidl::InterfaceHandle<::test::nullable::SimpleProtocol>> { |
| using NaturalType = fidl::ClientEnd<::test_nullable::SimpleProtocol>; |
| static inline fidl::ClientEnd<::test_nullable::SimpleProtocol> Convert(fidl::InterfaceHandle<::test::nullable::SimpleProtocol>&& c) { |
| return fidl::ClientEnd<::test_nullable::SimpleProtocol>(c.TakeChannel()); |
| } |
| }; |
| |
| template <> |
| struct HLCPPToNaturalTraits<fidl::InterfaceRequest<::test::nullable::SimpleProtocol>> { |
| using NaturalType = fidl::ServerEnd<::test_nullable::SimpleProtocol>; |
| static inline fidl::ServerEnd<::test_nullable::SimpleProtocol> Convert(fidl::InterfaceRequest<::test::nullable::SimpleProtocol>&& c) { |
| return fidl::ServerEnd<::test_nullable::SimpleProtocol>(c.TakeChannel()); |
| } |
| }; |
| |
| template <> |
| struct NaturalToHLCPPTraits<fidl::ProtocolHandler<::test_nullable::SimpleProtocol>> { |
| using HLCPPType = fidl::InterfaceRequestHandler<::test::nullable::SimpleProtocol>; |
| static inline fidl::InterfaceRequestHandler<::test::nullable::SimpleProtocol> Convert(fidl::ProtocolHandler<::test_nullable::SimpleProtocol>&& c) { |
| return [c = std::move(c)](fidl::InterfaceRequest<::test::nullable::SimpleProtocol> r) { |
| c(::fidl::HLCPPToNatural(r)); |
| }; |
| } |
| }; |
| |
| template <> |
| struct HLCPPToNaturalTraits<fidl::InterfaceRequestHandler<::test::nullable::SimpleProtocol>> { |
| using NaturalType = fidl::ProtocolHandler<::test_nullable::SimpleProtocol>; |
| static inline fidl::ProtocolHandler<::test_nullable::SimpleProtocol> Convert(fidl::InterfaceRequestHandler<::test::nullable::SimpleProtocol>&& c) { |
| return [c = std::move(c)](fidl::ServerEnd<::test_nullable::SimpleProtocol> r) { |
| c(::fidl::NaturalToHLCPP(r)); |
| }; |
| } |
| }; |
| |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::StructWithNullableString> { |
| using HLCPPType = ::test::nullable::StructWithNullableString; |
| static inline ::test::nullable::StructWithNullableString Convert(::test_nullable::StructWithNullableString&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::StructWithNullableString> { |
| using NaturalType = ::test_nullable::StructWithNullableString; |
| static inline ::test_nullable::StructWithNullableString Convert(::test::nullable::StructWithNullableString&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::StructWithNullableVector> { |
| using HLCPPType = ::test::nullable::StructWithNullableVector; |
| static inline ::test::nullable::StructWithNullableVector Convert(::test_nullable::StructWithNullableVector&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::StructWithNullableVector> { |
| using NaturalType = ::test_nullable::StructWithNullableVector; |
| static inline ::test_nullable::StructWithNullableVector Convert(::test::nullable::StructWithNullableVector&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::StructWithNullableHandle> { |
| using HLCPPType = ::test::nullable::StructWithNullableHandle; |
| static inline ::test::nullable::StructWithNullableHandle Convert(::test_nullable::StructWithNullableHandle&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::StructWithNullableHandle> { |
| using NaturalType = ::test_nullable::StructWithNullableHandle; |
| static inline ::test_nullable::StructWithNullableHandle Convert(::test::nullable::StructWithNullableHandle&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::SimpleProtocolAddRequest> { |
| using HLCPPType = ::test::nullable::SimpleProtocolAddRequest; |
| static inline ::test::nullable::SimpleProtocolAddRequest Convert(::test_nullable::SimpleProtocolAddRequest&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::SimpleProtocolAddRequest> { |
| using NaturalType = ::test_nullable::SimpleProtocolAddRequest; |
| static inline ::test_nullable::SimpleProtocolAddRequest Convert(::test::nullable::SimpleProtocolAddRequest&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::SimpleProtocolAddResponse> { |
| using HLCPPType = ::test::nullable::SimpleProtocolAddResponse; |
| static inline ::test::nullable::SimpleProtocolAddResponse Convert(::test_nullable::SimpleProtocolAddResponse&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::SimpleProtocolAddResponse> { |
| using NaturalType = ::test_nullable::SimpleProtocolAddResponse; |
| static inline ::test_nullable::SimpleProtocolAddResponse Convert(::test::nullable::SimpleProtocolAddResponse&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::StructWithNullableProtocol> { |
| using HLCPPType = ::test::nullable::StructWithNullableProtocol; |
| static inline ::test::nullable::StructWithNullableProtocol Convert(::test_nullable::StructWithNullableProtocol&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::StructWithNullableProtocol> { |
| using NaturalType = ::test_nullable::StructWithNullableProtocol; |
| static inline ::test_nullable::StructWithNullableProtocol Convert(::test::nullable::StructWithNullableProtocol&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::StructWithNullableRequest> { |
| using HLCPPType = ::test::nullable::StructWithNullableRequest; |
| static inline ::test::nullable::StructWithNullableRequest Convert(::test_nullable::StructWithNullableRequest&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::StructWithNullableRequest> { |
| using NaturalType = ::test_nullable::StructWithNullableRequest; |
| static inline ::test_nullable::StructWithNullableRequest Convert(::test::nullable::StructWithNullableRequest&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::Int32Wrapper> { |
| using HLCPPType = ::test::nullable::Int32Wrapper; |
| static inline ::test::nullable::Int32Wrapper Convert(::test_nullable::Int32Wrapper&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::Int32Wrapper> { |
| using NaturalType = ::test_nullable::Int32Wrapper; |
| static inline ::test_nullable::Int32Wrapper Convert(::test::nullable::Int32Wrapper&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::StructWithNullableStruct> { |
| using HLCPPType = ::test::nullable::StructWithNullableStruct; |
| static inline ::test::nullable::StructWithNullableStruct Convert(::test_nullable::StructWithNullableStruct&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::StructWithNullableStruct> { |
| using NaturalType = ::test_nullable::StructWithNullableStruct; |
| static inline ::test_nullable::StructWithNullableStruct Convert(::test::nullable::StructWithNullableStruct&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::StructWithNullableUnion> { |
| using HLCPPType = ::test::nullable::StructWithNullableUnion; |
| static inline ::test::nullable::StructWithNullableUnion Convert(::test_nullable::StructWithNullableUnion&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::StructWithNullableUnion> { |
| using NaturalType = ::test_nullable::StructWithNullableUnion; |
| static inline ::test_nullable::StructWithNullableUnion Convert(::test::nullable::StructWithNullableUnion&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_nullable::SimpleUnion> { |
| using HLCPPType = ::test::nullable::SimpleUnion; |
| static inline ::test::nullable::SimpleUnion Convert(::test_nullable::SimpleUnion&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::nullable::SimpleUnion> { |
| using NaturalType = ::test_nullable::SimpleUnion; |
| static inline ::test_nullable::SimpleUnion Convert(::test::nullable::SimpleUnion&&); |
| }; |
| |
| ::test::nullable::StructWithNullableString NaturalToHLCPPTraits<::test_nullable::StructWithNullableString>::Convert(::test_nullable::StructWithNullableString&& value) { |
| ::test::nullable::StructWithNullableString hlcpp; |
| hlcpp.val = ::fidl::NaturalToHLCPP(std::move(value.val())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::StructWithNullableString HLCPPToNaturalTraits<::test::nullable::StructWithNullableString>::Convert(::test::nullable::StructWithNullableString&& value) { |
| return ::test_nullable::StructWithNullableString{{ |
| .val = ::fidl::HLCPPToNatural(std::move(value.val)), |
| }}; |
| } |
| ::test::nullable::StructWithNullableVector NaturalToHLCPPTraits<::test_nullable::StructWithNullableVector>::Convert(::test_nullable::StructWithNullableVector&& value) { |
| ::test::nullable::StructWithNullableVector hlcpp; |
| hlcpp.val = ::fidl::NaturalToHLCPP(std::move(value.val())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::StructWithNullableVector HLCPPToNaturalTraits<::test::nullable::StructWithNullableVector>::Convert(::test::nullable::StructWithNullableVector&& value) { |
| return ::test_nullable::StructWithNullableVector{{ |
| .val = ::fidl::HLCPPToNatural(std::move(value.val)), |
| }}; |
| } |
| ::test::nullable::StructWithNullableHandle NaturalToHLCPPTraits<::test_nullable::StructWithNullableHandle>::Convert(::test_nullable::StructWithNullableHandle&& value) { |
| ::test::nullable::StructWithNullableHandle hlcpp; |
| hlcpp.val = ::fidl::NaturalToHLCPP(std::move(value.val())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::StructWithNullableHandle HLCPPToNaturalTraits<::test::nullable::StructWithNullableHandle>::Convert(::test::nullable::StructWithNullableHandle&& value) { |
| return ::test_nullable::StructWithNullableHandle{{ |
| .val = ::fidl::HLCPPToNatural(std::move(value.val)), |
| }}; |
| } |
| ::test::nullable::SimpleProtocolAddRequest NaturalToHLCPPTraits<::test_nullable::SimpleProtocolAddRequest>::Convert(::test_nullable::SimpleProtocolAddRequest&& value) { |
| ::test::nullable::SimpleProtocolAddRequest hlcpp; |
| hlcpp.a = ::fidl::NaturalToHLCPP(std::move(value.a())); |
| hlcpp.b = ::fidl::NaturalToHLCPP(std::move(value.b())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::SimpleProtocolAddRequest HLCPPToNaturalTraits<::test::nullable::SimpleProtocolAddRequest>::Convert(::test::nullable::SimpleProtocolAddRequest&& value) { |
| return ::test_nullable::SimpleProtocolAddRequest{{ |
| .a = ::fidl::HLCPPToNatural(std::move(value.a)), |
| .b = ::fidl::HLCPPToNatural(std::move(value.b)), |
| }}; |
| } |
| ::test::nullable::SimpleProtocolAddResponse NaturalToHLCPPTraits<::test_nullable::SimpleProtocolAddResponse>::Convert(::test_nullable::SimpleProtocolAddResponse&& value) { |
| ::test::nullable::SimpleProtocolAddResponse hlcpp; |
| hlcpp.sum = ::fidl::NaturalToHLCPP(std::move(value.sum())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::SimpleProtocolAddResponse HLCPPToNaturalTraits<::test::nullable::SimpleProtocolAddResponse>::Convert(::test::nullable::SimpleProtocolAddResponse&& value) { |
| return ::test_nullable::SimpleProtocolAddResponse{{ |
| .sum = ::fidl::HLCPPToNatural(std::move(value.sum)), |
| }}; |
| } |
| ::test::nullable::StructWithNullableProtocol NaturalToHLCPPTraits<::test_nullable::StructWithNullableProtocol>::Convert(::test_nullable::StructWithNullableProtocol&& value) { |
| ::test::nullable::StructWithNullableProtocol hlcpp; |
| hlcpp.val = ::fidl::NaturalToHLCPP(std::move(value.val())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::StructWithNullableProtocol HLCPPToNaturalTraits<::test::nullable::StructWithNullableProtocol>::Convert(::test::nullable::StructWithNullableProtocol&& value) { |
| return ::test_nullable::StructWithNullableProtocol{{ |
| .val = ::fidl::HLCPPToNatural(std::move(value.val)), |
| }}; |
| } |
| ::test::nullable::StructWithNullableRequest NaturalToHLCPPTraits<::test_nullable::StructWithNullableRequest>::Convert(::test_nullable::StructWithNullableRequest&& value) { |
| ::test::nullable::StructWithNullableRequest hlcpp; |
| hlcpp.val = ::fidl::NaturalToHLCPP(std::move(value.val())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::StructWithNullableRequest HLCPPToNaturalTraits<::test::nullable::StructWithNullableRequest>::Convert(::test::nullable::StructWithNullableRequest&& value) { |
| return ::test_nullable::StructWithNullableRequest{{ |
| .val = ::fidl::HLCPPToNatural(std::move(value.val)), |
| }}; |
| } |
| ::test::nullable::Int32Wrapper NaturalToHLCPPTraits<::test_nullable::Int32Wrapper>::Convert(::test_nullable::Int32Wrapper&& value) { |
| ::test::nullable::Int32Wrapper hlcpp; |
| hlcpp.val = ::fidl::NaturalToHLCPP(std::move(value.val())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::Int32Wrapper HLCPPToNaturalTraits<::test::nullable::Int32Wrapper>::Convert(::test::nullable::Int32Wrapper&& value) { |
| return ::test_nullable::Int32Wrapper{{ |
| .val = ::fidl::HLCPPToNatural(std::move(value.val)), |
| }}; |
| } |
| ::test::nullable::StructWithNullableStruct NaturalToHLCPPTraits<::test_nullable::StructWithNullableStruct>::Convert(::test_nullable::StructWithNullableStruct&& value) { |
| ::test::nullable::StructWithNullableStruct hlcpp; |
| hlcpp.val = ::fidl::NaturalToHLCPP(std::move(value.val())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::StructWithNullableStruct HLCPPToNaturalTraits<::test::nullable::StructWithNullableStruct>::Convert(::test::nullable::StructWithNullableStruct&& value) { |
| return ::test_nullable::StructWithNullableStruct{{ |
| .val = ::fidl::HLCPPToNatural(std::move(value.val)), |
| }}; |
| } |
| ::test::nullable::StructWithNullableUnion NaturalToHLCPPTraits<::test_nullable::StructWithNullableUnion>::Convert(::test_nullable::StructWithNullableUnion&& value) { |
| ::test::nullable::StructWithNullableUnion hlcpp; |
| hlcpp.val = ::fidl::NaturalToHLCPP(std::move(value.val())); |
| return hlcpp; |
| } |
| |
| ::test_nullable::StructWithNullableUnion HLCPPToNaturalTraits<::test::nullable::StructWithNullableUnion>::Convert(::test::nullable::StructWithNullableUnion&& value) { |
| return ::test_nullable::StructWithNullableUnion{{ |
| .val = ::fidl::HLCPPToNatural(std::move(value.val)), |
| }}; |
| } |
| |
| ::test::nullable::SimpleUnion NaturalToHLCPPTraits<::test_nullable::SimpleUnion>::Convert(::test_nullable::SimpleUnion&& value) { |
| ::test::nullable::SimpleUnion hlcpp; |
| switch (value.Which()) { |
| case ::test_nullable::SimpleUnion::Tag::kA: |
| hlcpp.set_a(::fidl::NaturalToHLCPP(std::move(value.a().value()))); |
| break; |
| case ::test_nullable::SimpleUnion::Tag::kB: |
| hlcpp.set_b(::fidl::NaturalToHLCPP(std::move(value.b().value()))); |
| break; |
| default: |
| break; |
| } |
| return hlcpp; |
| } |
| |
| ::test_nullable::SimpleUnion HLCPPToNaturalTraits<::test::nullable::SimpleUnion>::Convert(::test::nullable::SimpleUnion&& value) { |
| using _NaturalUnion = ::test_nullable::SimpleUnion; |
| switch (value.Which()) { |
| case ::test::nullable::SimpleUnion::Tag::kA: |
| return _NaturalUnion::WithA( |
| ::fidl::HLCPPToNatural(std::move(value.a()))); |
| case ::test::nullable::SimpleUnion::Tag::kB: |
| return _NaturalUnion::WithB( |
| ::fidl::HLCPPToNatural(std::move(value.b()))); |
| default: |
| ZX_PANIC("Can't convert invalid strict union %s from HLCPP to Natural", "::test::nullable::SimpleUnion"); |
| } |
| } |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace internal |
| } // namespace fidl |