blob: 0d3857d43568fcec64e1112cc0bb05539de0d7a1 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include "lib/fidl/cpp/internal/header.h"
namespace fidl {
namespace test {
namespace enum_ {
enum class MyStrictEnum : uint32_t {
FOO = 1u,
BAR = 2u,
};
inline zx_status_t Clone(::fidl::test::enum_::MyStrictEnum value,
::fidl::test::enum_::MyStrictEnum* result) {
*result = value;
return ZX_OK;
}
enum class MyFlexibleEnumWithCustomUnknown : uint32_t {
FOO = 1u,
BAR = 2u,
CUSTOM_UNKNOWN = 3u,
};
inline zx_status_t Clone(
::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown value,
::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown* result) {
*result = value;
return ZX_OK;
}
enum class MyFlexibleEnum : uint32_t {
FOO = 1u,
BAR = 2u,
};
inline zx_status_t Clone(::fidl::test::enum_::MyFlexibleEnum value,
::fidl::test::enum_::MyFlexibleEnum* result) {
*result = value;
return ZX_OK;
}
} // namespace enum_
} // namespace test
} // namespace fidl
namespace fidl {
template <>
struct CodingTraits<::fidl::test::enum_::MyStrictEnum> {
static constexpr size_t inline_size_old =
sizeof(::fidl::test::enum_::MyStrictEnum);
static constexpr size_t inline_size_v1_no_ee =
sizeof(::fidl::test::enum_::MyStrictEnum);
static void Encode(Encoder* encoder, ::fidl::test::enum_::MyStrictEnum* value,
size_t offset) {
uint32_t underlying = static_cast<uint32_t>(*value);
::fidl::Encode(encoder, &underlying, offset);
}
static void Decode(Decoder* decoder, ::fidl::test::enum_::MyStrictEnum* value,
size_t offset) {
uint32_t underlying = {};
::fidl::Decode(decoder, &underlying, offset);
*value = static_cast<::fidl::test::enum_::MyStrictEnum>(underlying);
}
};
inline zx_status_t Clone(::fidl::test::enum_::MyStrictEnum value,
::fidl::test::enum_::MyStrictEnum* result) {
return ::fidl::test::enum_::Clone(value, result);
}
template <>
struct Equality<::fidl::test::enum_::MyStrictEnum> {
bool operator()(const ::fidl::test::enum_::MyStrictEnum& _lhs,
const ::fidl::test::enum_::MyStrictEnum& _rhs) const {
return _lhs == _rhs;
}
};
template <>
struct CodingTraits<::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown> {
static constexpr size_t inline_size_old =
sizeof(::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown);
static constexpr size_t inline_size_v1_no_ee =
sizeof(::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown);
static void Encode(
Encoder* encoder,
::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown* value,
size_t offset) {
uint32_t underlying = static_cast<uint32_t>(*value);
::fidl::Encode(encoder, &underlying, offset);
}
static void Decode(
Decoder* decoder,
::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown* value,
size_t offset) {
uint32_t underlying = {};
::fidl::Decode(decoder, &underlying, offset);
*value = static_cast<::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown>(
underlying);
}
};
inline zx_status_t Clone(
::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown value,
::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown* result) {
return ::fidl::test::enum_::Clone(value, result);
}
template <>
struct Equality<::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown> {
bool operator()(
const ::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown& _lhs,
const ::fidl::test::enum_::MyFlexibleEnumWithCustomUnknown& _rhs) const {
return _lhs == _rhs;
}
};
template <>
struct CodingTraits<::fidl::test::enum_::MyFlexibleEnum> {
static constexpr size_t inline_size_old =
sizeof(::fidl::test::enum_::MyFlexibleEnum);
static constexpr size_t inline_size_v1_no_ee =
sizeof(::fidl::test::enum_::MyFlexibleEnum);
static void Encode(Encoder* encoder,
::fidl::test::enum_::MyFlexibleEnum* value,
size_t offset) {
uint32_t underlying = static_cast<uint32_t>(*value);
::fidl::Encode(encoder, &underlying, offset);
}
static void Decode(Decoder* decoder,
::fidl::test::enum_::MyFlexibleEnum* value,
size_t offset) {
uint32_t underlying = {};
::fidl::Decode(decoder, &underlying, offset);
*value = static_cast<::fidl::test::enum_::MyFlexibleEnum>(underlying);
}
};
inline zx_status_t Clone(::fidl::test::enum_::MyFlexibleEnum value,
::fidl::test::enum_::MyFlexibleEnum* result) {
return ::fidl::test::enum_::Clone(value, result);
}
template <>
struct Equality<::fidl::test::enum_::MyFlexibleEnum> {
bool operator()(const ::fidl::test::enum_::MyFlexibleEnum& _lhs,
const ::fidl::test::enum_::MyFlexibleEnum& _rhs) const {
return _lhs == _rhs;
}
};
} // namespace fidl