| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #include <fidl/test.placementofattributes/cpp/type_conversions.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace fidl { |
| namespace internal { |
| |
| ::test_placementofattributes::ExampleProtocolMethodRequest WireNaturalConversionTraits<::test_placementofattributes::wire::ExampleProtocolMethodRequest, ::test_placementofattributes::ExampleProtocolMethodRequest>::ToNatural(::test_placementofattributes::wire::ExampleProtocolMethodRequest src) { |
| return ::test_placementofattributes::ExampleProtocolMethodRequest(WireNaturalConversionTraits<::test_exampleusing::wire::Empty, ::test_exampleusing::Empty>::ToNatural(std::move(src.arg))); |
| } |
| ::test_placementofattributes::wire::ExampleProtocolMethodRequest WireNaturalConversionTraits<::test_placementofattributes::wire::ExampleProtocolMethodRequest, ::test_placementofattributes::ExampleProtocolMethodRequest>::ToWire(fidl::AnyArena& arena, ::test_placementofattributes::ExampleProtocolMethodRequest src) { |
| return ::test_placementofattributes::wire::ExampleProtocolMethodRequest{ |
| .arg = WireNaturalConversionTraits<::test_exampleusing::wire::Empty, ::test_exampleusing::Empty>::ToWire(arena, std::move(src.arg())), |
| }; |
| } |
| |
| ::test_placementofattributes::ExampleStruct WireNaturalConversionTraits<::test_placementofattributes::wire::ExampleStruct, ::test_placementofattributes::ExampleStruct>::ToNatural(::test_placementofattributes::wire::ExampleStruct src) { |
| return ::test_placementofattributes::ExampleStruct(WireNaturalConversionTraits<uint32_t, uint32_t>::ToNatural(std::move(src.member))); |
| } |
| ::test_placementofattributes::wire::ExampleStruct WireNaturalConversionTraits<::test_placementofattributes::wire::ExampleStruct, ::test_placementofattributes::ExampleStruct>::ToWire(fidl::AnyArena& arena, ::test_placementofattributes::ExampleStruct src) { |
| return ::test_placementofattributes::wire::ExampleStruct{ |
| .member = WireNaturalConversionTraits<uint32_t, uint32_t>::ToWire(arena, std::move(src.member())), |
| }; |
| } |
| |
| ::test_placementofattributes::ExampleTable WireNaturalConversionTraits<::test_placementofattributes::wire::ExampleTable, ::test_placementofattributes::ExampleTable>::ToNatural(::test_placementofattributes::wire::ExampleTable src) { |
| ::test_placementofattributes::ExampleTable dst; |
| if (src.has_member()) { |
| dst.member() = |
| WireNaturalConversionTraits<uint32_t, uint32_t>::ToNatural(std::move(src.member())); |
| } |
| |
| return dst; |
| } |
| ::test_placementofattributes::wire::ExampleTable WireNaturalConversionTraits<::test_placementofattributes::wire::ExampleTable, ::test_placementofattributes::ExampleTable>::ToWire(fidl::AnyArena& arena, ::test_placementofattributes::ExampleTable src) { |
| auto builder = ::test_placementofattributes::wire::ExampleTable::Builder(arena); |
| if (src.member().has_value()) { |
| builder.member( |
| WireNaturalConversionTraits<uint32_t, uint32_t>::ToWire(arena, std::move(src.member().value()))); |
| } |
| return builder.Build(); |
| } |
| |
| ::test_placementofattributes::ExampleUnion WireNaturalConversionTraits<::test_placementofattributes::wire::ExampleUnion, ::test_placementofattributes::ExampleUnion>::ToNatural(::test_placementofattributes::wire::ExampleUnion src) { |
| switch (src.Which()) { |
| case ::test_placementofattributes::wire::ExampleUnion::Tag::kVariant: |
| return ::test_placementofattributes::ExampleUnion::WithVariant( |
| WireNaturalConversionTraits<uint32_t, uint32_t>::ToNatural(std::move(src.variant()))); |
| default: |
| ZX_PANIC("unknown union tag in strict union"); |
| } |
| } |
| ::test_placementofattributes::wire::ExampleUnion WireNaturalConversionTraits<::test_placementofattributes::wire::ExampleUnion, ::test_placementofattributes::ExampleUnion>::ToWire(fidl::AnyArena& arena, ::test_placementofattributes::ExampleUnion src) { |
| switch (src.Which()) { |
| case ::test_placementofattributes::ExampleUnion::Tag::kVariant: |
| return ::test_placementofattributes::wire::ExampleUnion::WithVariant( |
| WireNaturalConversionTraits<uint32_t, uint32_t>::ToWire(arena, std::move(src.variant().value()))); |
| } |
| } |
| |
| #ifdef __Fuchsia__ |
| |
| #endif // __Fuchsia__ |
| #pragma clang diagnostic pop |
| |
| } // namespace internal |
| } // namespace fidl |