blob: 369df3764a0a0a77d63c6403c6cbf1f728372ae6 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <fidl/test.handlesintypes/cpp/natural_types.h>
#include <lib/fidl/cpp/hlcpp_conversion.h>
#include <lib/fidl/llcpp/internal/transport_channel.h>
#include <test/handlesintypes/cpp/fidl.h>
namespace fidl {
namespace internal {
template <>
struct NaturalToHLCPPTraits<::test_handlesintypes::ObjType> : public NaturalToHLCPPTraitsEnum<::test_handlesintypes::ObjType, ::test::handlesintypes::obj_type> {};
template <>
struct HLCPPToNaturalTraits<::test::handlesintypes::obj_type> : public HLCPPToNaturalTraitsEnum<::test::handlesintypes::obj_type, ::test_handlesintypes::ObjType> {};
template <>
struct NaturalToHLCPPTraits<::test_handlesintypes::HandlesInTypes> {
using HLCPPType = ::test::handlesintypes::HandlesInTypes;
static inline ::test::handlesintypes::HandlesInTypes Convert(::test_handlesintypes::HandlesInTypes&&);
};
template <>
struct HLCPPToNaturalTraits<::test::handlesintypes::HandlesInTypes> {
using NaturalType = ::test_handlesintypes::HandlesInTypes;
static inline ::test_handlesintypes::HandlesInTypes Convert(::test::handlesintypes::HandlesInTypes&&);
};
template <>
struct NaturalToHLCPPTraits<::test_handlesintypes::TableWithHandle> {
using HLCPPType = ::test::handlesintypes::TableWithHandle;
static inline ::test::handlesintypes::TableWithHandle Convert(::test_handlesintypes::TableWithHandle&&);
};
template <>
struct HLCPPToNaturalTraits<::test::handlesintypes::TableWithHandle> {
using NaturalType = ::test_handlesintypes::TableWithHandle;
static inline ::test_handlesintypes::TableWithHandle Convert(::test::handlesintypes::TableWithHandle&&);
};
template <>
struct NaturalToHLCPPTraits<::test_handlesintypes::UnionWithHandle> {
using HLCPPType = ::test::handlesintypes::UnionWithHandle;
static inline ::test::handlesintypes::UnionWithHandle Convert(::test_handlesintypes::UnionWithHandle&&);
};
template <>
struct HLCPPToNaturalTraits<::test::handlesintypes::UnionWithHandle> {
using NaturalType = ::test_handlesintypes::UnionWithHandle;
static inline ::test_handlesintypes::UnionWithHandle Convert(::test::handlesintypes::UnionWithHandle&&);
};
::test::handlesintypes::HandlesInTypes NaturalToHLCPPTraits<::test_handlesintypes::HandlesInTypes>::Convert(::test_handlesintypes::HandlesInTypes&& value) {
::test::handlesintypes::HandlesInTypes hlcpp;
hlcpp.normal_handle = ::fidl::NaturalToHLCPP(std::move(value.normal_handle()));
hlcpp.handle_in_vec = ::fidl::NaturalToHLCPP(std::move(value.handle_in_vec()));
hlcpp.handle_in_array = ::fidl::NaturalToHLCPP(std::move(value.handle_in_array()));
hlcpp.handle_in_mixed_vec_array = ::fidl::NaturalToHLCPP(std::move(value.handle_in_mixed_vec_array()));
hlcpp.table_with_handle = ::fidl::NaturalToHLCPP(std::move(value.table_with_handle()));
hlcpp.union_with_handle = ::fidl::NaturalToHLCPP(std::move(value.union_with_handle()));
return hlcpp;
}
::test_handlesintypes::HandlesInTypes HLCPPToNaturalTraits<::test::handlesintypes::HandlesInTypes>::Convert(::test::handlesintypes::HandlesInTypes&& value) {
return ::test_handlesintypes::HandlesInTypes{{
.normal_handle = ::fidl::HLCPPToNatural(std::move(value.normal_handle)),
.handle_in_vec = ::fidl::HLCPPToNatural(std::move(value.handle_in_vec)),
.handle_in_array = ::fidl::HLCPPToNatural(std::move(value.handle_in_array)),
.handle_in_mixed_vec_array = ::fidl::HLCPPToNatural(std::move(value.handle_in_mixed_vec_array)),
.table_with_handle = ::fidl::HLCPPToNatural(std::move(value.table_with_handle)),
.union_with_handle = ::fidl::HLCPPToNatural(std::move(value.union_with_handle)),
}};
}
::test::handlesintypes::TableWithHandle NaturalToHLCPPTraits<::test_handlesintypes::TableWithHandle>::Convert(::test_handlesintypes::TableWithHandle&& value) {
::test::handlesintypes::TableWithHandle hlcpp;
if (value.h().has_value()) {
hlcpp.set_h(::fidl::NaturalToHLCPP(std::move(value.h().value())));
}
return hlcpp;
}
::test_handlesintypes::TableWithHandle HLCPPToNaturalTraits<::test::handlesintypes::TableWithHandle>::Convert(::test::handlesintypes::TableWithHandle&& value) {
::test_handlesintypes::TableWithHandle natural;
if (value.has_h()) {
natural.h() = ::fidl::HLCPPToNatural(std::move(*value.mutable_h()));
}
return natural;
}
::test::handlesintypes::UnionWithHandle NaturalToHLCPPTraits<::test_handlesintypes::UnionWithHandle>::Convert(::test_handlesintypes::UnionWithHandle&& value) {
::test::handlesintypes::UnionWithHandle hlcpp;
switch (value.Which()) {
case ::test_handlesintypes::UnionWithHandle::Tag::kH:
hlcpp.set_h(::fidl::NaturalToHLCPP(std::move(value.h().value())));
break;
default:
break;
}
return hlcpp;
}
::test_handlesintypes::UnionWithHandle HLCPPToNaturalTraits<::test::handlesintypes::UnionWithHandle>::Convert(::test::handlesintypes::UnionWithHandle&& value) {
using _NaturalUnion = ::test_handlesintypes::UnionWithHandle;
switch (value.Which()) {
case ::test::handlesintypes::UnionWithHandle::Tag::kH:
return _NaturalUnion::WithH(
::fidl::HLCPPToNatural(std::move(value.h())));
default:
return _NaturalUnion();
}
}
} // namespace internal
} // namespace fidl