| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <lib/fidl/internal.h> |
| #include <lib/fidl/llcpp/array.h> |
| #include <lib/fidl/llcpp/buffer_allocator.h> |
| #include <lib/fidl/llcpp/buffer_then_heap_allocator.h> |
| #include <lib/fidl/llcpp/coding.h> |
| #include <lib/fidl/llcpp/envelope.h> |
| #include <lib/fidl/llcpp/errors.h> |
| #include <lib/fidl/llcpp/memory.h> |
| #include <lib/fidl/llcpp/message.h> |
| #include <lib/fidl/llcpp/message_storage.h> |
| #include <lib/fidl/llcpp/object_view.h> |
| #include <lib/fidl/llcpp/string_view.h> |
| #include <lib/fidl/llcpp/tracking_ptr.h> |
| #include <lib/fidl/llcpp/traits.h> |
| #include <lib/fidl/llcpp/vector_view.h> |
| #include <lib/fit/function.h> |
| #include <lib/fit/optional.h> |
| |
| #include <algorithm> |
| #include <cstddef> |
| #include <variant> |
| #ifdef __Fuchsia__ |
| #include <lib/fidl/llcpp/client.h> |
| #include <lib/fidl/llcpp/client_end.h> |
| #include <lib/fidl/llcpp/connect_service.h> |
| #include <lib/fidl/llcpp/result.h> |
| #include <lib/fidl/llcpp/server.h> |
| #include <lib/fidl/llcpp/server_end.h> |
| #include <lib/fidl/llcpp/service_handler_interface.h> |
| #include <lib/fidl/llcpp/sync_call.h> |
| #include <lib/fidl/llcpp/transaction.h> |
| #include <lib/fidl/txn_header.h> |
| #endif // __Fuchsia__ |
| #include <zircon/fidl.h> |
| |
| namespace llcpp { |
| |
| namespace fidl { |
| namespace test { |
| namespace bindingsdenylist { |
| |
| class OnlyLlcpp; |
| |
| extern "C" const fidl_type_t fidl_test_bindingsdenylist_OnlyLlcppTable; |
| |
| class OnlyLlcpp { |
| public: |
| OnlyLlcpp() : ordinal_(Ordinal::Invalid), envelope_{} {} |
| |
| OnlyLlcpp(OnlyLlcpp&&) = default; |
| OnlyLlcpp& operator=(OnlyLlcpp&&) = default; |
| |
| ~OnlyLlcpp() { reset_ptr(nullptr); } |
| |
| enum class Tag : fidl_xunion_tag_t { |
| kX = 1, // 0x1 |
| }; |
| |
| bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; } |
| |
| bool is_x() const { return ordinal_ == Ordinal::kX; } |
| |
| static OnlyLlcpp WithX(::fidl::tracking_ptr<uint32_t>&& val) { |
| OnlyLlcpp result; |
| result.set_x(std::move(val)); |
| return result; |
| } |
| |
| template <typename... Args> |
| static OnlyLlcpp WithX(::fidl::AnyAllocator& allocator, Args&&... args) { |
| OnlyLlcpp result; |
| result.set_x( |
| ::fidl::ObjectView<uint32_t>(allocator, std::forward<Args>(args)...)); |
| return result; |
| } |
| |
| void set_x(::fidl::tracking_ptr<uint32_t>&& elem) { |
| ordinal_ = Ordinal::kX; |
| reset_ptr(static_cast<::fidl::tracking_ptr<void>>(std::move(elem))); |
| } |
| |
| template <typename... Args> |
| void set_x(::fidl::AnyAllocator& allocator, Args&&... args) { |
| ordinal_ = Ordinal::kX; |
| set_x(::fidl::ObjectView<uint32_t>(allocator, std::forward<Args>(args)...)); |
| } |
| |
| uint32_t& mutable_x() { |
| ZX_ASSERT(ordinal_ == Ordinal::kX); |
| return *static_cast<uint32_t*>(envelope_.data.get()); |
| } |
| const uint32_t& x() const { |
| ZX_ASSERT(ordinal_ == Ordinal::kX); |
| return *static_cast<uint32_t*>(envelope_.data.get()); |
| } |
| Tag which() const { |
| ZX_ASSERT(!has_invalid_tag()); |
| return static_cast<Tag>(ordinal_); |
| } |
| |
| static constexpr const fidl_type_t* Type = |
| &fidl_test_bindingsdenylist_OnlyLlcppTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 24; |
| [[maybe_unused]] static constexpr uint32_t MaxOutOfLine = 8; |
| static constexpr bool HasPointer = true; |
| |
| private: |
| enum class Ordinal : fidl_xunion_tag_t { |
| Invalid = 0, |
| kX = 1, // 0x1 |
| }; |
| |
| void reset_ptr(::fidl::tracking_ptr<void>&& new_ptr) { |
| // To clear the existing value, std::move it and let it go out of scope. |
| switch (static_cast<fidl_xunion_tag_t>(ordinal_)) { |
| case 1: { |
| ::fidl::tracking_ptr<uint32_t> to_destroy = |
| static_cast<::fidl::tracking_ptr<uint32_t>>( |
| std::move(envelope_.data)); |
| break; |
| } |
| } |
| |
| envelope_.data = std::move(new_ptr); |
| } |
| |
| static void SizeAndOffsetAssertionHelper(); |
| Ordinal ordinal_; |
| FIDL_ALIGNDECL |
| ::fidl::Envelope<void> envelope_; |
| }; |
| |
| constexpr uint32_t AllBindings = 0u; |
| |
| } // namespace bindingsdenylist |
| } // namespace test |
| } // namespace fidl |
| } // namespace llcpp |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::llcpp::fidl::test::bindingsdenylist::OnlyLlcpp> |
| : public std::true_type {}; |
| template <> |
| struct IsUnion<::llcpp::fidl::test::bindingsdenylist::OnlyLlcpp> |
| : public std::true_type {}; |
| static_assert(std::is_standard_layout_v< |
| ::llcpp::fidl::test::bindingsdenylist::OnlyLlcpp>); |
| |
| } // namespace fidl |
| |
| namespace llcpp { |
| |
| namespace fidl { |
| namespace test { |
| namespace bindingsdenylist {} // namespace bindingsdenylist |
| } // namespace test |
| } // namespace fidl |
| } // namespace llcpp |