|  | // 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/stdcompat/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> | 
|  | #include <lib/zx/channel.h> | 
|  |  | 
|  | #endif  // __Fuchsia__ | 
|  | #include <zircon/fidl.h> | 
|  |  | 
|  | namespace llcpp { | 
|  | namespace fidl { | 
|  | namespace test { | 
|  | namespace doccomments { | 
|  | namespace wire { | 
|  | class Table; | 
|  |  | 
|  | struct Struct; | 
|  | }  // namespace wire | 
|  | using Struct = ::llcpp::fidl::test::doccomments::wire::Struct; | 
|  | namespace wire { | 
|  | class StrictUnion; | 
|  | }  // namespace wire | 
|  | using StrictUnion = ::llcpp::fidl::test::doccomments::wire::StrictUnion; | 
|  |  | 
|  | class Interface; | 
|  |  | 
|  | class Service; | 
|  | namespace wire { | 
|  |  | 
|  | // strict enum comment #1. | 
|  | // | 
|  | // strict enum comment #2. | 
|  | enum class MyStrictEnum : uint32_t { | 
|  |  | 
|  | // FOO member comment #1 | 
|  | // | 
|  | // FOO member comment #3 | 
|  | FOO = 1u, | 
|  |  | 
|  | // BAR member comment #1 | 
|  | // | 
|  | // BAR member comment #3 | 
|  | BAR = 2u, | 
|  | }; | 
|  | }  // namespace wire | 
|  | using MyStrictEnum = ::llcpp::fidl::test::doccomments::wire::MyStrictEnum; | 
|  |  | 
|  | namespace wire { | 
|  | // strict bits comment #1 | 
|  | // | 
|  | // strict bits comment #2 | 
|  | // |MyStrictBits| is strict, hence is guaranteed to only contain | 
|  | // members defined in the FIDL schema when receiving it in a message. | 
|  | // Sending unknown members will fail at runtime. | 
|  | class MyStrictBits final { | 
|  | public: | 
|  | constexpr MyStrictBits() = default; | 
|  | constexpr MyStrictBits(const MyStrictBits& other) = default; | 
|  |  | 
|  | // Constructs an instance of |MyStrictBits| from an underlying primitive | 
|  | // value, preserving any bit member not defined in the FIDL schema. | 
|  | explicit constexpr MyStrictBits(uint32_t value) : value_(value) {} | 
|  | const static MyStrictBits MY_FIRST_BIT; | 
|  | const static MyStrictBits MY_OTHER_BIT; | 
|  | const static MyStrictBits kMask; | 
|  |  | 
|  | explicit constexpr inline operator uint32_t() const { return value_; } | 
|  | explicit constexpr inline operator bool() const { | 
|  | return static_cast<bool>(value_); | 
|  | } | 
|  | constexpr inline bool operator==(const MyStrictBits& other) const { | 
|  | return value_ == other.value_; | 
|  | } | 
|  | constexpr inline bool operator!=(const MyStrictBits& other) const { | 
|  | return value_ != other.value_; | 
|  | } | 
|  | constexpr inline MyStrictBits operator~() const; | 
|  | constexpr inline MyStrictBits operator|(const MyStrictBits& other) const; | 
|  | constexpr inline MyStrictBits operator&(const MyStrictBits& other) const; | 
|  | constexpr inline MyStrictBits operator^(const MyStrictBits& other) const; | 
|  | constexpr inline void operator|=(const MyStrictBits& other); | 
|  | constexpr inline void operator&=(const MyStrictBits& other); | 
|  | constexpr inline void operator^=(const MyStrictBits& other); | 
|  |  | 
|  | // Constructs an instance of |MyStrictBits| from an underlying primitive value | 
|  | // if the primitive does not contain any unknown members not defined in the | 
|  | // FIDL schema. Otherwise, returns |cpp17::nullopt|. | 
|  | constexpr inline static cpp17::optional<MyStrictBits> TryFrom( | 
|  | uint32_t value) { | 
|  | if (value & ~kMask.value_) { | 
|  | return cpp17::nullopt; | 
|  | } | 
|  | return MyStrictBits(value & MyStrictBits::kMask.value_); | 
|  | } | 
|  |  | 
|  | // Constructs an instance of |MyStrictBits| from an underlying primitive | 
|  | // value, clearing any bit member not defined in the FIDL schema. | 
|  | constexpr inline static MyStrictBits TruncatingUnknown(uint32_t value) { | 
|  | return MyStrictBits(value & MyStrictBits::kMask.value_); | 
|  | } | 
|  |  | 
|  | private: | 
|  | uint32_t value_ = 0; | 
|  | }; | 
|  | constexpr const ::llcpp::fidl::test::doccomments::wire::MyStrictBits | 
|  | MyStrictBits::MY_FIRST_BIT = | 
|  | ::llcpp::fidl::test::doccomments::wire::MyStrictBits(1u); | 
|  | constexpr const ::llcpp::fidl::test::doccomments::wire::MyStrictBits | 
|  | MyStrictBits::MY_OTHER_BIT = | 
|  | ::llcpp::fidl::test::doccomments::wire::MyStrictBits(2u); | 
|  | constexpr const ::llcpp::fidl::test::doccomments::wire::MyStrictBits | 
|  | MyStrictBits::kMask = | 
|  | ::llcpp::fidl::test::doccomments::wire::MyStrictBits(3u); | 
|  |  | 
|  | constexpr inline ::llcpp::fidl::test::doccomments::wire::MyStrictBits | 
|  | MyStrictBits::operator~() const { | 
|  | return ::llcpp::fidl::test::doccomments::wire::MyStrictBits( | 
|  | static_cast<uint32_t>(~this->value_ & kMask.value_)); | 
|  | } | 
|  |  | 
|  | constexpr inline ::llcpp::fidl::test::doccomments::wire::MyStrictBits | 
|  | MyStrictBits::operator|( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyStrictBits& other) const { | 
|  | return ::llcpp::fidl::test::doccomments::wire::MyStrictBits( | 
|  | static_cast<uint32_t>(this->value_ | other.value_)); | 
|  | } | 
|  |  | 
|  | constexpr inline ::llcpp::fidl::test::doccomments::wire::MyStrictBits | 
|  | MyStrictBits::operator&( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyStrictBits& other) const { | 
|  | return ::llcpp::fidl::test::doccomments::wire::MyStrictBits( | 
|  | static_cast<uint32_t>(this->value_ & other.value_)); | 
|  | } | 
|  |  | 
|  | constexpr inline ::llcpp::fidl::test::doccomments::wire::MyStrictBits | 
|  | MyStrictBits::operator^( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyStrictBits& other) const { | 
|  | return ::llcpp::fidl::test::doccomments::wire::MyStrictBits( | 
|  | static_cast<uint32_t>(this->value_ ^ other.value_)); | 
|  | } | 
|  |  | 
|  | constexpr inline void MyStrictBits::operator|=( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyStrictBits& other) { | 
|  | this->value_ |= other.value_; | 
|  | } | 
|  |  | 
|  | constexpr inline void MyStrictBits::operator&=( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyStrictBits& other) { | 
|  | this->value_ &= other.value_; | 
|  | } | 
|  |  | 
|  | constexpr inline void MyStrictBits::operator^=( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyStrictBits& other) { | 
|  | this->value_ ^= other.value_; | 
|  | } | 
|  | }  // namespace wire | 
|  | using MyStrictBits = ::llcpp::fidl::test::doccomments::wire::MyStrictBits; | 
|  |  | 
|  | namespace wire { | 
|  |  | 
|  | // flexible enum comment #1. | 
|  | // | 
|  | // flexible enum comment #2. | 
|  | class MyFlexibleEnum final { | 
|  | public: | 
|  | constexpr MyFlexibleEnum() : value_(0) {} | 
|  | constexpr explicit MyFlexibleEnum(uint32_t value) : value_(value) {} | 
|  | constexpr MyFlexibleEnum(const MyFlexibleEnum& other) = default; | 
|  | constexpr operator uint32_t() const { return value_; } | 
|  |  | 
|  | constexpr bool IsUnknown() const { | 
|  | switch (value_) { | 
|  | case 1u: | 
|  |  | 
|  | case 2u: | 
|  |  | 
|  | return false; | 
|  | default: | 
|  | return true; | 
|  | } | 
|  | } | 
|  |  | 
|  | constexpr static MyFlexibleEnum Unknown() { | 
|  | return MyFlexibleEnum(0xffffffff); | 
|  | } | 
|  |  | 
|  | // FOO member comment #1 | 
|  | // | 
|  | // FOO member comment #3 | 
|  | static const MyFlexibleEnum FOO; | 
|  |  | 
|  | // BAR member comment #1 | 
|  | // | 
|  | // BAR member comment #3 | 
|  | static const MyFlexibleEnum BAR; | 
|  |  | 
|  | private: | 
|  | uint32_t value_; | 
|  | }; | 
|  | constexpr const ::llcpp::fidl::test::doccomments::wire::MyFlexibleEnum | 
|  | MyFlexibleEnum::FOO = | 
|  | ::llcpp::fidl::test::doccomments::wire::MyFlexibleEnum(1u); | 
|  | constexpr const ::llcpp::fidl::test::doccomments::wire::MyFlexibleEnum | 
|  | MyFlexibleEnum::BAR = | 
|  | ::llcpp::fidl::test::doccomments::wire::MyFlexibleEnum(2u); | 
|  | }  // namespace wire | 
|  | using MyFlexibleEnum = ::llcpp::fidl::test::doccomments::wire::MyFlexibleEnum; | 
|  |  | 
|  | namespace wire { | 
|  | // flexible bits comment #1 | 
|  | // | 
|  | // flexible bits comment #2 | 
|  | // |MyFlexibleBits| is flexible, hence may contain unknown members not | 
|  | // defined in the FIDL schema. | 
|  | class MyFlexibleBits final { | 
|  | public: | 
|  | constexpr MyFlexibleBits() = default; | 
|  | constexpr MyFlexibleBits(const MyFlexibleBits& other) = default; | 
|  |  | 
|  | // Constructs an instance of |MyFlexibleBits| from an underlying primitive | 
|  | // value, preserving any bit member not defined in the FIDL schema. | 
|  | explicit constexpr MyFlexibleBits(uint32_t value) : value_(value) {} | 
|  | const static MyFlexibleBits MY_FIRST_BIT; | 
|  | const static MyFlexibleBits MY_OTHER_BIT; | 
|  | const static MyFlexibleBits kMask; | 
|  |  | 
|  | explicit constexpr inline operator uint32_t() const { return value_; } | 
|  | explicit constexpr inline operator bool() const { | 
|  | return static_cast<bool>(value_); | 
|  | } | 
|  | constexpr inline bool operator==(const MyFlexibleBits& other) const { | 
|  | return value_ == other.value_; | 
|  | } | 
|  | constexpr inline bool operator!=(const MyFlexibleBits& other) const { | 
|  | return value_ != other.value_; | 
|  | } | 
|  | constexpr inline MyFlexibleBits operator~() const; | 
|  | constexpr inline MyFlexibleBits operator|(const MyFlexibleBits& other) const; | 
|  | constexpr inline MyFlexibleBits operator&(const MyFlexibleBits& other) const; | 
|  | constexpr inline MyFlexibleBits operator^(const MyFlexibleBits& other) const; | 
|  | constexpr inline void operator|=(const MyFlexibleBits& other); | 
|  | constexpr inline void operator&=(const MyFlexibleBits& other); | 
|  | constexpr inline void operator^=(const MyFlexibleBits& other); | 
|  |  | 
|  | // Constructs an instance of |MyFlexibleBits| from an underlying primitive | 
|  | // value if the primitive does not contain any unknown members not defined in | 
|  | // the FIDL schema. Otherwise, returns |cpp17::nullopt|. | 
|  | constexpr inline static cpp17::optional<MyFlexibleBits> TryFrom( | 
|  | uint32_t value) { | 
|  | if (value & ~kMask.value_) { | 
|  | return cpp17::nullopt; | 
|  | } | 
|  | return MyFlexibleBits(value & MyFlexibleBits::kMask.value_); | 
|  | } | 
|  |  | 
|  | // Constructs an instance of |MyFlexibleBits| from an underlying primitive | 
|  | // value, clearing any bit member not defined in the FIDL schema. | 
|  | constexpr inline static MyFlexibleBits TruncatingUnknown(uint32_t value) { | 
|  | return MyFlexibleBits(value & MyFlexibleBits::kMask.value_); | 
|  | } | 
|  | constexpr inline MyFlexibleBits unknown_bits() const { | 
|  | return *this & MyFlexibleBits(~kMask.value_); | 
|  | } | 
|  | constexpr inline bool has_unknown_bits() const { | 
|  | return static_cast<bool>(unknown_bits()); | 
|  | } | 
|  |  | 
|  | private: | 
|  | uint32_t value_ = 0; | 
|  | }; | 
|  | constexpr const ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits | 
|  | MyFlexibleBits::MY_FIRST_BIT = | 
|  | ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits(1u); | 
|  | constexpr const ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits | 
|  | MyFlexibleBits::MY_OTHER_BIT = | 
|  | ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits(2u); | 
|  | constexpr const ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits | 
|  | MyFlexibleBits::kMask = | 
|  | ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits(3u); | 
|  |  | 
|  | constexpr inline ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits | 
|  | MyFlexibleBits::operator~() const { | 
|  | return ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits( | 
|  | static_cast<uint32_t>(~this->value_ & kMask.value_)); | 
|  | } | 
|  |  | 
|  | constexpr inline ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits | 
|  | MyFlexibleBits::operator|( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits& other) const { | 
|  | return ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits( | 
|  | static_cast<uint32_t>(this->value_ | other.value_)); | 
|  | } | 
|  |  | 
|  | constexpr inline ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits | 
|  | MyFlexibleBits::operator&( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits& other) const { | 
|  | return ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits( | 
|  | static_cast<uint32_t>(this->value_ & other.value_)); | 
|  | } | 
|  |  | 
|  | constexpr inline ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits | 
|  | MyFlexibleBits::operator^( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits& other) const { | 
|  | return ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits( | 
|  | static_cast<uint32_t>(this->value_ ^ other.value_)); | 
|  | } | 
|  |  | 
|  | constexpr inline void MyFlexibleBits::operator|=( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits& other) { | 
|  | this->value_ |= other.value_; | 
|  | } | 
|  |  | 
|  | constexpr inline void MyFlexibleBits::operator&=( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits& other) { | 
|  | this->value_ &= other.value_; | 
|  | } | 
|  |  | 
|  | constexpr inline void MyFlexibleBits::operator^=( | 
|  | const ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits& other) { | 
|  | this->value_ ^= other.value_; | 
|  | } | 
|  | }  // namespace wire | 
|  | using MyFlexibleBits = ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits; | 
|  |  | 
|  | namespace wire { | 
|  | class FlexibleUnion; | 
|  | }  // namespace wire | 
|  | using FlexibleUnion = ::llcpp::fidl::test::doccomments::wire::FlexibleUnion; | 
|  | namespace wire { | 
|  |  | 
|  | extern "C" const fidl_type_t fidl_test_doccomments_TableTable; | 
|  |  | 
|  | // table comment #1 | 
|  | // | 
|  | // table comment #3 | 
|  | class Table final { | 
|  | public: | 
|  | // Returns whether no field is set. | 
|  | bool IsEmpty() const { return max_ordinal_ == 0; } | 
|  |  | 
|  | class Frame; | 
|  |  | 
|  | // table field comment #1 | 
|  | // | 
|  | // table field comment #3 | 
|  | const int32_t& Field() const { | 
|  | ZX_ASSERT(has_Field()); | 
|  | return *frame_ptr_->Field_.data; | 
|  | } | 
|  | int32_t& Field() { | 
|  | ZX_ASSERT(has_Field()); | 
|  | return *frame_ptr_->Field_.data; | 
|  | } | 
|  | bool has_Field() const { | 
|  | return max_ordinal_ >= 1 && frame_ptr_->Field_.data != nullptr; | 
|  | } | 
|  | void set_Field(::fidl::ObjectView<int32_t> elem) { | 
|  | ZX_DEBUG_ASSERT(frame_ptr_.get() != nullptr); | 
|  | frame_ptr_->Field_.data = elem; | 
|  | max_ordinal_ = std::max(max_ordinal_, static_cast<uint64_t>(1)); | 
|  | } | 
|  | void set_Field(std::nullptr_t) { | 
|  | ZX_DEBUG_ASSERT(frame_ptr_.get() != nullptr); | 
|  | frame_ptr_->Field_.data = nullptr; | 
|  | } | 
|  | template <typename... Args> | 
|  | void set_Field(::fidl::AnyAllocator& allocator, Args&&... args) { | 
|  | ZX_DEBUG_ASSERT(frame_ptr_.get() != nullptr); | 
|  | frame_ptr_->Field_.data = | 
|  | ::fidl::ObjectView<int32_t>(allocator, std::forward<Args>(args)...); | 
|  | max_ordinal_ = std::max(max_ordinal_, static_cast<uint64_t>(1)); | 
|  | } | 
|  | template <typename... Args> | 
|  | void set_Field(::fidl::Allocator& allocator, Args&&... args) { | 
|  | ZX_DEBUG_ASSERT(frame_ptr_.get() != nullptr); | 
|  | frame_ptr_->Field_.data = | 
|  | ::fidl::tracking_ptr<int32_t>(allocator, std::forward<Args>(args)...); | 
|  | max_ordinal_ = std::max(max_ordinal_, static_cast<uint64_t>(1)); | 
|  | } | 
|  | void set_Field(::fidl::tracking_ptr<int32_t> elem) { | 
|  | frame_ptr_->Field_.data = std::move(elem); | 
|  | max_ordinal_ = std::max(max_ordinal_, static_cast<uint64_t>(1)); | 
|  | } | 
|  |  | 
|  | Table() = default; | 
|  | explicit Table(::fidl::AnyAllocator& allocator) | 
|  | : frame_ptr_(::fidl::ObjectView<Frame>(allocator)) {} | 
|  | explicit Table(::fidl::Allocator& allocator) | 
|  | : frame_ptr_(::fidl::tracking_ptr<Frame>(allocator)) {} | 
|  | explicit Table(::fidl::tracking_ptr<Frame>&& frame_ptr) | 
|  | : frame_ptr_(std::move(frame_ptr)) {} | 
|  | ~Table() = default; | 
|  | Table(Table&& other) noexcept = default; | 
|  | Table& operator=(Table&& other) noexcept = default; | 
|  |  | 
|  | static constexpr const fidl_type_t* Type = &fidl_test_doccomments_TableTable; | 
|  | static constexpr uint32_t MaxNumHandles = 0; | 
|  | static constexpr uint32_t PrimarySize = 16; | 
|  | [[maybe_unused]] static constexpr uint32_t MaxOutOfLine = 24; | 
|  | static constexpr bool HasPointer = true; | 
|  |  | 
|  | void Allocate(::fidl::AnyAllocator& allocator) { | 
|  | max_ordinal_ = 0; | 
|  | frame_ptr_ = ::fidl::ObjectView<Frame>(allocator); | 
|  | } | 
|  | void Allocate(::fidl::Allocator& allocator) { | 
|  | max_ordinal_ = 0; | 
|  | frame_ptr_ = ::fidl::tracking_ptr<Frame>(allocator); | 
|  | } | 
|  | void Init(::fidl::tracking_ptr<Frame>&& frame_ptr) { | 
|  | max_ordinal_ = 0; | 
|  | frame_ptr_ = std::move(frame_ptr); | 
|  | } | 
|  |  | 
|  | private: | 
|  | class UnownedEncodedByteMessage final { | 
|  | public: | 
|  | UnownedEncodedByteMessage(uint8_t* bytes, uint32_t byte_size, Table* value) | 
|  | : message_(bytes, byte_size, sizeof(Table), nullptr, 0, 0) { | 
|  | message_.Encode<Table>(value); | 
|  | } | 
|  | UnownedEncodedByteMessage(const UnownedEncodedByteMessage&) = delete; | 
|  | UnownedEncodedByteMessage(UnownedEncodedByteMessage&&) = delete; | 
|  | UnownedEncodedByteMessage* operator=(const UnownedEncodedByteMessage&) = | 
|  | delete; | 
|  | UnownedEncodedByteMessage* operator=(UnownedEncodedByteMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.status() == ZX_OK; } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingByteMessage& GetOutgoingMessage() { return message_; } | 
|  |  | 
|  | private: | 
|  | ::fidl::OutgoingByteMessage message_; | 
|  | }; | 
|  |  | 
|  | class UnownedEncodedIovecMessage final { | 
|  | public: | 
|  | UnownedEncodedIovecMessage(zx_channel_iovec_t* iovecs, uint32_t iovec_size, | 
|  | fidl_iovec_substitution_t* substitutions, | 
|  | uint32_t substitutions_size, Table* value) | 
|  | : message_(::fidl::OutgoingIovecMessage::constructor_args{ | 
|  | .iovecs = iovecs, | 
|  | .iovecs_actual = 0, | 
|  | .iovecs_capacity = iovec_size, | 
|  | .substitutions = substitutions, | 
|  | .substitutions_actual = 0, | 
|  | .substitutions_capacity = substitutions_size, | 
|  | .handles = nullptr, | 
|  | .handle_actual = 0, | 
|  | .handle_capacity = 0, | 
|  | }) { | 
|  | message_.Encode<Table>(value); | 
|  | } | 
|  | UnownedEncodedIovecMessage(const UnownedEncodedIovecMessage&) = delete; | 
|  | UnownedEncodedIovecMessage(UnownedEncodedIovecMessage&&) = delete; | 
|  | UnownedEncodedIovecMessage* operator=(const UnownedEncodedIovecMessage&) = | 
|  | delete; | 
|  | UnownedEncodedIovecMessage* operator=(UnownedEncodedIovecMessage&&) = | 
|  | delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.status() == ZX_OK; } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingIovecMessage& GetOutgoingMessage() { return message_; } | 
|  |  | 
|  | private: | 
|  | ::fidl::OutgoingIovecMessage message_; | 
|  | }; | 
|  |  | 
|  | class OwnedEncodedByteMessage final { | 
|  | public: | 
|  | explicit OwnedEncodedByteMessage(Table* value) | 
|  | : message_(bytes_, sizeof(bytes_), value) {} | 
|  | OwnedEncodedByteMessage(const OwnedEncodedByteMessage&) = delete; | 
|  | OwnedEncodedByteMessage(OwnedEncodedByteMessage&&) = delete; | 
|  | OwnedEncodedByteMessage* operator=(const OwnedEncodedByteMessage&) = delete; | 
|  | OwnedEncodedByteMessage* operator=(OwnedEncodedByteMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.ok(); } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingByteMessage& GetOutgoingMessage() { | 
|  | return message_.GetOutgoingMessage(); | 
|  | } | 
|  |  | 
|  | private: | 
|  | FIDL_ALIGNDECL | 
|  | uint8_t bytes_[FIDL_ALIGN(PrimarySize + MaxOutOfLine)]; | 
|  | UnownedEncodedByteMessage message_; | 
|  | }; | 
|  |  | 
|  | class OwnedEncodedIovecMessage final { | 
|  | public: | 
|  | explicit OwnedEncodedIovecMessage(Table* value) | 
|  | : message_(iovecs_, ::fidl::internal::kIovecBufferSize, substitutions_, | 
|  | ::fidl::internal::kIovecBufferSize, value) {} | 
|  | OwnedEncodedIovecMessage(const OwnedEncodedIovecMessage&) = delete; | 
|  | OwnedEncodedIovecMessage(OwnedEncodedIovecMessage&&) = delete; | 
|  | OwnedEncodedIovecMessage* operator=(const OwnedEncodedIovecMessage&) = | 
|  | delete; | 
|  | OwnedEncodedIovecMessage* operator=(OwnedEncodedIovecMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.ok(); } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingIovecMessage& GetOutgoingMessage() { | 
|  | return message_.GetOutgoingMessage(); | 
|  | } | 
|  |  | 
|  | private: | 
|  | zx_channel_iovec_t iovecs_[::fidl::internal::kIovecBufferSize]; | 
|  | fidl_iovec_substitution_t | 
|  | substitutions_[::fidl::internal::kIovecBufferSize]; | 
|  | UnownedEncodedIovecMessage message_; | 
|  | }; | 
|  |  | 
|  | public: | 
|  | friend ::fidl::internal::EncodedMessageTypes<Table>; | 
|  | using OwnedEncodedMessage = OwnedEncodedByteMessage; | 
|  | using UnownedEncodedMessage = UnownedEncodedByteMessage; | 
|  |  | 
|  | class DecodedMessage final : public ::fidl::internal::IncomingMessage { | 
|  | public: | 
|  | DecodedMessage(uint8_t* bytes, uint32_t byte_actual, | 
|  | zx_handle_info_t* handles = nullptr, | 
|  | uint32_t handle_actual = 0) | 
|  | : ::fidl::internal::IncomingMessage(bytes, byte_actual, handles, | 
|  | handle_actual) { | 
|  | Decode<Table>(); | 
|  | } | 
|  | DecodedMessage(fidl_incoming_msg_t* msg) | 
|  | : ::fidl::internal::IncomingMessage(msg) { | 
|  | Decode<Table>(); | 
|  | } | 
|  | DecodedMessage(const DecodedMessage&) = delete; | 
|  | DecodedMessage(DecodedMessage&&) = delete; | 
|  | DecodedMessage* operator=(const DecodedMessage&) = delete; | 
|  | DecodedMessage* operator=(DecodedMessage&&) = delete; | 
|  |  | 
|  | Table* PrimaryObject() { | 
|  | ZX_DEBUG_ASSERT(ok()); | 
|  | return reinterpret_cast<Table*>(bytes()); | 
|  | } | 
|  |  | 
|  | // Release the ownership of the decoded message. That means that the handles | 
|  | // won't be closed When the object is destroyed. After calling this method, | 
|  | // the DecodedMessage object should not be used anymore. | 
|  | void ReleasePrimaryObject() { ResetBytes(); } | 
|  | }; | 
|  |  | 
|  | class Builder; | 
|  | class UnownedBuilder; | 
|  |  | 
|  | class Frame final { | 
|  | public: | 
|  | Frame() = default; | 
|  | // In its intended usage, Frame will be referenced by a tracking_ptr. If the | 
|  | // tracking_ptr is assigned before a move or copy, then it will reference | 
|  | // the old invalid object. Because this is unsafe, copies are disallowed and | 
|  | // moves are only allowed by friend classes that operate safely. | 
|  | Frame(const Frame&) = delete; | 
|  | Frame& operator=(const Frame&) = delete; | 
|  |  | 
|  | private: | 
|  | Frame(Frame&&) noexcept = default; | 
|  | Frame& operator=(Frame&&) noexcept = default; | 
|  | ::fidl::Envelope<int32_t> Field_; | 
|  |  | 
|  | friend class Table; | 
|  | friend class Table::Builder; | 
|  | friend class Table::UnownedBuilder; | 
|  | }; | 
|  |  | 
|  | private: | 
|  | Table(uint64_t max_ordinal, ::fidl::tracking_ptr<Frame>&& frame_ptr) | 
|  | : max_ordinal_(max_ordinal), frame_ptr_(std::move(frame_ptr)) {} | 
|  | uint64_t max_ordinal_ = 0; | 
|  | ::fidl::tracking_ptr<Frame> frame_ptr_; | 
|  | }; | 
|  |  | 
|  | // Table::Builder builds Table. | 
|  | // Usage: | 
|  | // Table val = Table::Builder(std::make_unique<Table::Frame>()) | 
|  | // .set_Field(ptr) | 
|  | // .build(); | 
|  | class Table::Builder final { | 
|  | public: | 
|  | ~Builder() = default; | 
|  | Builder() = delete; | 
|  | Builder(::fidl::tracking_ptr<Table::Frame>&& frame_ptr) | 
|  | : max_ordinal_(0), frame_ptr_(std::move(frame_ptr)) {} | 
|  |  | 
|  | Builder(Builder&& other) noexcept = default; | 
|  | Builder& operator=(Builder&& other) noexcept = default; | 
|  |  | 
|  | Builder(const Builder& other) = delete; | 
|  | Builder& operator=(const Builder& other) = delete; | 
|  |  | 
|  | // Returns whether no field is set. | 
|  | bool IsEmpty() const { return max_ordinal_ == 0; } | 
|  |  | 
|  | // table field comment #1 | 
|  | // | 
|  | // table field comment #3 | 
|  | Builder&& set_Field(::fidl::tracking_ptr<int32_t> elem) { | 
|  | frame_ptr_->Field_.data = std::move(elem); | 
|  | if (max_ordinal_ < 1) { | 
|  | // Note: the table size is not currently reduced if nullptr is set. | 
|  | // This is possible to reconsider in the future. | 
|  | max_ordinal_ = 1; | 
|  | } | 
|  | return std::move(*this); | 
|  | } | 
|  | const int32_t& Field() const { | 
|  | ZX_ASSERT(has_Field()); | 
|  | return *frame_ptr_->Field_.data; | 
|  | } | 
|  | int32_t& Field() { | 
|  | ZX_ASSERT(has_Field()); | 
|  | return *frame_ptr_->Field_.data; | 
|  | } | 
|  | bool has_Field() const { | 
|  | return max_ordinal_ >= 1 && frame_ptr_->Field_.data != nullptr; | 
|  | } | 
|  |  | 
|  | Table build() { return Table(max_ordinal_, std::move(frame_ptr_)); } | 
|  |  | 
|  | private: | 
|  | uint64_t max_ordinal_ = 0; | 
|  | ::fidl::tracking_ptr<Table::Frame> frame_ptr_; | 
|  | }; | 
|  |  | 
|  | // UnownedBuilder acts like Builder but directly owns its Frame, simplifying | 
|  | // working with unowned data. | 
|  | class Table::UnownedBuilder final { | 
|  | public: | 
|  | ~UnownedBuilder() = default; | 
|  | UnownedBuilder() noexcept = default; | 
|  | UnownedBuilder(UnownedBuilder&& other) noexcept = default; | 
|  | UnownedBuilder& operator=(UnownedBuilder&& other) noexcept = default; | 
|  |  | 
|  | // Returns whether no field is set. | 
|  | bool IsEmpty() const { return max_ordinal_ == 0; } | 
|  |  | 
|  | // table field comment #1 | 
|  | // | 
|  | // table field comment #3 | 
|  | UnownedBuilder&& set_Field(::fidl::tracking_ptr<int32_t> elem) { | 
|  | ZX_ASSERT(elem); | 
|  | frame_.Field_.data = std::move(elem); | 
|  | if (max_ordinal_ < 1) { | 
|  | max_ordinal_ = 1; | 
|  | } | 
|  | return std::move(*this); | 
|  | } | 
|  | const int32_t& Field() const { | 
|  | ZX_ASSERT(has_Field()); | 
|  | return *frame_.Field_.data; | 
|  | } | 
|  | int32_t& Field() { | 
|  | ZX_ASSERT(has_Field()); | 
|  | return *frame_.Field_.data; | 
|  | } | 
|  | bool has_Field() const { | 
|  | return max_ordinal_ >= 1 && frame_.Field_.data != nullptr; | 
|  | } | 
|  |  | 
|  | Table build() { return Table(max_ordinal_, ::fidl::unowned_ptr(&frame_)); } | 
|  |  | 
|  | private: | 
|  | uint64_t max_ordinal_ = 0; | 
|  | Table::Frame frame_; | 
|  | }; | 
|  | }  // namespace wire | 
|  | using Table = ::llcpp::fidl::test::doccomments::wire::Table; | 
|  | namespace wire { | 
|  |  | 
|  | extern "C" const fidl_type_t fidl_test_doccomments_StrictUnionTable; | 
|  |  | 
|  | // strict union comment #1 | 
|  | // | 
|  | // strict union comment #3 | 
|  | class StrictUnion { | 
|  | public: | 
|  | StrictUnion() : ordinal_(Ordinal::Invalid), envelope_{} {} | 
|  |  | 
|  | StrictUnion(StrictUnion&&) = default; | 
|  | StrictUnion& operator=(StrictUnion&&) = default; | 
|  |  | 
|  | ~StrictUnion() { reset_ptr(nullptr); } | 
|  |  | 
|  | enum class Tag : fidl_xunion_tag_t { | 
|  | kField = 1,  // 0x1 | 
|  | }; | 
|  |  | 
|  | bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; } | 
|  |  | 
|  | bool is_Field() const { return ordinal_ == Ordinal::kField; } | 
|  |  | 
|  | static StrictUnion WithField(::fidl::tracking_ptr<int32_t>&& val) { | 
|  | StrictUnion result; | 
|  | result.set_Field(std::move(val)); | 
|  | return result; | 
|  | } | 
|  |  | 
|  | template <typename... Args> | 
|  | static StrictUnion WithField(::fidl::AnyAllocator& allocator, | 
|  | Args&&... args) { | 
|  | StrictUnion result; | 
|  | result.set_Field( | 
|  | ::fidl::ObjectView<int32_t>(allocator, std::forward<Args>(args)...)); | 
|  | return result; | 
|  | } | 
|  | template <typename... Args> | 
|  | static StrictUnion WithField(::fidl::Allocator& allocator, Args&&... args) { | 
|  | StrictUnion result; | 
|  | result.set_Field( | 
|  | ::fidl::tracking_ptr<int32_t>(allocator, std::forward<Args>(args)...)); | 
|  | return result; | 
|  | } | 
|  |  | 
|  | // union member comment #1 | 
|  | // | 
|  | // union member comment #3 | 
|  | void set_Field(::fidl::tracking_ptr<int32_t>&& elem) { | 
|  | ordinal_ = Ordinal::kField; | 
|  | reset_ptr(static_cast<::fidl::tracking_ptr<void>>(std::move(elem))); | 
|  | } | 
|  |  | 
|  | template <typename... Args> | 
|  | void set_Field(::fidl::AnyAllocator& allocator, Args&&... args) { | 
|  | ordinal_ = Ordinal::kField; | 
|  | set_Field( | 
|  | ::fidl::ObjectView<int32_t>(allocator, std::forward<Args>(args)...)); | 
|  | } | 
|  | template <typename... Args> | 
|  | void set_Field(::fidl::Allocator& allocator, Args&&... args) { | 
|  | ordinal_ = Ordinal::kField; | 
|  | set_Field( | 
|  | ::fidl::tracking_ptr<int32_t>(allocator, std::forward<Args>(args)...)); | 
|  | } | 
|  |  | 
|  | // union member comment #1 | 
|  | // | 
|  | // union member comment #3 | 
|  | int32_t& mutable_Field() { | 
|  | ZX_ASSERT(ordinal_ == Ordinal::kField); | 
|  | return *static_cast<int32_t*>(envelope_.data.get()); | 
|  | } | 
|  | const int32_t& Field() const { | 
|  | ZX_ASSERT(ordinal_ == Ordinal::kField); | 
|  | return *static_cast<int32_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_doccomments_StrictUnionTable; | 
|  | 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, | 
|  | kField = 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<int32_t> to_destroy = | 
|  | static_cast<::fidl::tracking_ptr<int32_t>>( | 
|  | std::move(envelope_.data)); | 
|  | break; | 
|  | } | 
|  | } | 
|  |  | 
|  | envelope_.data = std::move(new_ptr); | 
|  | } | 
|  |  | 
|  | static void SizeAndOffsetAssertionHelper(); | 
|  | Ordinal ordinal_; | 
|  | FIDL_ALIGNDECL | 
|  | ::fidl::Envelope<void> envelope_; | 
|  | }; | 
|  |  | 
|  | extern "C" const fidl_type_t fidl_test_doccomments_FlexibleUnionTable; | 
|  |  | 
|  | // flexible union comment #1 | 
|  | // | 
|  | // flexible union comment #3 | 
|  | class FlexibleUnion { | 
|  | public: | 
|  | FlexibleUnion() : ordinal_(Ordinal::Invalid), envelope_{} {} | 
|  |  | 
|  | FlexibleUnion(FlexibleUnion&&) = default; | 
|  | FlexibleUnion& operator=(FlexibleUnion&&) = default; | 
|  |  | 
|  | ~FlexibleUnion() { reset_ptr(nullptr); } | 
|  |  | 
|  | enum class Tag : fidl_xunion_tag_t { | 
|  | kField = 1,  // 0x1 | 
|  | kUnknown = ::std::numeric_limits<::fidl_union_tag_t>::max(), | 
|  | }; | 
|  |  | 
|  | bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; } | 
|  |  | 
|  | bool is_Field() const { return ordinal_ == Ordinal::kField; } | 
|  |  | 
|  | static FlexibleUnion WithField(::fidl::tracking_ptr<int32_t>&& val) { | 
|  | FlexibleUnion result; | 
|  | result.set_Field(std::move(val)); | 
|  | return result; | 
|  | } | 
|  |  | 
|  | template <typename... Args> | 
|  | static FlexibleUnion WithField(::fidl::AnyAllocator& allocator, | 
|  | Args&&... args) { | 
|  | FlexibleUnion result; | 
|  | result.set_Field( | 
|  | ::fidl::ObjectView<int32_t>(allocator, std::forward<Args>(args)...)); | 
|  | return result; | 
|  | } | 
|  | template <typename... Args> | 
|  | static FlexibleUnion WithField(::fidl::Allocator& allocator, Args&&... args) { | 
|  | FlexibleUnion result; | 
|  | result.set_Field( | 
|  | ::fidl::tracking_ptr<int32_t>(allocator, std::forward<Args>(args)...)); | 
|  | return result; | 
|  | } | 
|  |  | 
|  | // union member comment #1 | 
|  | // | 
|  | // union member comment #3 | 
|  | void set_Field(::fidl::tracking_ptr<int32_t>&& elem) { | 
|  | ordinal_ = Ordinal::kField; | 
|  | reset_ptr(static_cast<::fidl::tracking_ptr<void>>(std::move(elem))); | 
|  | } | 
|  |  | 
|  | template <typename... Args> | 
|  | void set_Field(::fidl::AnyAllocator& allocator, Args&&... args) { | 
|  | ordinal_ = Ordinal::kField; | 
|  | set_Field( | 
|  | ::fidl::ObjectView<int32_t>(allocator, std::forward<Args>(args)...)); | 
|  | } | 
|  | template <typename... Args> | 
|  | void set_Field(::fidl::Allocator& allocator, Args&&... args) { | 
|  | ordinal_ = Ordinal::kField; | 
|  | set_Field( | 
|  | ::fidl::tracking_ptr<int32_t>(allocator, std::forward<Args>(args)...)); | 
|  | } | 
|  |  | 
|  | // union member comment #1 | 
|  | // | 
|  | // union member comment #3 | 
|  | int32_t& mutable_Field() { | 
|  | ZX_ASSERT(ordinal_ == Ordinal::kField); | 
|  | return *static_cast<int32_t*>(envelope_.data.get()); | 
|  | } | 
|  | const int32_t& Field() const { | 
|  | ZX_ASSERT(ordinal_ == Ordinal::kField); | 
|  | return *static_cast<int32_t*>(envelope_.data.get()); | 
|  | } | 
|  | Tag which() const; | 
|  |  | 
|  | static constexpr const fidl_type_t* Type = | 
|  | &fidl_test_doccomments_FlexibleUnionTable; | 
|  | 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, | 
|  | kField = 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<int32_t> to_destroy = | 
|  | static_cast<::fidl::tracking_ptr<int32_t>>( | 
|  | std::move(envelope_.data)); | 
|  | break; | 
|  | } | 
|  | } | 
|  |  | 
|  | envelope_.data = std::move(new_ptr); | 
|  | } | 
|  |  | 
|  | static void SizeAndOffsetAssertionHelper(); | 
|  | Ordinal ordinal_; | 
|  | FIDL_ALIGNDECL | 
|  | ::fidl::Envelope<void> envelope_; | 
|  | }; | 
|  |  | 
|  | extern "C" const fidl_type_t fidl_test_doccomments_StructTable; | 
|  |  | 
|  | // struct comment #1 | 
|  | // | 
|  | // struct comment #3 | 
|  | struct Struct { | 
|  | static constexpr const fidl_type_t* Type = &fidl_test_doccomments_StructTable; | 
|  | static constexpr uint32_t MaxNumHandles = 0; | 
|  | static constexpr uint32_t PrimarySize = 4; | 
|  | [[maybe_unused]] static constexpr uint32_t MaxOutOfLine = 0; | 
|  | static constexpr bool HasPointer = false; | 
|  |  | 
|  | // struct member comment #1 | 
|  | // | 
|  | // struct member comment #3 | 
|  | int32_t Field = {}; | 
|  |  | 
|  | private: | 
|  | class UnownedEncodedByteMessage final { | 
|  | public: | 
|  | UnownedEncodedByteMessage(uint8_t* bytes, uint32_t byte_size, Struct* value) | 
|  | : message_(bytes, byte_size, sizeof(Struct), nullptr, 0, 0) { | 
|  | message_.Encode<Struct>(value); | 
|  | } | 
|  | UnownedEncodedByteMessage(const UnownedEncodedByteMessage&) = delete; | 
|  | UnownedEncodedByteMessage(UnownedEncodedByteMessage&&) = delete; | 
|  | UnownedEncodedByteMessage* operator=(const UnownedEncodedByteMessage&) = | 
|  | delete; | 
|  | UnownedEncodedByteMessage* operator=(UnownedEncodedByteMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.status() == ZX_OK; } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingByteMessage& GetOutgoingMessage() { return message_; } | 
|  |  | 
|  | private: | 
|  | ::fidl::OutgoingByteMessage message_; | 
|  | }; | 
|  |  | 
|  | class UnownedEncodedIovecMessage final { | 
|  | public: | 
|  | UnownedEncodedIovecMessage(zx_channel_iovec_t* iovecs, uint32_t iovec_size, | 
|  | fidl_iovec_substitution_t* substitutions, | 
|  | uint32_t substitutions_size, Struct* value) | 
|  | : message_(::fidl::OutgoingIovecMessage::constructor_args{ | 
|  | .iovecs = iovecs, | 
|  | .iovecs_actual = 0, | 
|  | .iovecs_capacity = iovec_size, | 
|  | .substitutions = substitutions, | 
|  | .substitutions_actual = 0, | 
|  | .substitutions_capacity = substitutions_size, | 
|  | .handles = nullptr, | 
|  | .handle_actual = 0, | 
|  | .handle_capacity = 0, | 
|  | }) { | 
|  | message_.Encode<Struct>(value); | 
|  | } | 
|  | UnownedEncodedIovecMessage(const UnownedEncodedIovecMessage&) = delete; | 
|  | UnownedEncodedIovecMessage(UnownedEncodedIovecMessage&&) = delete; | 
|  | UnownedEncodedIovecMessage* operator=(const UnownedEncodedIovecMessage&) = | 
|  | delete; | 
|  | UnownedEncodedIovecMessage* operator=(UnownedEncodedIovecMessage&&) = | 
|  | delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.status() == ZX_OK; } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingIovecMessage& GetOutgoingMessage() { return message_; } | 
|  |  | 
|  | private: | 
|  | ::fidl::OutgoingIovecMessage message_; | 
|  | }; | 
|  |  | 
|  | class OwnedEncodedByteMessage final { | 
|  | public: | 
|  | explicit OwnedEncodedByteMessage(Struct* value) | 
|  | : message_(bytes_, sizeof(bytes_), value) {} | 
|  | OwnedEncodedByteMessage(const OwnedEncodedByteMessage&) = delete; | 
|  | OwnedEncodedByteMessage(OwnedEncodedByteMessage&&) = delete; | 
|  | OwnedEncodedByteMessage* operator=(const OwnedEncodedByteMessage&) = delete; | 
|  | OwnedEncodedByteMessage* operator=(OwnedEncodedByteMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.ok(); } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingByteMessage& GetOutgoingMessage() { | 
|  | return message_.GetOutgoingMessage(); | 
|  | } | 
|  |  | 
|  | private: | 
|  | FIDL_ALIGNDECL | 
|  | uint8_t bytes_[FIDL_ALIGN(PrimarySize + MaxOutOfLine)]; | 
|  | UnownedEncodedByteMessage message_; | 
|  | }; | 
|  |  | 
|  | class OwnedEncodedIovecMessage final { | 
|  | public: | 
|  | explicit OwnedEncodedIovecMessage(Struct* value) | 
|  | : message_(iovecs_, ::fidl::internal::kIovecBufferSize, substitutions_, | 
|  | ::fidl::internal::kIovecBufferSize, value) {} | 
|  | OwnedEncodedIovecMessage(const OwnedEncodedIovecMessage&) = delete; | 
|  | OwnedEncodedIovecMessage(OwnedEncodedIovecMessage&&) = delete; | 
|  | OwnedEncodedIovecMessage* operator=(const OwnedEncodedIovecMessage&) = | 
|  | delete; | 
|  | OwnedEncodedIovecMessage* operator=(OwnedEncodedIovecMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.ok(); } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingIovecMessage& GetOutgoingMessage() { | 
|  | return message_.GetOutgoingMessage(); | 
|  | } | 
|  |  | 
|  | private: | 
|  | zx_channel_iovec_t iovecs_[::fidl::internal::kIovecBufferSize]; | 
|  | fidl_iovec_substitution_t | 
|  | substitutions_[::fidl::internal::kIovecBufferSize]; | 
|  | UnownedEncodedIovecMessage message_; | 
|  | }; | 
|  |  | 
|  | public: | 
|  | friend ::fidl::internal::EncodedMessageTypes<Struct>; | 
|  | using OwnedEncodedMessage = OwnedEncodedByteMessage; | 
|  | using UnownedEncodedMessage = UnownedEncodedByteMessage; | 
|  |  | 
|  | class DecodedMessage final : public ::fidl::internal::IncomingMessage { | 
|  | public: | 
|  | DecodedMessage(uint8_t* bytes, uint32_t byte_actual, | 
|  | zx_handle_info_t* handles = nullptr, | 
|  | uint32_t handle_actual = 0) | 
|  | : ::fidl::internal::IncomingMessage(bytes, byte_actual, handles, | 
|  | handle_actual) { | 
|  | Decode<struct Struct>(); | 
|  | } | 
|  | DecodedMessage(fidl_incoming_msg_t* msg) | 
|  | : ::fidl::internal::IncomingMessage(msg) { | 
|  | Decode<struct Struct>(); | 
|  | } | 
|  | DecodedMessage(const DecodedMessage&) = delete; | 
|  | DecodedMessage(DecodedMessage&&) = delete; | 
|  | DecodedMessage* operator=(const DecodedMessage&) = delete; | 
|  | DecodedMessage* operator=(DecodedMessage&&) = delete; | 
|  |  | 
|  | struct Struct* PrimaryObject() { | 
|  | ZX_DEBUG_ASSERT(ok()); | 
|  | return reinterpret_cast<struct Struct*>(bytes()); | 
|  | } | 
|  |  | 
|  | // Release the ownership of the decoded message. That means that the handles | 
|  | // won't be closed When the object is destroyed. After calling this method, | 
|  | // the DecodedMessage object should not be used anymore. | 
|  | void ReleasePrimaryObject() { ResetBytes(); } | 
|  | }; | 
|  | }; | 
|  |  | 
|  | }  // namespace wire | 
|  | extern "C" const fidl_type_t fidl_test_doccomments_InterfaceMethodRequestTable; | 
|  |  | 
|  | extern "C" const fidl_type_t fidl_test_doccomments_InterfaceMethodResponseTable; | 
|  |  | 
|  | extern "C" const fidl_type_t fidl_test_doccomments_InterfaceOnEventRequestTable; | 
|  |  | 
|  | extern "C" const fidl_type_t fidl_test_doccomments_InterfaceOnEventEventTable; | 
|  |  | 
|  | // interface comment #1 | 
|  | // | 
|  | // interface comment #3 | 
|  | class Interface final { | 
|  | Interface() = delete; | 
|  |  | 
|  | public: | 
|  | struct MethodRequest final { | 
|  | FIDL_ALIGNDECL | 
|  | fidl_message_header_t _hdr; | 
|  | explicit MethodRequest(zx_txid_t _txid) { _InitHeader(_txid); } | 
|  |  | 
|  | static constexpr const fidl_type_t* Type = | 
|  | &::fidl::_llcpp_coding_AnyZeroArgMessageTable; | 
|  | static constexpr uint32_t MaxNumHandles = 0; | 
|  | static constexpr uint32_t PrimarySize = 16; | 
|  | static constexpr uint32_t MaxOutOfLine = 0; | 
|  | static constexpr uint32_t AltPrimarySize = 16; | 
|  | static constexpr uint32_t AltMaxOutOfLine = 0; | 
|  | static constexpr bool HasFlexibleEnvelope = false; | 
|  | static constexpr bool HasPointer = false; | 
|  | static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = | 
|  | ::fidl::internal::TransactionalMessageKind::kRequest; | 
|  |  | 
|  | private: | 
|  | class UnownedEncodedByteMessage final { | 
|  | public: | 
|  | UnownedEncodedByteMessage(uint8_t* _bytes, uint32_t _byte_size, | 
|  | zx_txid_t _txid) | 
|  | : message_(_bytes, _byte_size, sizeof(MethodRequest), nullptr, 0, 0) { | 
|  | FIDL_ALIGNDECL MethodRequest _request(_txid); | 
|  | message_.Encode<MethodRequest>(&_request); | 
|  | } | 
|  | UnownedEncodedByteMessage(uint8_t* bytes, uint32_t byte_size, | 
|  | MethodRequest* request) | 
|  | : message_(bytes, byte_size, sizeof(MethodRequest), nullptr, 0, 0) { | 
|  | message_.Encode<MethodRequest>(request); | 
|  | } | 
|  | UnownedEncodedByteMessage(const UnownedEncodedByteMessage&) = delete; | 
|  | UnownedEncodedByteMessage(UnownedEncodedByteMessage&&) = delete; | 
|  | UnownedEncodedByteMessage* operator=(const UnownedEncodedByteMessage&) = | 
|  | delete; | 
|  | UnownedEncodedByteMessage* operator=(UnownedEncodedByteMessage&&) = | 
|  | delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.status() == ZX_OK; } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingByteMessage& GetOutgoingMessage() { return message_; } | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | template <typename ChannelLike> | 
|  | void Write(ChannelLike&& client) { | 
|  | message_.Write(std::forward<ChannelLike>(client)); | 
|  | } | 
|  | #endif | 
|  |  | 
|  | private: | 
|  | ::fidl::OutgoingByteMessage message_; | 
|  | }; | 
|  |  | 
|  | class UnownedEncodedIovecMessage final { | 
|  | public: | 
|  | UnownedEncodedIovecMessage(zx_channel_iovec_t* iovecs, | 
|  | uint32_t iovec_size, | 
|  | fidl_iovec_substitution_t* substitutions, | 
|  | uint32_t substitutions_size, zx_txid_t _txid) | 
|  | : message_(::fidl::OutgoingIovecMessage::constructor_args{ | 
|  | .iovecs = iovecs, | 
|  | .iovecs_actual = 0, | 
|  | .iovecs_capacity = iovec_size, | 
|  | .substitutions = substitutions, | 
|  | .substitutions_actual = 0, | 
|  | .substitutions_capacity = substitutions_size, | 
|  | .handles = nullptr, | 
|  | .handle_actual = 0, | 
|  | .handle_capacity = 0, | 
|  | }) { | 
|  | FIDL_ALIGNDECL MethodRequest _request(_txid); | 
|  | message_.Encode<MethodRequest>(&_request); | 
|  | } | 
|  | UnownedEncodedIovecMessage(zx_channel_iovec_t* iovecs, | 
|  | uint32_t iovec_size, | 
|  | fidl_iovec_substitution_t* substitutions, | 
|  | uint32_t substitutions_size, | 
|  | MethodRequest* request) | 
|  | : message_(::fidl::OutgoingIovecMessage::constructor_args{ | 
|  | .iovecs = iovecs, | 
|  | .iovecs_actual = 0, | 
|  | .iovecs_capacity = iovec_size, | 
|  | .substitutions = substitutions, | 
|  | .substitutions_actual = 0, | 
|  | .substitutions_capacity = substitutions_size, | 
|  | .handles = nullptr, | 
|  | .handle_actual = 0, | 
|  | .handle_capacity = 0, | 
|  | }) { | 
|  | message_.Encode<MethodRequest>(request); | 
|  | } | 
|  | UnownedEncodedIovecMessage(const UnownedEncodedIovecMessage&) = delete; | 
|  | UnownedEncodedIovecMessage(UnownedEncodedIovecMessage&&) = delete; | 
|  | UnownedEncodedIovecMessage* operator=(const UnownedEncodedIovecMessage&) = | 
|  | delete; | 
|  | UnownedEncodedIovecMessage* operator=(UnownedEncodedIovecMessage&&) = | 
|  | delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.status() == ZX_OK; } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingIovecMessage& GetOutgoingMessage() { return message_; } | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | template <typename ChannelLike> | 
|  | void Write(ChannelLike&& client) { | 
|  | message_.Write(std::forward<ChannelLike>(client)); | 
|  | } | 
|  | #endif | 
|  |  | 
|  | private: | 
|  | ::fidl::OutgoingIovecMessage message_; | 
|  | }; | 
|  |  | 
|  | class OwnedEncodedByteMessage final { | 
|  | public: | 
|  | explicit OwnedEncodedByteMessage(zx_txid_t _txid) | 
|  | : message_(bytes_, sizeof(bytes_), _txid) {} | 
|  | explicit OwnedEncodedByteMessage(MethodRequest* request) | 
|  | : message_(bytes_, sizeof(bytes_), request) {} | 
|  | OwnedEncodedByteMessage(const OwnedEncodedByteMessage&) = delete; | 
|  | OwnedEncodedByteMessage(OwnedEncodedByteMessage&&) = delete; | 
|  | OwnedEncodedByteMessage* operator=(const OwnedEncodedByteMessage&) = | 
|  | delete; | 
|  | OwnedEncodedByteMessage* operator=(OwnedEncodedByteMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.ok(); } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingByteMessage& GetOutgoingMessage() { | 
|  | return message_.GetOutgoingMessage(); | 
|  | } | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | template <typename ChannelLike> | 
|  | void Write(ChannelLike&& client) { | 
|  | message_.Write(std::forward<ChannelLike>(client)); | 
|  | } | 
|  | #endif | 
|  |  | 
|  | private: | 
|  | FIDL_ALIGNDECL | 
|  | uint8_t bytes_[PrimarySize + MaxOutOfLine]; | 
|  | UnownedEncodedByteMessage message_; | 
|  | }; | 
|  |  | 
|  | class OwnedEncodedIovecMessage final { | 
|  | public: | 
|  | explicit OwnedEncodedIovecMessage(zx_txid_t _txid) | 
|  | : message_(iovecs_, ::fidl::internal::kIovecBufferSize, | 
|  | substitutions_, ::fidl::internal::kIovecBufferSize, | 
|  | _txid) {} | 
|  | explicit OwnedEncodedIovecMessage(MethodRequest* request) | 
|  | : message_(iovecs_, ::fidl::internal::kIovecBufferSize, | 
|  | substitutions_, ::fidl::internal::kIovecBufferSize, | 
|  | request) {} | 
|  | OwnedEncodedIovecMessage(const OwnedEncodedIovecMessage&) = delete; | 
|  | OwnedEncodedIovecMessage(OwnedEncodedIovecMessage&&) = delete; | 
|  | OwnedEncodedIovecMessage* operator=(const OwnedEncodedIovecMessage&) = | 
|  | delete; | 
|  | OwnedEncodedIovecMessage* operator=(OwnedEncodedIovecMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.ok(); } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingIovecMessage& GetOutgoingMessage() { | 
|  | return message_.GetOutgoingMessage(); | 
|  | } | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | template <typename ChannelLike> | 
|  | void Write(ChannelLike&& client) { | 
|  | message_.Write(std::forward<ChannelLike>(client)); | 
|  | } | 
|  | #endif | 
|  |  | 
|  | private: | 
|  | zx_channel_iovec_t iovecs_[::fidl::internal::kIovecBufferSize]; | 
|  | fidl_iovec_substitution_t | 
|  | substitutions_[::fidl::internal::kIovecBufferSize]; | 
|  | UnownedEncodedIovecMessage message_; | 
|  | }; | 
|  |  | 
|  | public: | 
|  | friend ::fidl::internal::EncodedMessageTypes<MethodRequest>; | 
|  | using OwnedEncodedMessage = OwnedEncodedByteMessage; | 
|  | using UnownedEncodedMessage = UnownedEncodedByteMessage; | 
|  |  | 
|  | class DecodedMessage final : public ::fidl::internal::IncomingMessage { | 
|  | public: | 
|  | DecodedMessage(uint8_t* bytes, uint32_t byte_actual, | 
|  | zx_handle_info_t* handles = nullptr, | 
|  | uint32_t handle_actual = 0) | 
|  | : ::fidl::internal::IncomingMessage(bytes, byte_actual, handles, | 
|  | handle_actual) { | 
|  | Decode<MethodRequest>(); | 
|  | } | 
|  | DecodedMessage(fidl_incoming_msg_t* msg) | 
|  | : ::fidl::internal::IncomingMessage(msg) { | 
|  | Decode<MethodRequest>(); | 
|  | } | 
|  | DecodedMessage(const DecodedMessage&) = delete; | 
|  | DecodedMessage(DecodedMessage&&) = delete; | 
|  | DecodedMessage* operator=(const DecodedMessage&) = delete; | 
|  | DecodedMessage* operator=(DecodedMessage&&) = delete; | 
|  |  | 
|  | MethodRequest* PrimaryObject() { | 
|  | ZX_DEBUG_ASSERT(ok()); | 
|  | return reinterpret_cast<MethodRequest*>(bytes()); | 
|  | } | 
|  |  | 
|  | // Release the ownership of the decoded message. That means that the | 
|  | // handles won't be closed When the object is destroyed. After calling | 
|  | // this method, the DecodedMessage object should not be used anymore. | 
|  | void ReleasePrimaryObject() { ResetBytes(); } | 
|  | }; | 
|  |  | 
|  | private: | 
|  | void _InitHeader(zx_txid_t _txid); | 
|  | }; | 
|  |  | 
|  | struct OnEventResponse final { | 
|  | FIDL_ALIGNDECL | 
|  | fidl_message_header_t _hdr; | 
|  | OnEventResponse() { _InitHeader(); } | 
|  |  | 
|  | static constexpr const fidl_type_t* Type = | 
|  | &::fidl::_llcpp_coding_AnyZeroArgMessageTable; | 
|  | static constexpr uint32_t MaxNumHandles = 0; | 
|  | static constexpr uint32_t PrimarySize = 16; | 
|  | static constexpr uint32_t MaxOutOfLine = 0; | 
|  | static constexpr bool HasFlexibleEnvelope = false; | 
|  | static constexpr bool HasPointer = false; | 
|  | static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = | 
|  | ::fidl::internal::TransactionalMessageKind::kResponse; | 
|  |  | 
|  | private: | 
|  | class UnownedEncodedByteMessage final { | 
|  | public: | 
|  | UnownedEncodedByteMessage(uint8_t* _bytes, uint32_t _byte_size) | 
|  | : message_(_bytes, _byte_size, sizeof(OnEventResponse), nullptr, 0, | 
|  | 0) { | 
|  | FIDL_ALIGNDECL OnEventResponse _response{}; | 
|  | message_.Encode<OnEventResponse>(&_response); | 
|  | } | 
|  | UnownedEncodedByteMessage(uint8_t* bytes, uint32_t byte_size, | 
|  | OnEventResponse* response) | 
|  | : message_(bytes, byte_size, sizeof(OnEventResponse), nullptr, 0, 0) { | 
|  | message_.Encode<OnEventResponse>(response); | 
|  | } | 
|  | UnownedEncodedByteMessage(const UnownedEncodedByteMessage&) = delete; | 
|  | UnownedEncodedByteMessage(UnownedEncodedByteMessage&&) = delete; | 
|  | UnownedEncodedByteMessage* operator=(const UnownedEncodedByteMessage&) = | 
|  | delete; | 
|  | UnownedEncodedByteMessage* operator=(UnownedEncodedByteMessage&&) = | 
|  | delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.status() == ZX_OK; } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingByteMessage& GetOutgoingMessage() { return message_; } | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | template <typename ChannelLike> | 
|  | void Write(ChannelLike&& client) { | 
|  | message_.Write(std::forward<ChannelLike>(client)); | 
|  | } | 
|  | #endif | 
|  |  | 
|  | private: | 
|  | ::fidl::OutgoingByteMessage message_; | 
|  | }; | 
|  |  | 
|  | class UnownedEncodedIovecMessage final { | 
|  | public: | 
|  | UnownedEncodedIovecMessage(zx_channel_iovec_t* iovecs, | 
|  | uint32_t iovec_size, | 
|  | fidl_iovec_substitution_t* substitutions, | 
|  | uint32_t substitutions_size) | 
|  | : message_(::fidl::OutgoingIovecMessage::constructor_args{ | 
|  | .iovecs = iovecs, | 
|  | .iovecs_actual = 0, | 
|  | .iovecs_capacity = iovec_size, | 
|  | .substitutions = substitutions, | 
|  | .substitutions_actual = 0, | 
|  | .substitutions_capacity = substitutions_size, | 
|  | .handles = nullptr, | 
|  | .handle_actual = 0, | 
|  | .handle_capacity = 0, | 
|  | }) { | 
|  | FIDL_ALIGNDECL OnEventResponse _response{}; | 
|  | message_.Encode<OnEventResponse>(&_response); | 
|  | } | 
|  | UnownedEncodedIovecMessage(zx_channel_iovec_t* iovecs, | 
|  | uint32_t iovec_size, | 
|  | fidl_iovec_substitution_t* substitutions, | 
|  | uint32_t substitutions_size, | 
|  | OnEventResponse* response) | 
|  | : message_(::fidl::OutgoingIovecMessage::constructor_args{ | 
|  | .iovecs = iovecs, | 
|  | .iovecs_actual = 0, | 
|  | .iovecs_capacity = iovec_size, | 
|  | .substitutions = substitutions, | 
|  | .substitutions_actual = 0, | 
|  | .substitutions_capacity = substitutions_size, | 
|  | .handles = nullptr, | 
|  | .handle_actual = 0, | 
|  | .handle_capacity = 0, | 
|  | }) { | 
|  | message_.Encode<OnEventResponse>(response); | 
|  | } | 
|  | UnownedEncodedIovecMessage(const UnownedEncodedIovecMessage&) = delete; | 
|  | UnownedEncodedIovecMessage(UnownedEncodedIovecMessage&&) = delete; | 
|  | UnownedEncodedIovecMessage* operator=(const UnownedEncodedIovecMessage&) = | 
|  | delete; | 
|  | UnownedEncodedIovecMessage* operator=(UnownedEncodedIovecMessage&&) = | 
|  | delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.status() == ZX_OK; } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingIovecMessage& GetOutgoingMessage() { return message_; } | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | template <typename ChannelLike> | 
|  | void Write(ChannelLike&& client) { | 
|  | message_.Write(std::forward<ChannelLike>(client)); | 
|  | } | 
|  | #endif | 
|  |  | 
|  | private: | 
|  | ::fidl::OutgoingIovecMessage message_; | 
|  | }; | 
|  |  | 
|  | class OwnedEncodedByteMessage final { | 
|  | public: | 
|  | explicit OwnedEncodedByteMessage() : message_(bytes_, sizeof(bytes_)) {} | 
|  | explicit OwnedEncodedByteMessage(OnEventResponse* response) | 
|  | : message_(bytes_, sizeof(bytes_), response) {} | 
|  | OwnedEncodedByteMessage(const OwnedEncodedByteMessage&) = delete; | 
|  | OwnedEncodedByteMessage(OwnedEncodedByteMessage&&) = delete; | 
|  | OwnedEncodedByteMessage* operator=(const OwnedEncodedByteMessage&) = | 
|  | delete; | 
|  | OwnedEncodedByteMessage* operator=(OwnedEncodedByteMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.ok(); } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingByteMessage& GetOutgoingMessage() { | 
|  | return message_.GetOutgoingMessage(); | 
|  | } | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | template <typename ChannelLike> | 
|  | void Write(ChannelLike&& client) { | 
|  | message_.Write(std::forward<ChannelLike>(client)); | 
|  | } | 
|  | #endif | 
|  |  | 
|  | private: | 
|  | FIDL_ALIGNDECL | 
|  | uint8_t bytes_[PrimarySize + MaxOutOfLine]; | 
|  | UnownedEncodedByteMessage message_; | 
|  | }; | 
|  |  | 
|  | class OwnedEncodedIovecMessage final { | 
|  | public: | 
|  | explicit OwnedEncodedIovecMessage() | 
|  | : message_(iovecs_, ::fidl::internal::kIovecBufferSize, | 
|  | substitutions_, ::fidl::internal::kIovecBufferSize) {} | 
|  | explicit OwnedEncodedIovecMessage(OnEventResponse* response) | 
|  | : message_(iovecs_, ::fidl::internal::kIovecBufferSize, | 
|  | substitutions_, ::fidl::internal::kIovecBufferSize, | 
|  | response) {} | 
|  | OwnedEncodedIovecMessage(const OwnedEncodedIovecMessage&) = delete; | 
|  | OwnedEncodedIovecMessage(OwnedEncodedIovecMessage&&) = delete; | 
|  | OwnedEncodedIovecMessage* operator=(const OwnedEncodedIovecMessage&) = | 
|  | delete; | 
|  | OwnedEncodedIovecMessage* operator=(OwnedEncodedIovecMessage&&) = delete; | 
|  |  | 
|  | zx_status_t status() const { return message_.status(); } | 
|  | #ifdef __Fuchsia__ | 
|  | const char* status_string() const { return message_.status_string(); } | 
|  | #endif | 
|  | bool ok() const { return message_.ok(); } | 
|  | const char* error() const { return message_.error(); } | 
|  |  | 
|  | ::fidl::OutgoingIovecMessage& GetOutgoingMessage() { | 
|  | return message_.GetOutgoingMessage(); | 
|  | } | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | template <typename ChannelLike> | 
|  | void Write(ChannelLike&& client) { | 
|  | message_.Write(std::forward<ChannelLike>(client)); | 
|  | } | 
|  | #endif | 
|  |  | 
|  | private: | 
|  | zx_channel_iovec_t iovecs_[::fidl::internal::kIovecBufferSize]; | 
|  | fidl_iovec_substitution_t | 
|  | substitutions_[::fidl::internal::kIovecBufferSize]; | 
|  | UnownedEncodedIovecMessage message_; | 
|  | }; | 
|  |  | 
|  | public: | 
|  | friend ::fidl::internal::EncodedMessageTypes<OnEventResponse>; | 
|  | using OwnedEncodedMessage = OwnedEncodedByteMessage; | 
|  | using UnownedEncodedMessage = UnownedEncodedByteMessage; | 
|  |  | 
|  | class DecodedMessage final : public ::fidl::internal::IncomingMessage { | 
|  | public: | 
|  | DecodedMessage(uint8_t* bytes, uint32_t byte_actual, | 
|  | zx_handle_info_t* handles = nullptr, | 
|  | uint32_t handle_actual = 0) | 
|  | : ::fidl::internal::IncomingMessage(bytes, byte_actual, handles, | 
|  | handle_actual) { | 
|  | Decode<OnEventResponse>(); | 
|  | } | 
|  | DecodedMessage(fidl_incoming_msg_t* msg) | 
|  | : ::fidl::internal::IncomingMessage(msg) { | 
|  | Decode<OnEventResponse>(); | 
|  | } | 
|  | DecodedMessage(const DecodedMessage&) = delete; | 
|  | DecodedMessage(DecodedMessage&&) = delete; | 
|  | DecodedMessage* operator=(const DecodedMessage&) = delete; | 
|  | DecodedMessage* operator=(DecodedMessage&&) = delete; | 
|  |  | 
|  | OnEventResponse* PrimaryObject() { | 
|  | ZX_DEBUG_ASSERT(ok()); | 
|  | return reinterpret_cast<OnEventResponse*>(bytes()); | 
|  | } | 
|  |  | 
|  | // Release the ownership of the decoded message. That means that the | 
|  | // handles won't be closed When the object is destroyed. After calling | 
|  | // this method, the DecodedMessage object should not be used anymore. | 
|  | void ReleasePrimaryObject() { ResetBytes(); } | 
|  | }; | 
|  |  | 
|  | private: | 
|  | void _InitHeader(); | 
|  | }; | 
|  |  | 
|  | class EventHandlerInterface { | 
|  | public: | 
|  | EventHandlerInterface() = default; | 
|  | virtual ~EventHandlerInterface() = default; | 
|  | // event comment #1 | 
|  | // | 
|  | // event comment #3 | 
|  | virtual void OnEvent(OnEventResponse* event) {} | 
|  | }; | 
|  |  | 
|  | class SyncEventHandler : public EventHandlerInterface { | 
|  | public: | 
|  | SyncEventHandler() = default; | 
|  |  | 
|  | // Method called when an unknown event is found. This methods gives the | 
|  | // status which, in this case, is returned by HandleOneEvent. | 
|  | virtual zx_status_t Unknown() = 0; | 
|  |  | 
|  | // Handle all possible events defined in this protocol. | 
|  | // Blocks to consume exactly one message from the channel, then call the | 
|  | // corresponding virtual method. | 
|  | ::fidl::Result HandleOneEvent( | 
|  | ::fidl::UnownedClientEnd<::llcpp::fidl::test::doccomments::Interface> | 
|  | client_end); | 
|  | }; | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | // Collection of return types of FIDL calls in this protocol. | 
|  | class ResultOf final { | 
|  | ResultOf() = delete; | 
|  |  | 
|  | public: | 
|  | class Method final : public ::fidl::Result { | 
|  | public: | 
|  | explicit Method( | 
|  | ::fidl::UnownedClientEnd<::llcpp::fidl::test::doccomments::Interface> | 
|  | _client); | 
|  | explicit Method(const ::fidl::Result& result) : ::fidl::Result(result) {} | 
|  | Method(Method&&) = delete; | 
|  | Method(const Method&) = delete; | 
|  | Method* operator=(Method&&) = delete; | 
|  | Method* operator=(const Method&) = delete; | 
|  | ~Method() = default; | 
|  |  | 
|  | private: | 
|  | }; | 
|  | }; | 
|  |  | 
|  | // Collection of return types of FIDL calls in this protocol, | 
|  | // when the caller-allocate flavor or in-place call is used. | 
|  | class UnownedResultOf final { | 
|  | UnownedResultOf() = delete; | 
|  |  | 
|  | public: | 
|  | class Method final : public ::fidl::Result { | 
|  | public: | 
|  | explicit Method( | 
|  | ::fidl::UnownedClientEnd<::llcpp::fidl::test::doccomments::Interface> | 
|  | _client); | 
|  | explicit Method(const ::fidl::Result& result) : ::fidl::Result(result) {} | 
|  | Method(Method&&) = delete; | 
|  | Method(const Method&) = delete; | 
|  | Method* operator=(Method&&) = delete; | 
|  | Method* operator=(const Method&) = delete; | 
|  | ~Method() = default; | 
|  | }; | 
|  | }; | 
|  |  | 
|  | // Methods to make a sync FIDL call directly on an unowned channel or a | 
|  | // const reference to a | 
|  | // |fidl::ClientEnd<::llcpp::fidl::test::doccomments::Interface>|, avoiding | 
|  | // setting up a client. | 
|  | class Call final { | 
|  | Call() = delete; | 
|  |  | 
|  | public: | 
|  | // method comment #1 | 
|  | // | 
|  | // method comment #3 | 
|  | // Allocates 16 bytes of message buffer on the stack. No heap allocation | 
|  | // necessary. | 
|  | static ResultOf::Method Method( | 
|  | ::fidl::UnownedClientEnd<::llcpp::fidl::test::doccomments::Interface> | 
|  | _client_end) { | 
|  | return ResultOf::Method(_client_end); | 
|  | } | 
|  | }; | 
|  |  | 
|  | class SyncClient final { | 
|  | public: | 
|  | SyncClient() = default; | 
|  |  | 
|  | explicit SyncClient(::fidl::ClientEnd<Interface> client_end) | 
|  | : client_end_(std::move(client_end)) {} | 
|  |  | 
|  | ~SyncClient() = default; | 
|  | SyncClient(SyncClient&&) = default; | 
|  | SyncClient& operator=(SyncClient&&) = default; | 
|  |  | 
|  | const ::fidl::ClientEnd<Interface>& client_end() const { | 
|  | return client_end_; | 
|  | } | 
|  | ::fidl::ClientEnd<Interface>& client_end() { return client_end_; } | 
|  |  | 
|  | const ::zx::channel& channel() const { return client_end_.channel(); } | 
|  | ::zx::channel* mutable_channel() { return &client_end_.channel(); } | 
|  |  | 
|  | // method comment #1 | 
|  | // | 
|  | // method comment #3 | 
|  | // Allocates 16 bytes of message buffer on the stack. No heap allocation | 
|  | // necessary. | 
|  | ResultOf::Method Method() { return ResultOf::Method(this->client_end()); } | 
|  |  | 
|  | // Handle all possible events defined in this protocol. | 
|  | // Blocks to consume exactly one message from the channel, then call the | 
|  | // corresponding virtual method defined in |SyncEventHandler|. The return | 
|  | // status of the handler function is folded with any transport-level errors | 
|  | // and returned. | 
|  | ::fidl::Result HandleOneEvent(SyncEventHandler& event_handler) { | 
|  | return event_handler.HandleOneEvent(client_end_); | 
|  | } | 
|  |  | 
|  | private: | 
|  | ::fidl::ClientEnd<Interface> client_end_; | 
|  | }; | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | class AsyncEventHandler; | 
|  | class ClientImpl; | 
|  | #endif | 
|  |  | 
|  | // Pure-virtual interface to be implemented by a server. | 
|  | // This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>| | 
|  | // and |fidl::ServerEnd<SomeProtocol>|). | 
|  | class Interface : public ::fidl::internal::IncomingMessageDispatcher { | 
|  | public: | 
|  | Interface() = default; | 
|  | virtual ~Interface() = default; | 
|  |  | 
|  | // The marker protocol type within which this |Interface| class is defined. | 
|  | using _EnclosingProtocol = Interface; | 
|  |  | 
|  | using MethodCompleter = ::fidl::Completer<>; | 
|  |  | 
|  | // method comment #1 | 
|  | // | 
|  | // method comment #3 | 
|  | virtual void Method(MethodCompleter::Sync& _completer) = 0; | 
|  |  | 
|  | private: | 
|  | ::fidl::DispatchResult dispatch_message(fidl_incoming_msg_t* msg, | 
|  | ::fidl::Transaction* txn) final; | 
|  | }; | 
|  |  | 
|  | // Attempts to dispatch the incoming message to a handler function in the | 
|  | // server implementation. If there is no matching handler, it returns false, | 
|  | // leaving the message and transaction intact. In all other cases, it consumes | 
|  | // the message and returns true. It is possible to chain multiple TryDispatch | 
|  | // functions in this manner. | 
|  | static ::fidl::DispatchResult TryDispatch(Interface* impl, | 
|  | fidl_incoming_msg_t* msg, | 
|  | ::fidl::Transaction* txn); | 
|  |  | 
|  | // Dispatches the incoming message to one of the handlers functions in the | 
|  | // protocol. If there is no matching handler, it closes all the handles in | 
|  | // |msg| and closes the channel with a |ZX_ERR_NOT_SUPPORTED| epitaph, before | 
|  | // returning false. The message should then be discarded. | 
|  | static ::fidl::DispatchResult Dispatch(Interface* impl, | 
|  | fidl_incoming_msg_t* msg, | 
|  | ::fidl::Transaction* txn); | 
|  |  | 
|  | // Same as |Dispatch|, but takes a |void*| instead of |Interface*|. | 
|  | // Only used with |fidl::BindServer| to reduce template expansion. | 
|  | // Do not call this method manually. Use |Dispatch| instead. | 
|  | static ::fidl::DispatchResult TypeErasedDispatch(void* impl, | 
|  | fidl_incoming_msg_t* msg, | 
|  | ::fidl::Transaction* txn) { | 
|  | return Dispatch(static_cast<Interface*>(impl), msg, txn); | 
|  | } | 
|  |  | 
|  | #endif | 
|  |  | 
|  | class EventSender; | 
|  | class WeakEventSender; | 
|  | }; | 
|  |  | 
|  | // service comment #1 | 
|  | // | 
|  | // service comment #3 | 
|  | class Service final { | 
|  | Service() = default; | 
|  |  | 
|  | public: | 
|  | static constexpr char Name[] = "fidl.test.doccomments.Service"; | 
|  |  | 
|  | // Client protocol for connecting to member protocols of a service instance. | 
|  | class ServiceClient final { | 
|  | ServiceClient() = delete; | 
|  |  | 
|  | public: | 
|  | ServiceClient(::zx::channel dir, | 
|  | ::fidl::internal::ConnectMemberFunc connect_func) | 
|  | : dir_(std::move(dir)), connect_func_(connect_func) {} | 
|  |  | 
|  | // Connects to the member protocol "interface". | 
|  | // Returns a |fidl::ClientEnd<::llcpp::fidl::test::doccomments::Interface>| | 
|  | // on success, which can be used with |fidl::BindSyncClient| to create a | 
|  | // synchronous client, or |fidl::Client| to create a client that supports | 
|  | // both asynchronous and synchronous operations. | 
|  | // | 
|  | // # Errors | 
|  | // | 
|  | // On failure, returns a |zx::error| with status != ZX_OK. | 
|  | // Failures can occur if channel creation failed, or if there was an issue | 
|  | // making a |fuchsia.io.Directory/Open| call. | 
|  | // | 
|  | // Since the call to |Open| is asynchronous, an error sent by the remote end | 
|  | // will not result in a failure of this method. Any errors sent by the | 
|  | // remote will appear on the |ClientEnd| returned from this method. | 
|  | ::zx::status<::fidl::ClientEnd<::llcpp::fidl::test::doccomments::Interface>> | 
|  | connect_interface() { | 
|  | auto endpoints = ::fidl::CreateEndpoints< | 
|  | ::llcpp::fidl::test::doccomments::Interface>(); | 
|  | if (endpoints.is_error()) { | 
|  | return endpoints.take_error(); | 
|  | } | 
|  | auto connection = connect_func_(::zx::unowned_channel(dir_), | 
|  | ::fidl::StringView("interface"), | 
|  | endpoints->server.TakeChannel()); | 
|  | if (connection.is_error()) { | 
|  | return connection.take_error(); | 
|  | } | 
|  | return ::zx::ok(std::move(endpoints->client)); | 
|  | } | 
|  |  | 
|  | private: | 
|  | ::zx::channel dir_; | 
|  | ::fidl::internal::ConnectMemberFunc connect_func_; | 
|  | }; | 
|  |  | 
|  | // Facilitates member protocol registration for servers. | 
|  | class Handler final { | 
|  | public: | 
|  | // Constructs a FIDL Service-typed handler. Does not take ownership of | 
|  | // |service_handler|. | 
|  | explicit Handler(::fidl::ServiceHandlerInterface* service_handler) | 
|  | : service_handler_(service_handler) {} | 
|  |  | 
|  | // Adds member "interface" to the service instance. |handler| will be | 
|  | // invoked on connection attempts. | 
|  | // | 
|  | // # Errors | 
|  | // | 
|  | // Returns ZX_ERR_ALREADY_EXISTS if the member was already added. | 
|  | ::zx::status<> add_interface(::fidl::ServiceHandlerInterface::MemberHandler< | 
|  | ::llcpp::fidl::test::doccomments::Interface> | 
|  | handler) { | 
|  | return service_handler_->AddMember("interface", std::move(handler)); | 
|  | } | 
|  |  | 
|  | private: | 
|  | ::fidl::ServiceHandlerInterface* service_handler_;  // Not owned. | 
|  | }; | 
|  | }; | 
|  |  | 
|  | // const comment #1 | 
|  | // | 
|  | // const comment #3 | 
|  | constexpr int32_t C = 4u; | 
|  |  | 
|  | }  // namespace doccomments | 
|  | }  // namespace test | 
|  | }  // namespace fidl | 
|  | }  // namespace llcpp | 
|  | namespace fidl { | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::wire::Table> | 
|  | : public std::true_type {}; | 
|  | template <> | 
|  | struct IsTable<::llcpp::fidl::test::doccomments::wire::Table> | 
|  | : public std::true_type {}; | 
|  | template <> | 
|  | struct IsTableBuilder<::llcpp::fidl::test::doccomments::wire::Table::Builder> | 
|  | : public std::true_type {}; | 
|  | static_assert( | 
|  | std::is_standard_layout_v<::llcpp::fidl::test::doccomments::wire::Table>); | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::wire::Struct> | 
|  | : public std::true_type {}; | 
|  | template <> | 
|  | struct IsStruct<::llcpp::fidl::test::doccomments::wire::Struct> | 
|  | : public std::true_type {}; | 
|  | static_assert( | 
|  | std::is_standard_layout_v<::llcpp::fidl::test::doccomments::wire::Struct>); | 
|  | static_assert(offsetof(::llcpp::fidl::test::doccomments::wire::Struct, Field) == | 
|  | 0); | 
|  | static_assert(sizeof(::llcpp::fidl::test::doccomments::wire::Struct) == | 
|  | ::llcpp::fidl::test::doccomments::wire::Struct::PrimarySize); | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::wire::StrictUnion> | 
|  | : public std::true_type {}; | 
|  | template <> | 
|  | struct IsUnion<::llcpp::fidl::test::doccomments::wire::StrictUnion> | 
|  | : public std::true_type {}; | 
|  | static_assert(std::is_standard_layout_v< | 
|  | ::llcpp::fidl::test::doccomments::wire::StrictUnion>); | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::Interface::MethodRequest> | 
|  | : public std::true_type {}; | 
|  | template <> | 
|  | struct IsFidlMessage<::llcpp::fidl::test::doccomments::Interface::MethodRequest> | 
|  | : public std::true_type {}; | 
|  | static_assert( | 
|  | sizeof(::llcpp::fidl::test::doccomments::Interface::MethodRequest) == | 
|  | ::llcpp::fidl::test::doccomments::Interface::MethodRequest::PrimarySize); | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::Interface::OnEventResponse> | 
|  | : public std::true_type {}; | 
|  | template <> | 
|  | struct IsFidlMessage< | 
|  | ::llcpp::fidl::test::doccomments::Interface::OnEventResponse> | 
|  | : public std::true_type {}; | 
|  | static_assert( | 
|  | sizeof(::llcpp::fidl::test::doccomments::Interface::OnEventResponse) == | 
|  | ::llcpp::fidl::test::doccomments::Interface::OnEventResponse::PrimarySize); | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::wire::MyStrictEnum> | 
|  | : public std::true_type {}; | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::wire::MyStrictBits> | 
|  | : public std::true_type {}; | 
|  | static_assert(std::is_standard_layout_v< | 
|  | ::llcpp::fidl::test::doccomments::wire::MyStrictBits>); | 
|  | static_assert(sizeof(::llcpp::fidl::test::doccomments::wire::MyStrictBits) == | 
|  | sizeof(uint32_t)); | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::wire::MyFlexibleEnum> | 
|  | : public std::true_type {}; | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::wire::MyFlexibleBits> | 
|  | : public std::true_type {}; | 
|  | static_assert(std::is_standard_layout_v< | 
|  | ::llcpp::fidl::test::doccomments::wire::MyFlexibleBits>); | 
|  | static_assert(sizeof(::llcpp::fidl::test::doccomments::wire::MyFlexibleBits) == | 
|  | sizeof(uint32_t)); | 
|  |  | 
|  | template <> | 
|  | struct IsFidlType<::llcpp::fidl::test::doccomments::wire::FlexibleUnion> | 
|  | : public std::true_type {}; | 
|  | template <> | 
|  | struct IsUnion<::llcpp::fidl::test::doccomments::wire::FlexibleUnion> | 
|  | : public std::true_type {}; | 
|  | static_assert(std::is_standard_layout_v< | 
|  | ::llcpp::fidl::test::doccomments::wire::FlexibleUnion>); | 
|  | }  // namespace fidl | 
|  | namespace llcpp { | 
|  | namespace fidl { | 
|  | namespace test { | 
|  | namespace doccomments { | 
|  | namespace wire {}  // namespace wire | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | class Interface::AsyncEventHandler : public Interface::EventHandlerInterface { | 
|  | public: | 
|  | AsyncEventHandler() = default; | 
|  |  | 
|  | virtual void Unbound(::fidl::UnbindInfo info) {} | 
|  | }; | 
|  |  | 
|  | class Interface::ClientImpl final : private ::fidl::internal::ClientBase { | 
|  | public: | 
|  | // method comment #1 | 
|  | // | 
|  | // method comment #3 | 
|  | // | 
|  | // Allocates 16 bytes of message buffer on the stack. No heap allocation | 
|  | // necessary. | 
|  | ::fidl::Result Method(); | 
|  |  | 
|  | AsyncEventHandler* event_handler() const { return event_handler_.get(); } | 
|  |  | 
|  | private: | 
|  | friend class ::fidl::Client<Interface>; | 
|  | friend class ::fidl::internal::ControlBlock<Interface>; | 
|  |  | 
|  | explicit ClientImpl(std::shared_ptr<AsyncEventHandler> event_handler) | 
|  | : event_handler_(std::move(event_handler)) {} | 
|  |  | 
|  | std::optional<::fidl::UnbindInfo> DispatchEvent( | 
|  | fidl_incoming_msg_t* msg) override; | 
|  |  | 
|  | std::shared_ptr<AsyncEventHandler> event_handler_; | 
|  | }; | 
|  | #endif | 
|  |  | 
|  | #ifdef __Fuchsia__ | 
|  | // |EventSender| owns a server endpoint of a channel speaking | 
|  | // the Interface protocol, and can send events in that protocol. | 
|  | class Interface::EventSender { | 
|  | public: | 
|  | // Constructs an event sender with an invalid channel. | 
|  | EventSender() = default; | 
|  |  | 
|  | explicit EventSender( | 
|  | ::fidl::ServerEnd<::llcpp::fidl::test::doccomments::Interface> server_end) | 
|  | : server_end_(std::move(server_end)) {} | 
|  |  | 
|  | // The underlying server channel endpoint, which may be replaced at run-time. | 
|  | const ::fidl::ServerEnd<Interface>& server_end() const { return server_end_; } | 
|  | ::fidl::ServerEnd<Interface>& server_end() { return server_end_; } | 
|  |  | 
|  | const ::zx::channel& channel() const { return server_end_.channel(); } | 
|  | ::zx::channel& channel() { return server_end_.channel(); } | 
|  |  | 
|  | // Whether the underlying channel is valid. | 
|  | bool is_valid() const { return server_end_.is_valid(); } | 
|  |  | 
|  | // event comment #1 | 
|  | // | 
|  | // event comment #3 | 
|  | zx_status_t OnEvent() const; | 
|  |  | 
|  | private: | 
|  | ::fidl::ServerEnd<Interface> server_end_; | 
|  | }; | 
|  |  | 
|  | class Interface::WeakEventSender { | 
|  | public: | 
|  | // event comment #1 | 
|  | // | 
|  | // event comment #3 | 
|  | zx_status_t OnEvent() const { | 
|  | if (auto _binding = binding_.lock()) { | 
|  | return _binding->event_sender().OnEvent(); | 
|  | } | 
|  | return ZX_ERR_CANCELED; | 
|  | } | 
|  |  | 
|  | private: | 
|  | friend class ::fidl::ServerBindingRef<Interface>; | 
|  |  | 
|  | explicit WeakEventSender( | 
|  | std::weak_ptr<::fidl::internal::AsyncServerBinding<Interface>> binding) | 
|  | : binding_(std::move(binding)) {} | 
|  |  | 
|  | std::weak_ptr<::fidl::internal::AsyncServerBinding<Interface>> binding_; | 
|  | }; | 
|  | #endif | 
|  |  | 
|  | namespace wire {}  // namespace wire | 
|  |  | 
|  | }  // namespace doccomments | 
|  | }  // namespace test | 
|  | }  // namespace fidl | 
|  | }  // namespace llcpp |