| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <lib/fidl/internal.h> |
| #include <lib/fidl/cpp/vector_view.h> |
| #include <lib/fidl/cpp/string_view.h> |
| #include <lib/fidl/llcpp/array_wrapper.h> |
| #include <lib/fidl/llcpp/coding.h> |
| #include <lib/fidl/llcpp/traits.h> |
| #include <zircon/fidl.h> |
| |
| namespace test { |
| namespace name { |
| |
| struct Union; |
| |
| extern "C" const fidl_type_t test_name_UnionTable; |
| |
| struct Union { |
| enum class Tag : fidl_union_tag_t { |
| kPrimitive = 0, |
| kStringNeedsConstructor = 1, |
| kVectorStringAlsoNeedsConstructor = 2, |
| Invalid = ::std::numeric_limits<::fidl_union_tag_t>::max(), |
| }; |
| |
| bool has_invalid_tag() const { return tag_ == Tag::Invalid; } |
| |
| bool is_Primitive() const { return tag_ == Tag::kPrimitive; } |
| |
| int32_t& mutable_Primitive() { |
| tag_ = Tag::kPrimitive; |
| return Primitive_; |
| } |
| |
| const int32_t& Primitive() const { return Primitive_; } |
| |
| bool is_StringNeedsConstructor() const { return tag_ == Tag::kStringNeedsConstructor; } |
| |
| ::fidl::StringView& mutable_StringNeedsConstructor() { |
| tag_ = Tag::kStringNeedsConstructor; |
| return StringNeedsConstructor_; |
| } |
| |
| const ::fidl::StringView& StringNeedsConstructor() const { return StringNeedsConstructor_; } |
| |
| bool is_VectorStringAlsoNeedsConstructor() const { return tag_ == Tag::kVectorStringAlsoNeedsConstructor; } |
| |
| ::fidl::VectorView<::fidl::StringView>& mutable_VectorStringAlsoNeedsConstructor() { |
| tag_ = Tag::kVectorStringAlsoNeedsConstructor; |
| return VectorStringAlsoNeedsConstructor_; |
| } |
| |
| const ::fidl::VectorView<::fidl::StringView>& VectorStringAlsoNeedsConstructor() const { return VectorStringAlsoNeedsConstructor_; } |
| |
| Tag which() const { return tag_; } |
| |
| static constexpr const fidl_type_t* Type = &test_name_UnionTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 24; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 4294967295; |
| |
| private: |
| void SizeAndOffsetAssertionHelper(); |
| Tag tag_; |
| union { |
| int32_t Primitive_; |
| ::fidl::StringView StringNeedsConstructor_; |
| ::fidl::VectorView<::fidl::StringView> VectorStringAlsoNeedsConstructor_; |
| }; |
| }; |
| |
| } // namespace name |
| } // namespace test |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::test::name::Union> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::test::name::Union>); |
| |
| } // namespace fidl |