| // 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.byteandbytes/cpp/common_types.h> |
| #include <fidl/test.byteandbytes/cpp/markers.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace test_byteandbytes { |
| |
| namespace wire { |
| |
| struct ByteAndBytes; |
| |
| struct ByteAndBytes { |
| uint8_t single_byte = {}; |
| }; |
| |
| } // namespace wire |
| } // namespace test_byteandbytes |
| namespace fidl { |
| |
| template <> |
| struct TypeTraits<::test_byteandbytes::wire::ByteAndBytes> { |
| 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_byteandbytes::wire::ByteAndBytes> : public std::true_type {}; |
| template <> |
| struct IsWire<::test_byteandbytes::wire::ByteAndBytes> : public std::true_type {}; |
| template <> |
| struct IsStruct<::test_byteandbytes::wire::ByteAndBytes> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::test_byteandbytes::wire::ByteAndBytes>); |
| static_assert(offsetof(::test_byteandbytes::wire::ByteAndBytes, single_byte) == 0); |
| static_assert(sizeof(::test_byteandbytes::wire::ByteAndBytes) == TypeTraits<::test_byteandbytes::wire::ByteAndBytes>::kPrimarySize); |
| |
| template <bool IsRecursive> |
| struct ::fidl::internal::WireCodingTraits<::test_byteandbytes::wire::ByteAndBytes, ::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_byteandbytes::wire::ByteAndBytes, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive>; |
| static constexpr bool kIsMemcpyCompatible = Base::kIsMemcpyCompatible; |
| |
| static void Encode( |
| internal::WireEncoder* encoder, ::test_byteandbytes::wire::ByteAndBytes* value, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) { |
| if constexpr (kIsMemcpyCompatible) { |
| memcpy(position.As<void>(), value, sizeof(::test_byteandbytes::wire::ByteAndBytes)); |
| } else { |
| internal::WireCodingTraits<uint8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->single_byte, 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); |
| } |
| } |
| }; |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace fidl |