blob: 684a40a4f304a0964dc0050a715d5dc158e2cb76 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
// fidl_experiment = output_index_json
#pragma once
#include <fidl/test.doccomments/cpp/natural_types.h>
#include <lib/fidl/cpp/hlcpp_conversion.h>
#include <lib/fidl/cpp/wire/service_handler.h>
#include <test/doccomments/cpp/fidl.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
namespace fidl {
namespace internal {
template <>
struct NaturalToHLCPPTraits<::test_doccomments::MyStrictEnum> : public NaturalToHLCPPTraitsEnum<::test_doccomments::MyStrictEnum, ::test::doccomments::MyStrictEnum, uint32_t> {};
template <>
struct HLCPPToNaturalTraits<::test::doccomments::MyStrictEnum> : public HLCPPToNaturalTraitsEnum<::test::doccomments::MyStrictEnum, ::test_doccomments::MyStrictEnum> {};
template <>
struct NaturalToHLCPPTraits<::test_doccomments::MyFlexibleEnum> : public NaturalToHLCPPTraitsEnum<::test_doccomments::MyFlexibleEnum, ::test::doccomments::MyFlexibleEnum, uint32_t> {};
template <>
struct HLCPPToNaturalTraits<::test::doccomments::MyFlexibleEnum> : public HLCPPToNaturalTraitsEnum<::test::doccomments::MyFlexibleEnum, ::test_doccomments::MyFlexibleEnum> {};
template <>
struct NaturalToHLCPPTraits<::test_doccomments::MyStrictBits> : public NaturalToHLCPPTraitsBits<::test_doccomments::MyStrictBits, ::test::doccomments::MyStrictBits, uint32_t> {};
template <>
struct HLCPPToNaturalTraits<::test::doccomments::MyStrictBits> : public HLCPPToNaturalTraitsBits<::test::doccomments::MyStrictBits, ::test_doccomments::MyStrictBits, uint32_t> {};
template <>
struct NaturalToHLCPPTraits<::test_doccomments::MyFlexibleBits> : public NaturalToHLCPPTraitsBits<::test_doccomments::MyFlexibleBits, ::test::doccomments::MyFlexibleBits, uint32_t> {};
template <>
struct HLCPPToNaturalTraits<::test::doccomments::MyFlexibleBits> : public HLCPPToNaturalTraitsBits<::test::doccomments::MyFlexibleBits, ::test_doccomments::MyFlexibleBits, uint32_t> {};
template <>
struct NaturalToHLCPPTraits<fidl::ClientEnd<::test_doccomments::Interface>> {
using HLCPPType = fidl::InterfaceHandle<::test::doccomments::Interface>;
static inline fidl::InterfaceHandle<::test::doccomments::Interface> Convert(fidl::ClientEnd<::test_doccomments::Interface>&& c) {
return fidl::InterfaceHandle<::test::doccomments::Interface>(c.TakeChannel());
}
};
template <>
struct NaturalToHLCPPTraits<fidl::ServerEnd<::test_doccomments::Interface>> {
using HLCPPType = fidl::InterfaceRequest<::test::doccomments::Interface>;
static inline fidl::InterfaceRequest<::test::doccomments::Interface> Convert(fidl::ServerEnd<::test_doccomments::Interface>&& c) {
return fidl::InterfaceRequest<::test::doccomments::Interface>(c.TakeChannel());
}
};
template <>
struct HLCPPToNaturalTraits<fidl::InterfaceHandle<::test::doccomments::Interface>> {
using NaturalType = fidl::ClientEnd<::test_doccomments::Interface>;
static inline fidl::ClientEnd<::test_doccomments::Interface> Convert(fidl::InterfaceHandle<::test::doccomments::Interface>&& c) {
return fidl::ClientEnd<::test_doccomments::Interface>(c.TakeChannel());
}
};
template <>
struct HLCPPToNaturalTraits<fidl::InterfaceRequest<::test::doccomments::Interface>> {
using NaturalType = fidl::ServerEnd<::test_doccomments::Interface>;
static inline fidl::ServerEnd<::test_doccomments::Interface> Convert(fidl::InterfaceRequest<::test::doccomments::Interface>&& c) {
return fidl::ServerEnd<::test_doccomments::Interface>(c.TakeChannel());
}
};
template <>
struct NaturalToHLCPPTraits<fidl::ProtocolHandler<::test_doccomments::Interface>> {
using HLCPPType = fidl::InterfaceRequestHandler<::test::doccomments::Interface>;
static inline fidl::InterfaceRequestHandler<::test::doccomments::Interface> Convert(fidl::ProtocolHandler<::test_doccomments::Interface>&& c) {
return [c = std::move(c)](fidl::InterfaceRequest<::test::doccomments::Interface> r) {
c(::fidl::HLCPPToNatural(r));
};
}
};
template <>
struct HLCPPToNaturalTraits<fidl::InterfaceRequestHandler<::test::doccomments::Interface>> {
using NaturalType = fidl::ProtocolHandler<::test_doccomments::Interface>;
static inline fidl::ProtocolHandler<::test_doccomments::Interface> Convert(fidl::InterfaceRequestHandler<::test::doccomments::Interface>&& c) {
return [c = std::move(c)](fidl::ServerEnd<::test_doccomments::Interface> r) {
c(::fidl::NaturalToHLCPP(r));
};
}
};
template <>
struct NaturalToHLCPPTraits<::test_doccomments::Struct> {
using HLCPPType = ::test::doccomments::Struct;
static inline ::test::doccomments::Struct Convert(::test_doccomments::Struct&&);
};
template <>
struct HLCPPToNaturalTraits<::test::doccomments::Struct> {
using NaturalType = ::test_doccomments::Struct;
static inline ::test_doccomments::Struct Convert(::test::doccomments::Struct&&);
};
template <>
struct NaturalToHLCPPTraits<::test_doccomments::Table> {
using HLCPPType = ::test::doccomments::Table;
static inline ::test::doccomments::Table Convert(::test_doccomments::Table&&);
};
template <>
struct HLCPPToNaturalTraits<::test::doccomments::Table> {
using NaturalType = ::test_doccomments::Table;
static inline ::test_doccomments::Table Convert(::test::doccomments::Table&&);
};
template <>
struct NaturalToHLCPPTraits<::test_doccomments::StrictUnion> {
using HLCPPType = ::test::doccomments::StrictUnion;
static inline ::test::doccomments::StrictUnion Convert(::test_doccomments::StrictUnion&&);
};
template <>
struct HLCPPToNaturalTraits<::test::doccomments::StrictUnion> {
using NaturalType = ::test_doccomments::StrictUnion;
static inline ::test_doccomments::StrictUnion Convert(::test::doccomments::StrictUnion&&);
};
template <>
struct NaturalToHLCPPTraits<::test_doccomments::FlexibleUnion> {
using HLCPPType = ::test::doccomments::FlexibleUnion;
static inline ::test::doccomments::FlexibleUnion Convert(::test_doccomments::FlexibleUnion&&);
};
template <>
struct HLCPPToNaturalTraits<::test::doccomments::FlexibleUnion> {
using NaturalType = ::test_doccomments::FlexibleUnion;
static inline ::test_doccomments::FlexibleUnion Convert(::test::doccomments::FlexibleUnion&&);
};
::test::doccomments::Struct NaturalToHLCPPTraits<::test_doccomments::Struct>::Convert(::test_doccomments::Struct&& value) {
::test::doccomments::Struct hlcpp;
hlcpp.Field = ::fidl::NaturalToHLCPP(std::move(value.field()));
return hlcpp;
}
::test_doccomments::Struct HLCPPToNaturalTraits<::test::doccomments::Struct>::Convert(::test::doccomments::Struct&& value) {
return ::test_doccomments::Struct{{
.field = ::fidl::HLCPPToNatural(std::move(value.Field)),
}};
}
::test::doccomments::Table NaturalToHLCPPTraits<::test_doccomments::Table>::Convert(::test_doccomments::Table&& value) {
::test::doccomments::Table hlcpp;
if (value.field().has_value()) {
hlcpp.set_Field(::fidl::NaturalToHLCPP(std::move(value.field().value())));
}
return hlcpp;
}
::test_doccomments::Table HLCPPToNaturalTraits<::test::doccomments::Table>::Convert(::test::doccomments::Table&& value) {
::test_doccomments::Table natural;
if (value.has_Field()) {
natural.field() = ::fidl::HLCPPToNatural(std::move(*value.mutable_Field()));
}
return natural;
}
::test::doccomments::StrictUnion NaturalToHLCPPTraits<::test_doccomments::StrictUnion>::Convert(::test_doccomments::StrictUnion&& value) {
::test::doccomments::StrictUnion hlcpp;
switch (value.Which()) {
case ::test_doccomments::StrictUnion::Tag::kField:
hlcpp.set_Field(::fidl::NaturalToHLCPP(std::move(value.field().value())));
break;
default:
break;
}
return hlcpp;
}
::test_doccomments::StrictUnion HLCPPToNaturalTraits<::test::doccomments::StrictUnion>::Convert(::test::doccomments::StrictUnion&& value) {
using _NaturalUnion = ::test_doccomments::StrictUnion;
switch (value.Which()) {
case ::test::doccomments::StrictUnion::Tag::kField:
return _NaturalUnion::WithField(
::fidl::HLCPPToNatural(std::move(value.Field())));
default:
ZX_PANIC("Can't convert invalid strict union %s from HLCPP to Natural", "::test::doccomments::StrictUnion");
}
}
::test::doccomments::FlexibleUnion NaturalToHLCPPTraits<::test_doccomments::FlexibleUnion>::Convert(::test_doccomments::FlexibleUnion&& value) {
::test::doccomments::FlexibleUnion hlcpp;
switch (value.Which()) {
case ::test_doccomments::FlexibleUnion::Tag::kField:
hlcpp.set_Field(::fidl::NaturalToHLCPP(std::move(value.field().value())));
break;
default:
break;
}
return hlcpp;
}
::test_doccomments::FlexibleUnion HLCPPToNaturalTraits<::test::doccomments::FlexibleUnion>::Convert(::test::doccomments::FlexibleUnion&& value) {
using _NaturalUnion = ::test_doccomments::FlexibleUnion;
switch (value.Which()) {
case ::test::doccomments::FlexibleUnion::Tag::kField:
return _NaturalUnion::WithField(
::fidl::HLCPPToNatural(std::move(value.Field())));
default:
return _NaturalUnion(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag{});
}
}
#pragma clang diagnostic pop
} // namespace internal
} // namespace fidl