blob: 92acb4e884de96e04036d17cfd6a7b62f1725f54 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
// fidl_experiment = output_index_json
#pragma once
#include <fidl/test.versions/cpp/natural_types.h>
#include <lib/fidl/cpp/hlcpp_conversion.h>
#include <lib/fidl/cpp/wire/service_handler.h>
#include <test/versions/cpp/fidl.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
namespace fidl {
namespace internal {
template <>
struct NaturalToHLCPPTraits<::test_versions::Enum> : public NaturalToHLCPPTraitsEnum<::test_versions::Enum, ::test::versions::Enum, uint32_t> {};
template <>
struct HLCPPToNaturalTraits<::test::versions::Enum> : public HLCPPToNaturalTraitsEnum<::test::versions::Enum, ::test_versions::Enum> {};
template <>
struct NaturalToHLCPPTraits<::test_versions::Bits> : public NaturalToHLCPPTraitsBits<::test_versions::Bits, ::test::versions::Bits, uint32_t> {};
template <>
struct HLCPPToNaturalTraits<::test::versions::Bits> : public HLCPPToNaturalTraitsBits<::test::versions::Bits, ::test_versions::Bits, uint32_t> {};
template <>
struct NaturalToHLCPPTraits<fidl::ClientEnd<::test_versions::OtherProtocol>> {
using HLCPPType = fidl::InterfaceHandle<::test::versions::OtherProtocol>;
static inline fidl::InterfaceHandle<::test::versions::OtherProtocol> Convert(fidl::ClientEnd<::test_versions::OtherProtocol>&& c) {
return fidl::InterfaceHandle<::test::versions::OtherProtocol>(c.TakeChannel());
}
};
template <>
struct NaturalToHLCPPTraits<fidl::ServerEnd<::test_versions::OtherProtocol>> {
using HLCPPType = fidl::InterfaceRequest<::test::versions::OtherProtocol>;
static inline fidl::InterfaceRequest<::test::versions::OtherProtocol> Convert(fidl::ServerEnd<::test_versions::OtherProtocol>&& c) {
return fidl::InterfaceRequest<::test::versions::OtherProtocol>(c.TakeChannel());
}
};
template <>
struct HLCPPToNaturalTraits<fidl::InterfaceHandle<::test::versions::OtherProtocol>> {
using NaturalType = fidl::ClientEnd<::test_versions::OtherProtocol>;
static inline fidl::ClientEnd<::test_versions::OtherProtocol> Convert(fidl::InterfaceHandle<::test::versions::OtherProtocol>&& c) {
return fidl::ClientEnd<::test_versions::OtherProtocol>(c.TakeChannel());
}
};
template <>
struct HLCPPToNaturalTraits<fidl::InterfaceRequest<::test::versions::OtherProtocol>> {
using NaturalType = fidl::ServerEnd<::test_versions::OtherProtocol>;
static inline fidl::ServerEnd<::test_versions::OtherProtocol> Convert(fidl::InterfaceRequest<::test::versions::OtherProtocol>&& c) {
return fidl::ServerEnd<::test_versions::OtherProtocol>(c.TakeChannel());
}
};
template <>
struct NaturalToHLCPPTraits<fidl::ProtocolHandler<::test_versions::OtherProtocol>> {
using HLCPPType = fidl::InterfaceRequestHandler<::test::versions::OtherProtocol>;
static inline fidl::InterfaceRequestHandler<::test::versions::OtherProtocol> Convert(fidl::ProtocolHandler<::test_versions::OtherProtocol>&& c) {
return [c = std::move(c)](fidl::InterfaceRequest<::test::versions::OtherProtocol> r) {
c(::fidl::HLCPPToNatural(r));
};
}
};
template <>
struct HLCPPToNaturalTraits<fidl::InterfaceRequestHandler<::test::versions::OtherProtocol>> {
using NaturalType = fidl::ProtocolHandler<::test_versions::OtherProtocol>;
static inline fidl::ProtocolHandler<::test_versions::OtherProtocol> Convert(fidl::InterfaceRequestHandler<::test::versions::OtherProtocol>&& c) {
return [c = std::move(c)](fidl::ServerEnd<::test_versions::OtherProtocol> r) {
c(::fidl::NaturalToHLCPP(r));
};
}
};
template <>
struct NaturalToHLCPPTraits<fidl::ClientEnd<::test_versions::Protocol>> {
using HLCPPType = fidl::InterfaceHandle<::test::versions::Protocol>;
static inline fidl::InterfaceHandle<::test::versions::Protocol> Convert(fidl::ClientEnd<::test_versions::Protocol>&& c) {
return fidl::InterfaceHandle<::test::versions::Protocol>(c.TakeChannel());
}
};
template <>
struct NaturalToHLCPPTraits<fidl::ServerEnd<::test_versions::Protocol>> {
using HLCPPType = fidl::InterfaceRequest<::test::versions::Protocol>;
static inline fidl::InterfaceRequest<::test::versions::Protocol> Convert(fidl::ServerEnd<::test_versions::Protocol>&& c) {
return fidl::InterfaceRequest<::test::versions::Protocol>(c.TakeChannel());
}
};
template <>
struct HLCPPToNaturalTraits<fidl::InterfaceHandle<::test::versions::Protocol>> {
using NaturalType = fidl::ClientEnd<::test_versions::Protocol>;
static inline fidl::ClientEnd<::test_versions::Protocol> Convert(fidl::InterfaceHandle<::test::versions::Protocol>&& c) {
return fidl::ClientEnd<::test_versions::Protocol>(c.TakeChannel());
}
};
template <>
struct HLCPPToNaturalTraits<fidl::InterfaceRequest<::test::versions::Protocol>> {
using NaturalType = fidl::ServerEnd<::test_versions::Protocol>;
static inline fidl::ServerEnd<::test_versions::Protocol> Convert(fidl::InterfaceRequest<::test::versions::Protocol>&& c) {
return fidl::ServerEnd<::test_versions::Protocol>(c.TakeChannel());
}
};
template <>
struct NaturalToHLCPPTraits<fidl::ProtocolHandler<::test_versions::Protocol>> {
using HLCPPType = fidl::InterfaceRequestHandler<::test::versions::Protocol>;
static inline fidl::InterfaceRequestHandler<::test::versions::Protocol> Convert(fidl::ProtocolHandler<::test_versions::Protocol>&& c) {
return [c = std::move(c)](fidl::InterfaceRequest<::test::versions::Protocol> r) {
c(::fidl::HLCPPToNatural(r));
};
}
};
template <>
struct HLCPPToNaturalTraits<fidl::InterfaceRequestHandler<::test::versions::Protocol>> {
using NaturalType = fidl::ProtocolHandler<::test_versions::Protocol>;
static inline fidl::ProtocolHandler<::test_versions::Protocol> Convert(fidl::InterfaceRequestHandler<::test::versions::Protocol>&& c) {
return [c = std::move(c)](fidl::ServerEnd<::test_versions::Protocol> r) {
c(::fidl::NaturalToHLCPP(r));
};
}
};
template <>
struct NaturalToHLCPPTraits<::test_versions::Struct> {
using HLCPPType = ::test::versions::Struct;
static inline ::test::versions::Struct Convert(::test_versions::Struct&&);
};
template <>
struct HLCPPToNaturalTraits<::test::versions::Struct> {
using NaturalType = ::test_versions::Struct;
static inline ::test_versions::Struct Convert(::test::versions::Struct&&);
};
template <>
struct NaturalToHLCPPTraits<::test_versions::Table> {
using HLCPPType = ::test::versions::Table;
static inline ::test::versions::Table Convert(::test_versions::Table&&);
};
template <>
struct HLCPPToNaturalTraits<::test::versions::Table> {
using NaturalType = ::test_versions::Table;
static inline ::test_versions::Table Convert(::test::versions::Table&&);
};
template <>
struct NaturalToHLCPPTraits<::test_versions::Union> {
using HLCPPType = ::test::versions::Union;
static inline ::test::versions::Union Convert(::test_versions::Union&&);
};
template <>
struct HLCPPToNaturalTraits<::test::versions::Union> {
using NaturalType = ::test_versions::Union;
static inline ::test_versions::Union Convert(::test::versions::Union&&);
};
::test::versions::Struct NaturalToHLCPPTraits<::test_versions::Struct>::Convert(::test_versions::Struct&& value) {
::test::versions::Struct hlcpp;
hlcpp.x = ::fidl::NaturalToHLCPP(std::move(value.x()));
return hlcpp;
}
::test_versions::Struct HLCPPToNaturalTraits<::test::versions::Struct>::Convert(::test::versions::Struct&& value) {
return ::test_versions::Struct{{
.x = ::fidl::HLCPPToNatural(std::move(value.x)),
}};
}
::test::versions::Table NaturalToHLCPPTraits<::test_versions::Table>::Convert(::test_versions::Table&& value) {
::test::versions::Table hlcpp;
if (value.x().has_value()) {
hlcpp.set_x(::fidl::NaturalToHLCPP(std::move(value.x().value())));
}
return hlcpp;
}
::test_versions::Table HLCPPToNaturalTraits<::test::versions::Table>::Convert(::test::versions::Table&& value) {
::test_versions::Table natural;
if (value.has_x()) {
natural.x() = ::fidl::HLCPPToNatural(std::move(*value.mutable_x()));
}
return natural;
}
::test::versions::Union NaturalToHLCPPTraits<::test_versions::Union>::Convert(::test_versions::Union&& value) {
::test::versions::Union hlcpp;
switch (value.Which()) {
case ::test_versions::Union::Tag::kX:
hlcpp.set_x(::fidl::NaturalToHLCPP(std::move(value.x().value())));
break;
default:
break;
}
return hlcpp;
}
::test_versions::Union HLCPPToNaturalTraits<::test::versions::Union>::Convert(::test::versions::Union&& value) {
using _NaturalUnion = ::test_versions::Union;
switch (value.Which()) {
case ::test::versions::Union::Tag::kX:
return _NaturalUnion::WithX(
::fidl::HLCPPToNatural(std::move(value.x())));
default:
return _NaturalUnion(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag{});
}
}
#pragma clang diagnostic pop
} // namespace internal
} // namespace fidl