blob: 28f3ead438ad2efc5d7b2a41fa271ba955d8ebf3 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
// fidl_experiment = output_index_json
#pragma once
#include <fidl/test.handlesintypes/cpp/natural_types.h>
#include <lib/fidl/cpp/hlcpp_conversion.h>
#include <lib/fidl/cpp/wire/service_handler.h>
#include <test/handlesintypes/cpp/fidl.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
namespace fidl {
namespace internal {
template <>
struct NaturalToHLCPPTraits<::test_handlesintypes::ObjType> : public NaturalToHLCPPTraitsEnum<::test_handlesintypes::ObjType, ::test::handlesintypes::obj_type, uint32_t> {};
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::EmptyResourceStruct> {
using HLCPPType = ::test::handlesintypes::EmptyResourceStruct;
static inline ::test::handlesintypes::EmptyResourceStruct Convert(::test_handlesintypes::EmptyResourceStruct&&);
};
template <>
struct HLCPPToNaturalTraits<::test::handlesintypes::EmptyResourceStruct> {
using NaturalType = ::test_handlesintypes::EmptyResourceStruct;
static inline ::test_handlesintypes::EmptyResourceStruct Convert(::test::handlesintypes::EmptyResourceStruct&&);
};
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::EmptyResourceTable> {
using HLCPPType = ::test::handlesintypes::EmptyResourceTable;
static inline ::test::handlesintypes::EmptyResourceTable Convert(::test_handlesintypes::EmptyResourceTable&&);
};
template <>
struct HLCPPToNaturalTraits<::test::handlesintypes::EmptyResourceTable> {
using NaturalType = ::test_handlesintypes::EmptyResourceTable;
static inline ::test_handlesintypes::EmptyResourceTable Convert(::test::handlesintypes::EmptyResourceTable&&);
};
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&&);
};
template <>
struct NaturalToHLCPPTraits<::test_handlesintypes::EmptyResourceUnion> {
using HLCPPType = ::test::handlesintypes::EmptyResourceUnion;
static inline ::test::handlesintypes::EmptyResourceUnion Convert(::test_handlesintypes::EmptyResourceUnion&&);
};
template <>
struct HLCPPToNaturalTraits<::test::handlesintypes::EmptyResourceUnion> {
using NaturalType = ::test_handlesintypes::EmptyResourceUnion;
static inline ::test_handlesintypes::EmptyResourceUnion Convert(::test::handlesintypes::EmptyResourceUnion&&);
};
::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::EmptyResourceStruct NaturalToHLCPPTraits<::test_handlesintypes::EmptyResourceStruct>::Convert(::test_handlesintypes::EmptyResourceStruct&& value) {
::test::handlesintypes::EmptyResourceStruct hlcpp;
hlcpp.__reserved = ::fidl::NaturalToHLCPP(std::move(value.__reserved()));
return hlcpp;
}
::test_handlesintypes::EmptyResourceStruct HLCPPToNaturalTraits<::test::handlesintypes::EmptyResourceStruct>::Convert(::test::handlesintypes::EmptyResourceStruct&& value) {
return ::test_handlesintypes::EmptyResourceStruct{{
.__reserved = ::fidl::HLCPPToNatural(std::move(value.__reserved)),
}};
}
::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::EmptyResourceTable NaturalToHLCPPTraits<::test_handlesintypes::EmptyResourceTable>::Convert(::test_handlesintypes::EmptyResourceTable&& value) {
::test::handlesintypes::EmptyResourceTable hlcpp;
return hlcpp;
}
::test_handlesintypes::EmptyResourceTable HLCPPToNaturalTraits<::test::handlesintypes::EmptyResourceTable>::Convert(::test::handlesintypes::EmptyResourceTable&& value) {
::test_handlesintypes::EmptyResourceTable natural;
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(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag{});
}
}
::test::handlesintypes::EmptyResourceUnion NaturalToHLCPPTraits<::test_handlesintypes::EmptyResourceUnion>::Convert(::test_handlesintypes::EmptyResourceUnion&& value) {
::test::handlesintypes::EmptyResourceUnion hlcpp;
switch (value.Which()) {
default:
break;
}
return hlcpp;
}
::test_handlesintypes::EmptyResourceUnion HLCPPToNaturalTraits<::test::handlesintypes::EmptyResourceUnion>::Convert(::test::handlesintypes::EmptyResourceUnion&& value) {
using _NaturalUnion = ::test_handlesintypes::EmptyResourceUnion;
switch (value.Which()) {
default:
return _NaturalUnion(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag{});
}
}
#pragma clang diagnostic pop
} // namespace internal
} // namespace fidl