| // 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__ |
| #include <lib/zx/handle.h> |
| |
| #endif // __Fuchsia__ |
| |
| #include <fidl/test.encapsulatedstructs/cpp/common_types.h> |
| #include <fidl/test.encapsulatedstructs/cpp/markers.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace test_encapsulatedstructs { |
| |
| namespace wire { |
| |
| struct Int8Int32; |
| |
| struct Int16Int8; |
| |
| struct ArrayInt16Int8; |
| |
| struct StructPaddingTestStruct; |
| |
| struct NonInlineStructTestStruct; |
| |
| struct TopLevelStruct; |
| |
| struct Int16Int8 { |
| int16_t a = {}; |
| |
| int8_t b = {}; |
| }; |
| |
| struct Int8Int32 { |
| int8_t a = {}; |
| |
| int32_t b = {}; |
| }; |
| |
| struct ArrayInt16Int8 { |
| ::fidl::Array<::test_encapsulatedstructs::wire::Int16Int8, 3> arr = {}; |
| }; |
| |
| struct StructPaddingTestStruct { |
| ::test_encapsulatedstructs::wire::Int16Int8 trailing = {}; |
| |
| ::test_encapsulatedstructs::wire::Int8Int32 inner = {}; |
| |
| ::test_encapsulatedstructs::wire::ArrayInt16Int8 array = {}; |
| }; |
| |
| #ifdef __Fuchsia__ |
| |
| struct NonInlineStructTestStruct { |
| ::fidl::ObjectView<::test_encapsulatedstructs::wire::Int16Int8> element = {}; |
| |
| ::zx::handle h = {}; |
| |
| void _CloseHandles(); |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| struct TopLevelStruct { |
| ::test_encapsulatedstructs::wire::StructPaddingTestStruct a = {}; |
| |
| ::test_encapsulatedstructs::wire::NonInlineStructTestStruct b = {}; |
| |
| void _CloseHandles(); |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| } // namespace wire |
| } // namespace test_encapsulatedstructs |
| namespace fidl { |
| |
| template <> |
| struct TypeTraits<::test_encapsulatedstructs::wire::Int8Int32> { |
| static constexpr uint32_t kMaxNumHandles = 0; |
| static constexpr uint32_t kMaxDepth = 0; |
| static constexpr uint32_t kPrimarySize = 8; |
| [[maybe_unused]] |
| static constexpr uint32_t kMaxOutOfLine = 0; |
| static constexpr bool kHasFlexibleEnvelope = false; |
| static constexpr bool kHasPointer = false; |
| }; |
| |
| template <> |
| struct IsFidlType<::test_encapsulatedstructs::wire::Int8Int32> : public std::true_type {}; |
| template <> |
| struct IsWire<::test_encapsulatedstructs::wire::Int8Int32> : public std::true_type {}; |
| template <> |
| struct IsStruct<::test_encapsulatedstructs::wire::Int8Int32> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::test_encapsulatedstructs::wire::Int8Int32>); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::Int8Int32, a) == 0); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::Int8Int32, b) == 4); |
| static_assert(sizeof(::test_encapsulatedstructs::wire::Int8Int32) == TypeTraits<::test_encapsulatedstructs::wire::Int8Int32>::kPrimarySize); |
| |
| template <bool IsRecursive> |
| struct ::fidl::internal::WireCodingTraits<::test_encapsulatedstructs::wire::Int8Int32, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive> { |
| static constexpr size_t kInlineSize = 8; |
| static constexpr auto kMembers = std::make_tuple(::fidl::internal::WireStructMemberCodingInfo<int8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>(), ::fidl::internal::WireStructMemberCodingInfo<int32_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>()); |
| static constexpr bool kHasPadding = true; |
| using Base = WireStructCodingTraitsBase<::test_encapsulatedstructs::wire::Int8Int32, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive>; |
| static constexpr bool kIsMemcpyCompatible = Base::kIsMemcpyCompatible; |
| |
| static void Encode( |
| internal::WireEncoder* encoder, ::test_encapsulatedstructs::wire::Int8Int32* value, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) { |
| if constexpr (kIsMemcpyCompatible) { |
| memcpy(position.As<void>(), value, sizeof(::test_encapsulatedstructs::wire::Int8Int32)); |
| } else { |
| internal::WireZeroPadding<uint32_t>(encoder, position + 0); |
| internal::WireCodingTraits<int8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->a, position + 0, recursion_depth); |
| internal::WireCodingTraits<int32_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->b, position + 4, 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<int8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 0, recursion_depth); |
| internal::WireCodingTraits<int32_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 4, recursion_depth); |
| } |
| internal::WireCheckPadding<uint32_t>(decoder, position + 0, 0xffffff00); |
| } |
| }; |
| |
| template <> |
| struct TypeTraits<::test_encapsulatedstructs::wire::Int16Int8> { |
| static constexpr uint32_t kMaxNumHandles = 0; |
| static constexpr uint32_t kMaxDepth = 0; |
| static constexpr uint32_t kPrimarySize = 4; |
| [[maybe_unused]] |
| static constexpr uint32_t kMaxOutOfLine = 0; |
| static constexpr bool kHasFlexibleEnvelope = false; |
| static constexpr bool kHasPointer = false; |
| }; |
| |
| template <> |
| struct IsFidlType<::test_encapsulatedstructs::wire::Int16Int8> : public std::true_type {}; |
| template <> |
| struct IsWire<::test_encapsulatedstructs::wire::Int16Int8> : public std::true_type {}; |
| template <> |
| struct IsStruct<::test_encapsulatedstructs::wire::Int16Int8> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::test_encapsulatedstructs::wire::Int16Int8>); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::Int16Int8, a) == 0); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::Int16Int8, b) == 2); |
| static_assert(sizeof(::test_encapsulatedstructs::wire::Int16Int8) == TypeTraits<::test_encapsulatedstructs::wire::Int16Int8>::kPrimarySize); |
| |
| template <bool IsRecursive> |
| struct ::fidl::internal::WireCodingTraits<::test_encapsulatedstructs::wire::Int16Int8, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive> { |
| static constexpr size_t kInlineSize = 4; |
| static constexpr auto kMembers = std::make_tuple(::fidl::internal::WireStructMemberCodingInfo<int16_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>(), ::fidl::internal::WireStructMemberCodingInfo<int8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>()); |
| static constexpr bool kHasPadding = true; |
| using Base = WireStructCodingTraitsBase<::test_encapsulatedstructs::wire::Int16Int8, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive>; |
| static constexpr bool kIsMemcpyCompatible = Base::kIsMemcpyCompatible; |
| |
| static void Encode( |
| internal::WireEncoder* encoder, ::test_encapsulatedstructs::wire::Int16Int8* value, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) { |
| if constexpr (kIsMemcpyCompatible) { |
| memcpy(position.As<void>(), value, sizeof(::test_encapsulatedstructs::wire::Int16Int8)); |
| } else { |
| internal::WireZeroPadding<uint16_t>(encoder, position + 2); |
| internal::WireCodingTraits<int16_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->a, position + 0, recursion_depth); |
| internal::WireCodingTraits<int8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->b, position + 2, 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<int16_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 0, recursion_depth); |
| internal::WireCodingTraits<int8_t, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 2, recursion_depth); |
| } |
| internal::WireCheckPadding<uint16_t>(decoder, position + 2, 0xff00); |
| } |
| }; |
| |
| template <> |
| struct TypeTraits<::test_encapsulatedstructs::wire::ArrayInt16Int8> { |
| static constexpr uint32_t kMaxNumHandles = 0; |
| static constexpr uint32_t kMaxDepth = 0; |
| static constexpr uint32_t kPrimarySize = 12; |
| [[maybe_unused]] |
| static constexpr uint32_t kMaxOutOfLine = 0; |
| static constexpr bool kHasFlexibleEnvelope = false; |
| static constexpr bool kHasPointer = false; |
| }; |
| |
| template <> |
| struct IsFidlType<::test_encapsulatedstructs::wire::ArrayInt16Int8> : public std::true_type {}; |
| template <> |
| struct IsWire<::test_encapsulatedstructs::wire::ArrayInt16Int8> : public std::true_type {}; |
| template <> |
| struct IsStruct<::test_encapsulatedstructs::wire::ArrayInt16Int8> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::test_encapsulatedstructs::wire::ArrayInt16Int8>); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::ArrayInt16Int8, arr) == 0); |
| static_assert(sizeof(::test_encapsulatedstructs::wire::ArrayInt16Int8) == TypeTraits<::test_encapsulatedstructs::wire::ArrayInt16Int8>::kPrimarySize); |
| |
| template <bool IsRecursive> |
| struct ::fidl::internal::WireCodingTraits<::test_encapsulatedstructs::wire::ArrayInt16Int8, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive> { |
| static constexpr size_t kInlineSize = 12; |
| static constexpr auto kMembers = std::make_tuple(::fidl::internal::WireStructMemberCodingInfo<::fidl::Array<::test_encapsulatedstructs::wire::Int16Int8, 3>, fidl::internal::WireCodingConstraintEmpty, IsRecursive>()); |
| static constexpr bool kHasPadding = false; |
| using Base = WireStructCodingTraitsBase<::test_encapsulatedstructs::wire::ArrayInt16Int8, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive>; |
| static constexpr bool kIsMemcpyCompatible = Base::kIsMemcpyCompatible; |
| |
| static void Encode( |
| internal::WireEncoder* encoder, ::test_encapsulatedstructs::wire::ArrayInt16Int8* value, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) { |
| if constexpr (kIsMemcpyCompatible) { |
| memcpy(position.As<void>(), value, sizeof(::test_encapsulatedstructs::wire::ArrayInt16Int8)); |
| } else { |
| internal::WireCodingTraits<::fidl::Array<::test_encapsulatedstructs::wire::Int16Int8, 3>, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->arr, 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<::fidl::Array<::test_encapsulatedstructs::wire::Int16Int8, 3>, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 0, recursion_depth); |
| } |
| } |
| }; |
| |
| template <> |
| struct TypeTraits<::test_encapsulatedstructs::wire::StructPaddingTestStruct> { |
| static constexpr uint32_t kMaxNumHandles = 0; |
| static constexpr uint32_t kMaxDepth = 0; |
| static constexpr uint32_t kPrimarySize = 24; |
| [[maybe_unused]] |
| static constexpr uint32_t kMaxOutOfLine = 0; |
| static constexpr bool kHasFlexibleEnvelope = false; |
| static constexpr bool kHasPointer = false; |
| }; |
| |
| template <> |
| struct IsFidlType<::test_encapsulatedstructs::wire::StructPaddingTestStruct> : public std::true_type {}; |
| template <> |
| struct IsWire<::test_encapsulatedstructs::wire::StructPaddingTestStruct> : public std::true_type {}; |
| template <> |
| struct IsStruct<::test_encapsulatedstructs::wire::StructPaddingTestStruct> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::test_encapsulatedstructs::wire::StructPaddingTestStruct>); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::StructPaddingTestStruct, trailing) == 0); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::StructPaddingTestStruct, inner) == 4); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::StructPaddingTestStruct, array) == 12); |
| static_assert(sizeof(::test_encapsulatedstructs::wire::StructPaddingTestStruct) == TypeTraits<::test_encapsulatedstructs::wire::StructPaddingTestStruct>::kPrimarySize); |
| |
| template <bool IsRecursive> |
| struct ::fidl::internal::WireCodingTraits<::test_encapsulatedstructs::wire::StructPaddingTestStruct, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive> { |
| static constexpr size_t kInlineSize = 24; |
| static constexpr auto kMembers = std::make_tuple(::fidl::internal::WireStructMemberCodingInfo<::test_encapsulatedstructs::wire::Int16Int8, fidl::internal::WireCodingConstraintEmpty, IsRecursive>(), ::fidl::internal::WireStructMemberCodingInfo<::test_encapsulatedstructs::wire::Int8Int32, fidl::internal::WireCodingConstraintEmpty, IsRecursive>(), ::fidl::internal::WireStructMemberCodingInfo<::test_encapsulatedstructs::wire::ArrayInt16Int8, fidl::internal::WireCodingConstraintEmpty, IsRecursive>()); |
| static constexpr bool kHasPadding = false; |
| using Base = WireStructCodingTraitsBase<::test_encapsulatedstructs::wire::StructPaddingTestStruct, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive>; |
| static constexpr bool kIsMemcpyCompatible = Base::kIsMemcpyCompatible; |
| |
| static void Encode( |
| internal::WireEncoder* encoder, ::test_encapsulatedstructs::wire::StructPaddingTestStruct* value, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) { |
| if constexpr (kIsMemcpyCompatible) { |
| memcpy(position.As<void>(), value, sizeof(::test_encapsulatedstructs::wire::StructPaddingTestStruct)); |
| } else { |
| internal::WireCodingTraits<::test_encapsulatedstructs::wire::Int16Int8, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->trailing, position + 0, recursion_depth); |
| internal::WireCodingTraits<::test_encapsulatedstructs::wire::Int8Int32, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->inner, position + 4, recursion_depth); |
| internal::WireCodingTraits<::test_encapsulatedstructs::wire::ArrayInt16Int8, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->array, position + 12, 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<::test_encapsulatedstructs::wire::Int16Int8, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 0, recursion_depth); |
| internal::WireCodingTraits<::test_encapsulatedstructs::wire::Int8Int32, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 4, recursion_depth); |
| internal::WireCodingTraits<::test_encapsulatedstructs::wire::ArrayInt16Int8, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 12, recursion_depth); |
| } |
| } |
| }; |
| |
| #ifdef __Fuchsia__ |
| template <> |
| struct IsResource<::test_encapsulatedstructs::wire::NonInlineStructTestStruct> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::test_encapsulatedstructs::wire::NonInlineStructTestStruct> { |
| static constexpr uint32_t kMaxNumHandles = 1; |
| static constexpr uint32_t kMaxDepth = 1; |
| static constexpr uint32_t kPrimarySize = 16; |
| [[maybe_unused]] |
| static constexpr uint32_t kMaxOutOfLine = 8; |
| static constexpr bool kHasFlexibleEnvelope = false; |
| static constexpr bool kHasPointer = true; |
| }; |
| |
| template <> |
| struct IsFidlType<::test_encapsulatedstructs::wire::NonInlineStructTestStruct> : public std::true_type {}; |
| template <> |
| struct IsWire<::test_encapsulatedstructs::wire::NonInlineStructTestStruct> : public std::true_type {}; |
| template <> |
| struct IsStruct<::test_encapsulatedstructs::wire::NonInlineStructTestStruct> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::test_encapsulatedstructs::wire::NonInlineStructTestStruct>); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::NonInlineStructTestStruct, element) == 0); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::NonInlineStructTestStruct, h) == 8); |
| static_assert(sizeof(::test_encapsulatedstructs::wire::NonInlineStructTestStruct) == TypeTraits<::test_encapsulatedstructs::wire::NonInlineStructTestStruct>::kPrimarySize); |
| |
| template <bool IsRecursive> |
| struct ::fidl::internal::WireCodingTraits<::test_encapsulatedstructs::wire::NonInlineStructTestStruct, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive> { |
| static constexpr size_t kInlineSize = 16; |
| static constexpr auto kMembers = std::make_tuple(::fidl::internal::WireStructMemberCodingInfo<::fidl::ObjectView<::test_encapsulatedstructs::wire::Int16Int8>, fidl::internal::WireCodingConstraintEmpty, IsRecursive>(), ::fidl::internal::WireStructMemberCodingInfo<::zx::handle, fidl::internal::WireCodingConstraintHandle<ZX_OBJ_TYPE_NONE, 0x80000000, false>, IsRecursive>()); |
| static constexpr bool kHasPadding = true; |
| using Base = WireStructCodingTraitsBase<::test_encapsulatedstructs::wire::NonInlineStructTestStruct, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive>; |
| static constexpr bool kIsMemcpyCompatible = Base::kIsMemcpyCompatible; |
| |
| static void Encode( |
| internal::WireEncoder* encoder, ::test_encapsulatedstructs::wire::NonInlineStructTestStruct* value, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) { |
| if constexpr (kIsMemcpyCompatible) { |
| memcpy(position.As<void>(), value, sizeof(::test_encapsulatedstructs::wire::NonInlineStructTestStruct)); |
| } else { |
| internal::WireZeroPadding<uint64_t>(encoder, position + 8); |
| internal::WireCodingTraits<::fidl::ObjectView<::test_encapsulatedstructs::wire::Int16Int8>, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->element, position + 0, recursion_depth); |
| internal::WireCodingTraits<::zx::handle, fidl::internal::WireCodingConstraintHandle<ZX_OBJ_TYPE_NONE, 0x80000000, false>, IsRecursive>::Encode(encoder, &value->h, position + 8, 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<::fidl::ObjectView<::test_encapsulatedstructs::wire::Int16Int8>, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 0, recursion_depth); |
| internal::WireCodingTraits<::zx::handle, fidl::internal::WireCodingConstraintHandle<ZX_OBJ_TYPE_NONE, 0x80000000, false>, IsRecursive>::Decode( |
| decoder, position + 8, recursion_depth); |
| } |
| internal::WireCheckPadding<uint64_t>(decoder, position + 8, 0xffffffff00000000); |
| } |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| template <> |
| struct IsResource<::test_encapsulatedstructs::wire::TopLevelStruct> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::test_encapsulatedstructs::wire::TopLevelStruct> { |
| static constexpr uint32_t kMaxNumHandles = 1; |
| static constexpr uint32_t kMaxDepth = 1; |
| static constexpr uint32_t kPrimarySize = 40; |
| [[maybe_unused]] |
| static constexpr uint32_t kMaxOutOfLine = 8; |
| static constexpr bool kHasFlexibleEnvelope = false; |
| static constexpr bool kHasPointer = true; |
| }; |
| |
| template <> |
| struct IsFidlType<::test_encapsulatedstructs::wire::TopLevelStruct> : public std::true_type {}; |
| template <> |
| struct IsWire<::test_encapsulatedstructs::wire::TopLevelStruct> : public std::true_type {}; |
| template <> |
| struct IsStruct<::test_encapsulatedstructs::wire::TopLevelStruct> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::test_encapsulatedstructs::wire::TopLevelStruct>); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::TopLevelStruct, a) == 0); |
| static_assert(offsetof(::test_encapsulatedstructs::wire::TopLevelStruct, b) == 24); |
| static_assert(sizeof(::test_encapsulatedstructs::wire::TopLevelStruct) == TypeTraits<::test_encapsulatedstructs::wire::TopLevelStruct>::kPrimarySize); |
| |
| template <bool IsRecursive> |
| struct ::fidl::internal::WireCodingTraits<::test_encapsulatedstructs::wire::TopLevelStruct, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive> { |
| static constexpr size_t kInlineSize = 40; |
| static constexpr auto kMembers = std::make_tuple(::fidl::internal::WireStructMemberCodingInfo<::test_encapsulatedstructs::wire::StructPaddingTestStruct, fidl::internal::WireCodingConstraintEmpty, IsRecursive>(), ::fidl::internal::WireStructMemberCodingInfo<::test_encapsulatedstructs::wire::NonInlineStructTestStruct, fidl::internal::WireCodingConstraintEmpty, IsRecursive>()); |
| static constexpr bool kHasPadding = false; |
| using Base = WireStructCodingTraitsBase<::test_encapsulatedstructs::wire::TopLevelStruct, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive>; |
| static constexpr bool kIsMemcpyCompatible = Base::kIsMemcpyCompatible; |
| |
| static void Encode( |
| internal::WireEncoder* encoder, ::test_encapsulatedstructs::wire::TopLevelStruct* value, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) { |
| if constexpr (kIsMemcpyCompatible) { |
| memcpy(position.As<void>(), value, sizeof(::test_encapsulatedstructs::wire::TopLevelStruct)); |
| } else { |
| internal::WireCodingTraits<::test_encapsulatedstructs::wire::StructPaddingTestStruct, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->a, position + 0, recursion_depth); |
| internal::WireCodingTraits<::test_encapsulatedstructs::wire::NonInlineStructTestStruct, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Encode(encoder, &value->b, position + 24, 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<::test_encapsulatedstructs::wire::StructPaddingTestStruct, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 0, recursion_depth); |
| internal::WireCodingTraits<::test_encapsulatedstructs::wire::NonInlineStructTestStruct, fidl::internal::WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + 24, recursion_depth); |
| } |
| } |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace fidl |