| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #pragma once |
| |
| #include <fidl/test.time/cpp/natural_types.h> |
| #include <lib/fidl/cpp/hlcpp_conversion.h> |
| #include <lib/fidl/cpp/wire/service_handler.h> |
| #include <test/time/cpp/fidl.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace fidl { |
| namespace internal { |
| |
| template <> |
| struct NaturalToHLCPPTraits<::test_time::AllInstants> { |
| using HLCPPType = ::test::time::AllInstants; |
| static inline ::test::time::AllInstants Convert(::test_time::AllInstants&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::time::AllInstants> { |
| using NaturalType = ::test_time::AllInstants; |
| static inline ::test_time::AllInstants Convert(::test::time::AllInstants&&); |
| }; |
| template <> |
| struct NaturalToHLCPPTraits<::test_time::ComplexInstants> { |
| using HLCPPType = ::test::time::ComplexInstants; |
| static inline ::test::time::ComplexInstants Convert(::test_time::ComplexInstants&&); |
| }; |
| template <> |
| struct HLCPPToNaturalTraits<::test::time::ComplexInstants> { |
| using NaturalType = ::test_time::ComplexInstants; |
| static inline ::test_time::ComplexInstants Convert(::test::time::ComplexInstants&&); |
| }; |
| |
| ::test::time::AllInstants NaturalToHLCPPTraits<::test_time::AllInstants>::Convert(::test_time::AllInstants&& value) { |
| ::test::time::AllInstants hlcpp; |
| hlcpp.monotonic = ::fidl::NaturalToHLCPP(std::move(value.monotonic())); |
| hlcpp.boot = ::fidl::NaturalToHLCPP(std::move(value.boot())); |
| hlcpp.monotonic_ticks = ::fidl::NaturalToHLCPP(std::move(value.monotonic_ticks())); |
| hlcpp.boot_ticks = ::fidl::NaturalToHLCPP(std::move(value.boot_ticks())); |
| return hlcpp; |
| } |
| |
| ::test_time::AllInstants HLCPPToNaturalTraits<::test::time::AllInstants>::Convert(::test::time::AllInstants&& value) { |
| return ::test_time::AllInstants{{ |
| .monotonic = ::fidl::HLCPPToNatural(std::move(value.monotonic)), |
| .boot = ::fidl::HLCPPToNatural(std::move(value.boot)), |
| .monotonic_ticks = ::fidl::HLCPPToNatural(std::move(value.monotonic_ticks)), |
| .boot_ticks = ::fidl::HLCPPToNatural(std::move(value.boot_ticks)), |
| }}; |
| } |
| ::test::time::ComplexInstants NaturalToHLCPPTraits<::test_time::ComplexInstants>::Convert(::test_time::ComplexInstants&& value) { |
| ::test::time::ComplexInstants hlcpp; |
| if (value.monotonic().has_value()) { |
| hlcpp.set_monotonic(::fidl::NaturalToHLCPP(std::move(value.monotonic().value()))); |
| } |
| if (value.boot().has_value()) { |
| hlcpp.set_boot(::fidl::NaturalToHLCPP(std::move(value.boot().value()))); |
| } |
| if (value.monotonic_ticks().has_value()) { |
| hlcpp.set_monotonic_ticks(::fidl::NaturalToHLCPP(std::move(value.monotonic_ticks().value()))); |
| } |
| if (value.boot_ticks().has_value()) { |
| hlcpp.set_boot_ticks(::fidl::NaturalToHLCPP(std::move(value.boot_ticks().value()))); |
| } |
| return hlcpp; |
| } |
| |
| ::test_time::ComplexInstants HLCPPToNaturalTraits<::test::time::ComplexInstants>::Convert(::test::time::ComplexInstants&& value) { |
| ::test_time::ComplexInstants natural; |
| if (value.has_monotonic()) { |
| natural.monotonic() = ::fidl::HLCPPToNatural(std::move(*value.mutable_monotonic())); |
| } |
| if (value.has_boot()) { |
| natural.boot() = ::fidl::HLCPPToNatural(std::move(*value.mutable_boot())); |
| } |
| if (value.has_monotonic_ticks()) { |
| natural.monotonic_ticks() = ::fidl::HLCPPToNatural(std::move(*value.mutable_monotonic_ticks())); |
| } |
| if (value.has_boot_ticks()) { |
| natural.boot_ticks() = ::fidl::HLCPPToNatural(std::move(*value.mutable_boot_ticks())); |
| } |
| return natural; |
| } |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace internal |
| } // namespace fidl |