blob: 4277cc6eee3d7e4de310dbced6354b8a75392a2e [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
// fidl_experiment = output_index_json
#pragma once
#include <lib/fidl/cpp/wire/array.h>
#include <lib/fidl/cpp/wire/envelope.h>
#include <lib/fidl/cpp/wire/internal/framework_err.h>
#include <lib/fidl/cpp/wire/message.h>
#include <lib/fidl/cpp/wire/message_storage.h>
#include <lib/fidl/cpp/wire/object_view.h>
#include <lib/fidl/cpp/wire/string_view.h>
#include <lib/fidl/cpp/wire/traits.h>
#include <lib/fidl/cpp/wire/wire_types.h>
#include <lib/stdcompat/optional.h>
#include <cinttypes>
#ifdef __Fuchsia__
#endif // __Fuchsia__
#include <fidl/test.dependent/cpp/wire_types.h>
#include <fidl/test.importedconstvalues/cpp/common_types.h>
#include <fidl/test.importedconstvalues/cpp/markers.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
namespace test_importedconstvalues {
namespace wire {
struct MyStruct;
struct MyStruct {
uint8_t __reserved = {};
};
constexpr ::test_dependent::wire::MyBits kBitsMember = ::test_dependent::wire::MyBits::kMember;
constexpr ::test_dependent::wire::MyEnum kEnumMember = ::test_dependent::wire::MyEnum::kMember;
} // namespace wire
} // namespace test_importedconstvalues
namespace fidl {
template <>
struct TypeTraits<::test_importedconstvalues::wire::MyStruct> {
static constexpr uint32_t kMaxNumHandles = 0;
static constexpr uint32_t kMaxDepth = 0;
static constexpr uint32_t kPrimarySize = 1;
[[maybe_unused]]
static constexpr uint32_t kMaxOutOfLine = 0;
static constexpr bool kHasFlexibleEnvelope = false;
static constexpr bool kHasPointer = false;
};
template <>
struct IsFidlType<::test_importedconstvalues::wire::MyStruct> : public std::true_type {};
template <>
struct IsWire<::test_importedconstvalues::wire::MyStruct> : public std::true_type {};
template <>
struct IsStruct<::test_importedconstvalues::wire::MyStruct> : public std::true_type {};
static_assert(std::is_standard_layout_v<::test_importedconstvalues::wire::MyStruct>);
static_assert(offsetof(::test_importedconstvalues::wire::MyStruct, __reserved) == 0);
static_assert(sizeof(::test_importedconstvalues::wire::MyStruct) == TypeTraits<::test_importedconstvalues::wire::MyStruct>::kPrimarySize);
template <bool IsRecursive>
struct ::fidl::internal::WireCodingTraits<::test_importedconstvalues::wire::MyStruct, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive> {
static constexpr size_t kInlineSize = 1;
static constexpr auto kMembers = std::make_tuple(::fidl::internal::WireStructMemberCodingInfo<uint8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>());
static constexpr bool kHasPadding = false;
using Base = WireStructCodingTraitsBase<::test_importedconstvalues::wire::MyStruct, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive>;
static constexpr bool kIsMemcpyCompatible = Base::kIsMemcpyCompatible;
static void Encode(
internal::WireEncoder* encoder, ::test_importedconstvalues::wire::MyStruct* value, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) {
if constexpr (kIsMemcpyCompatible) {
memcpy(position.As<void>(), value, sizeof(::test_importedconstvalues::wire::MyStruct));
} else {
internal::WireCodingTraits<uint8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->__reserved, position + 0, recursion_depth);
}
}
static void Decode(
internal::WireDecoder* decoder, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) {
if constexpr (!Base::are_members_memcpy_compatible) {
internal::WireCodingTraits<uint8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode(
decoder, position + 0, recursion_depth);
}
if (*position.As<uint8_t>() != 0) {
decoder->SetError(kCodingErrorInvalidPaddingBytes);
}
}
};
#pragma clang diagnostic pop
} // namespace fidl