| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #include <fidl/test.versions/cpp/wire_types.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| auto ::test_versions::wire::Union::Which() const -> ::test_versions::wire::Union::Tag { |
| ZX_ASSERT(!has_invalid_tag()); |
| switch (ordinal_) { |
| case ::test_versions::wire::Union::Ordinal::kX: |
| return static_cast<::test_versions::wire::Union::Tag>(ordinal_); |
| default: |
| return ::test_versions::wire::Union::Tag::_do_not_handle_this__write_a_default_case_instead; |
| } |
| } |
| |
| void ::test_versions::wire::Union::SizeAndOffsetAssertionHelper() { |
| static_assert(sizeof(Union) == sizeof(fidl_union_t)); |
| static_assert(offsetof(Union, ordinal_) == offsetof(fidl_union_t, tag)); |
| static_assert(offsetof(Union, envelope_) == offsetof(fidl_union_t, envelope)); |
| } |
| |
| bool ::fidl::WireTableFrame<::test_versions::wire::Table>::HasUnknownData() const { |
| return false; |
| } |
| |
| uint64_t fidl::WireTableFrame<::test_versions::wire::Table>::ComputeMaxOrdinal() const { |
| uint64_t max_ordinal = 0; |
| if (!x_.has_data()) { |
| max_ordinal = 1; |
| } |
| return max_ordinal; |
| } |
| |
| bool ::test_versions::wire::Table::HasUnknownData() const { |
| if (max_ordinal_ > 1) { |
| return true; |
| } |
| if (frame_ptr_ == nullptr) { |
| return false; |
| } |
| return frame_ptr_->HasUnknownData(); |
| } |
| |
| #pragma clang diagnostic pop |