| // 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/coding.h> |
| #include <lib/fidl/llcpp/envelope.h> |
| #include <lib/fidl/llcpp/errors.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/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/llcpp/wire_messaging.h> |
| #include <lib/fidl/txn_header.h> |
| #include <lib/zx/channel.h> |
| |
| #endif // __Fuchsia__ |
| #include <zircon/fidl.h> |
| |
| namespace fidl_test_protocolrequest { |
| class Parent; |
| |
| class Child; |
| |
| extern "C" const fidl_type_t |
| fidl_test_protocolrequest_ParentGetChildRequestTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_protocolrequest_ParentGetChildResponseTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_protocolrequest_ParentGetChildRequestRequestTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_protocolrequest_ParentGetChildRequestResponseTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_protocolrequest_ParentTakeChildRequestTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_protocolrequest_ParentTakeChildResponseTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_protocolrequest_ParentTakeChildRequestRequestTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_protocolrequest_ParentTakeChildRequestResponseTable; |
| |
| class Parent final { |
| Parent() = delete; |
| |
| public: |
| class GetChild final { |
| GetChild() = delete; |
| }; |
| class GetChildRequest final { |
| GetChildRequest() = delete; |
| }; |
| class TakeChild final { |
| TakeChild() = delete; |
| }; |
| class TakeChildRequest final { |
| TakeChildRequest() = delete; |
| }; |
| }; |
| } // namespace fidl_test_protocolrequest |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::ProtocolDetails<::fidl_test_protocolrequest::Parent> { |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::WireDispatcher<::fidl_test_protocolrequest::Parent> |
| final { |
| WireDispatcher() = delete; |
| static ::fidl::DispatchResult TryDispatch( |
| ::fidl::WireInterface<::fidl_test_protocolrequest::Parent>* impl, |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn); |
| static ::fidl::DispatchResult Dispatch( |
| ::fidl::WireInterface<::fidl_test_protocolrequest::Parent>* impl, |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn); |
| }; |
| |
| template <> |
| struct ::fidl::internal::WireServerDispatcher< |
| ::fidl_test_protocolrequest::Parent> |
| final { |
| WireServerDispatcher() = delete; |
| static ::fidl::DispatchResult TryDispatch( |
| ::fidl::WireServer<::fidl_test_protocolrequest::Parent>* impl, |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn); |
| static ::fidl::DispatchResult Dispatch( |
| ::fidl::WireServer<::fidl_test_protocolrequest::Parent>* impl, |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn); |
| }; |
| #endif // __Fuchsia__ |
| |
| template <> |
| struct ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChild> |
| final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| explicit WireRequest(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; |
| using ResponseType = |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>; |
| |
| class UnownedEncodedMessage final { |
| public: |
| UnownedEncodedMessage(uint8_t* _backing_buffer, |
| uint32_t _backing_buffer_size, zx_txid_t _txid) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireRequest)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| FIDL_ALIGNDECL WireRequest _request(_txid); |
| message_.Encode<WireRequest>(&_request); |
| } |
| UnownedEncodedMessage(uint8_t* _backing_buffer, |
| uint32_t _backing_buffer_size, WireRequest* request) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireRequest)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| message_.Encode<WireRequest>(request); |
| } |
| UnownedEncodedMessage(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage(UnownedEncodedMessage&&) = delete; |
| UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.status() == ZX_OK; } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::IovecBuffer iovecs_; |
| ::fidl::OutgoingMessage message_; |
| }; |
| |
| class OwnedEncodedMessage final { |
| public: |
| explicit OwnedEncodedMessage(zx_txid_t _txid) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), _txid) {} |
| explicit OwnedEncodedMessage(WireRequest* request) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), request) {} |
| OwnedEncodedMessage(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage(OwnedEncodedMessage&&) = delete; |
| OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.ok(); } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { |
| return message_.GetOutgoingMessage(); |
| } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::InlineMessageBuffer<16> backing_buffer_; |
| UnownedEncodedMessage message_; |
| }; |
| |
| public: |
| 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<WireRequest>(); |
| } |
| DecodedMessage(fidl_incoming_msg_t* msg) |
| : ::fidl::internal::IncomingMessage(msg) { |
| Decode<WireRequest>(); |
| } |
| DecodedMessage(const DecodedMessage&) = delete; |
| DecodedMessage(DecodedMessage&&) = delete; |
| DecodedMessage* operator=(const DecodedMessage&) = delete; |
| DecodedMessage* operator=(DecodedMessage&&) = delete; |
| |
| WireRequest* PrimaryObject() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<WireRequest*>(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); |
| }; |
| template <> |
| struct ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild> |
| final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child> c; |
| explicit WireResponse( |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) |
| : c(std::move(c)) { |
| _InitHeader(); |
| } |
| WireResponse() { _InitHeader(); } |
| |
| static constexpr const fidl_type_t* Type = |
| &::fidl_test_protocolrequest:: |
| fidl_test_protocolrequest_ParentGetChildResponseTable; |
| static constexpr uint32_t MaxNumHandles = 1; |
| static constexpr uint32_t PrimarySize = 24; |
| 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; |
| void _CloseHandles(); |
| |
| class UnownedEncodedMessage final { |
| public: |
| UnownedEncodedMessage( |
| uint8_t* _backing_buffer, uint32_t _backing_buffer_size, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .handles = handles_, |
| .handle_capacity = |
| std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| FIDL_ALIGNDECL WireResponse _response{std::move(c)}; |
| if (_backing_buffer_size < sizeof(WireResponse)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| message_.Encode< |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>>( |
| &_response); |
| } |
| UnownedEncodedMessage(uint8_t* _backing_buffer, |
| uint32_t _backing_buffer_size, WireResponse* response) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .handles = handles_, |
| .handle_capacity = |
| std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireResponse)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| message_.Encode< |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>>( |
| response); |
| } |
| UnownedEncodedMessage(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage(UnownedEncodedMessage&&) = delete; |
| UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.status() == ZX_OK; } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::IovecBuffer iovecs_; |
| zx_handle_disposition_t |
| handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)]; |
| ::fidl::OutgoingMessage message_; |
| }; |
| |
| class OwnedEncodedMessage final { |
| public: |
| explicit OwnedEncodedMessage( |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), |
| std::move(c)) {} |
| explicit OwnedEncodedMessage( |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| response) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), response) {} |
| OwnedEncodedMessage(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage(OwnedEncodedMessage&&) = delete; |
| OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.ok(); } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { |
| return message_.GetOutgoingMessage(); |
| } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::InlineMessageBuffer<24> backing_buffer_; |
| UnownedEncodedMessage message_; |
| }; |
| |
| public: |
| 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<::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChild>>(); |
| } |
| DecodedMessage(fidl_incoming_msg_t* msg) |
| : ::fidl::internal::IncomingMessage(msg) { |
| Decode<::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChild>>(); |
| } |
| DecodedMessage(const DecodedMessage&) = delete; |
| DecodedMessage(DecodedMessage&&) = delete; |
| DecodedMessage* operator=(const DecodedMessage&) = delete; |
| DecodedMessage* operator=(DecodedMessage&&) = delete; |
| ~DecodedMessage() { |
| if (ok() && (PrimaryObject() != nullptr)) { |
| PrimaryObject()->_CloseHandles(); |
| } |
| } |
| |
| WireResponse* PrimaryObject() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast< |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>*>( |
| 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(); |
| }; |
| template <> |
| struct ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChildRequest> |
| final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| explicit WireRequest(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; |
| using ResponseType = ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>; |
| |
| class UnownedEncodedMessage final { |
| public: |
| UnownedEncodedMessage(uint8_t* _backing_buffer, |
| uint32_t _backing_buffer_size, zx_txid_t _txid) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireRequest)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| FIDL_ALIGNDECL WireRequest _request(_txid); |
| message_.Encode<WireRequest>(&_request); |
| } |
| UnownedEncodedMessage(uint8_t* _backing_buffer, |
| uint32_t _backing_buffer_size, WireRequest* request) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireRequest)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| message_.Encode<WireRequest>(request); |
| } |
| UnownedEncodedMessage(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage(UnownedEncodedMessage&&) = delete; |
| UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.status() == ZX_OK; } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::IovecBuffer iovecs_; |
| ::fidl::OutgoingMessage message_; |
| }; |
| |
| class OwnedEncodedMessage final { |
| public: |
| explicit OwnedEncodedMessage(zx_txid_t _txid) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), _txid) {} |
| explicit OwnedEncodedMessage(WireRequest* request) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), request) {} |
| OwnedEncodedMessage(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage(OwnedEncodedMessage&&) = delete; |
| OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.ok(); } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { |
| return message_.GetOutgoingMessage(); |
| } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::InlineMessageBuffer<16> backing_buffer_; |
| UnownedEncodedMessage message_; |
| }; |
| |
| public: |
| 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<WireRequest>(); |
| } |
| DecodedMessage(fidl_incoming_msg_t* msg) |
| : ::fidl::internal::IncomingMessage(msg) { |
| Decode<WireRequest>(); |
| } |
| DecodedMessage(const DecodedMessage&) = delete; |
| DecodedMessage(DecodedMessage&&) = delete; |
| DecodedMessage* operator=(const DecodedMessage&) = delete; |
| DecodedMessage* operator=(DecodedMessage&&) = delete; |
| |
| WireRequest* PrimaryObject() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<WireRequest*>(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); |
| }; |
| template <> |
| struct ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest> |
| final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child> r; |
| explicit WireResponse( |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) |
| : r(std::move(r)) { |
| _InitHeader(); |
| } |
| WireResponse() { _InitHeader(); } |
| |
| static constexpr const fidl_type_t* Type = |
| &::fidl_test_protocolrequest:: |
| fidl_test_protocolrequest_ParentGetChildRequestResponseTable; |
| static constexpr uint32_t MaxNumHandles = 1; |
| static constexpr uint32_t PrimarySize = 24; |
| 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; |
| void _CloseHandles(); |
| |
| class UnownedEncodedMessage final { |
| public: |
| UnownedEncodedMessage( |
| uint8_t* _backing_buffer, uint32_t _backing_buffer_size, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .handles = handles_, |
| .handle_capacity = |
| std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| FIDL_ALIGNDECL WireResponse _response{std::move(r)}; |
| if (_backing_buffer_size < sizeof(WireResponse)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| message_.Encode<::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>>(&_response); |
| } |
| UnownedEncodedMessage(uint8_t* _backing_buffer, |
| uint32_t _backing_buffer_size, WireResponse* response) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .handles = handles_, |
| .handle_capacity = |
| std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireResponse)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| message_.Encode<::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>>(response); |
| } |
| UnownedEncodedMessage(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage(UnownedEncodedMessage&&) = delete; |
| UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.status() == ZX_OK; } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::IovecBuffer iovecs_; |
| zx_handle_disposition_t |
| handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)]; |
| ::fidl::OutgoingMessage message_; |
| }; |
| |
| class OwnedEncodedMessage final { |
| public: |
| explicit OwnedEncodedMessage( |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), |
| std::move(r)) {} |
| explicit OwnedEncodedMessage( |
| ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>* response) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), response) {} |
| OwnedEncodedMessage(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage(OwnedEncodedMessage&&) = delete; |
| OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.ok(); } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { |
| return message_.GetOutgoingMessage(); |
| } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::InlineMessageBuffer<24> backing_buffer_; |
| UnownedEncodedMessage message_; |
| }; |
| |
| public: |
| 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<::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>>(); |
| } |
| DecodedMessage(fidl_incoming_msg_t* msg) |
| : ::fidl::internal::IncomingMessage(msg) { |
| Decode<::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>>(); |
| } |
| DecodedMessage(const DecodedMessage&) = delete; |
| DecodedMessage(DecodedMessage&&) = delete; |
| DecodedMessage* operator=(const DecodedMessage&) = delete; |
| DecodedMessage* operator=(DecodedMessage&&) = delete; |
| ~DecodedMessage() { |
| if (ok() && (PrimaryObject() != nullptr)) { |
| PrimaryObject()->_CloseHandles(); |
| } |
| } |
| |
| WireResponse* PrimaryObject() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>*>(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(); |
| }; |
| template <> |
| struct ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChild> |
| final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child> c; |
| explicit WireRequest( |
| zx_txid_t _txid, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) |
| : c(std::move(c)) { |
| _InitHeader(_txid); |
| } |
| explicit WireRequest(zx_txid_t _txid) { _InitHeader(_txid); } |
| |
| static constexpr const fidl_type_t* Type = |
| &::fidl_test_protocolrequest:: |
| fidl_test_protocolrequest_ParentTakeChildRequestTable; |
| static constexpr uint32_t MaxNumHandles = 1; |
| static constexpr uint32_t PrimarySize = 24; |
| static constexpr uint32_t MaxOutOfLine = 0; |
| static constexpr uint32_t AltPrimarySize = 24; |
| 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; |
| void _CloseHandles(); |
| |
| class UnownedEncodedMessage final { |
| public: |
| UnownedEncodedMessage( |
| uint8_t* _backing_buffer, uint32_t _backing_buffer_size, |
| zx_txid_t _txid, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .handles = handles_, |
| .handle_capacity = |
| std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireRequest)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| FIDL_ALIGNDECL WireRequest _request(_txid, std::move(c)); |
| message_.Encode<WireRequest>(&_request); |
| } |
| UnownedEncodedMessage(uint8_t* _backing_buffer, |
| uint32_t _backing_buffer_size, WireRequest* request) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .handles = handles_, |
| .handle_capacity = |
| std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireRequest)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| message_.Encode<WireRequest>(request); |
| } |
| UnownedEncodedMessage(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage(UnownedEncodedMessage&&) = delete; |
| UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.status() == ZX_OK; } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::IovecBuffer iovecs_; |
| zx_handle_disposition_t |
| handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)]; |
| ::fidl::OutgoingMessage message_; |
| }; |
| |
| class OwnedEncodedMessage final { |
| public: |
| explicit OwnedEncodedMessage( |
| zx_txid_t _txid, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), _txid, |
| std::move(c)) {} |
| explicit OwnedEncodedMessage(WireRequest* request) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), request) {} |
| OwnedEncodedMessage(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage(OwnedEncodedMessage&&) = delete; |
| OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.ok(); } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { |
| return message_.GetOutgoingMessage(); |
| } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::InlineMessageBuffer<24> backing_buffer_; |
| UnownedEncodedMessage message_; |
| }; |
| |
| public: |
| 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<WireRequest>(); |
| } |
| DecodedMessage(fidl_incoming_msg_t* msg) |
| : ::fidl::internal::IncomingMessage(msg) { |
| Decode<WireRequest>(); |
| } |
| DecodedMessage(const DecodedMessage&) = delete; |
| DecodedMessage(DecodedMessage&&) = delete; |
| DecodedMessage* operator=(const DecodedMessage&) = delete; |
| DecodedMessage* operator=(DecodedMessage&&) = delete; |
| ~DecodedMessage() { |
| if (ok() && (PrimaryObject() != nullptr)) { |
| PrimaryObject()->_CloseHandles(); |
| } |
| } |
| |
| WireRequest* PrimaryObject() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<WireRequest*>(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); |
| }; |
| template <> |
| struct ::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest> |
| final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child> r; |
| explicit WireRequest( |
| zx_txid_t _txid, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) |
| : r(std::move(r)) { |
| _InitHeader(_txid); |
| } |
| explicit WireRequest(zx_txid_t _txid) { _InitHeader(_txid); } |
| |
| static constexpr const fidl_type_t* Type = |
| &::fidl_test_protocolrequest:: |
| fidl_test_protocolrequest_ParentTakeChildRequestRequestTable; |
| static constexpr uint32_t MaxNumHandles = 1; |
| static constexpr uint32_t PrimarySize = 24; |
| static constexpr uint32_t MaxOutOfLine = 0; |
| static constexpr uint32_t AltPrimarySize = 24; |
| 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; |
| void _CloseHandles(); |
| |
| class UnownedEncodedMessage final { |
| public: |
| UnownedEncodedMessage( |
| uint8_t* _backing_buffer, uint32_t _backing_buffer_size, |
| zx_txid_t _txid, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .handles = handles_, |
| .handle_capacity = |
| std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireRequest)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| FIDL_ALIGNDECL WireRequest _request(_txid, std::move(r)); |
| message_.Encode<WireRequest>(&_request); |
| } |
| UnownedEncodedMessage(uint8_t* _backing_buffer, |
| uint32_t _backing_buffer_size, WireRequest* request) |
| : message_(::fidl::OutgoingMessage::ConstructorArgs{ |
| .iovecs = iovecs_, |
| .iovec_capacity = ::fidl::internal::IovecBufferSize, |
| .handles = handles_, |
| .handle_capacity = |
| std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), |
| .backing_buffer = _backing_buffer, |
| .backing_buffer_capacity = _backing_buffer_size, |
| }) { |
| if (_backing_buffer_size < sizeof(WireRequest)) { |
| ::fidl::internal::OutgoingMessageResultSetter::SetResult( |
| message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr); |
| return; |
| } |
| message_.Encode<WireRequest>(request); |
| } |
| UnownedEncodedMessage(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage(UnownedEncodedMessage&&) = delete; |
| UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete; |
| UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.status() == ZX_OK; } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::IovecBuffer iovecs_; |
| zx_handle_disposition_t |
| handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)]; |
| ::fidl::OutgoingMessage message_; |
| }; |
| |
| class OwnedEncodedMessage final { |
| public: |
| explicit OwnedEncodedMessage( |
| zx_txid_t _txid, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), _txid, |
| std::move(r)) {} |
| explicit OwnedEncodedMessage(WireRequest* request) |
| : message_(backing_buffer_.data(), backing_buffer_.size(), request) {} |
| OwnedEncodedMessage(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage(OwnedEncodedMessage&&) = delete; |
| OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete; |
| OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete; |
| |
| zx_status_t status() const { return message_.status(); } |
| #ifdef __Fuchsia__ |
| const char* status_string() const { return message_.status_string(); } |
| #endif // __Fuchsia__ |
| bool ok() const { return message_.ok(); } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::OutgoingMessage& GetOutgoingMessage() { |
| return message_.GetOutgoingMessage(); |
| } |
| #ifdef __Fuchsia__ |
| template <typename ChannelLike> |
| void Write(ChannelLike&& client) { |
| message_.Write(std::forward<ChannelLike>(client)); |
| } |
| #endif // __Fuchsia__ |
| private: |
| ::fidl::internal::InlineMessageBuffer<24> backing_buffer_; |
| UnownedEncodedMessage message_; |
| }; |
| |
| public: |
| 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<WireRequest>(); |
| } |
| DecodedMessage(fidl_incoming_msg_t* msg) |
| : ::fidl::internal::IncomingMessage(msg) { |
| Decode<WireRequest>(); |
| } |
| DecodedMessage(const DecodedMessage&) = delete; |
| DecodedMessage(DecodedMessage&&) = delete; |
| DecodedMessage* operator=(const DecodedMessage&) = delete; |
| DecodedMessage* operator=(DecodedMessage&&) = delete; |
| ~DecodedMessage() { |
| if (ok() && (PrimaryObject() != nullptr)) { |
| PrimaryObject()->_CloseHandles(); |
| } |
| } |
| |
| WireRequest* PrimaryObject() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<WireRequest*>(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); |
| }; |
| template <> |
| class ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChild> final |
| : public ::fidl::Result { |
| public: |
| explicit WireResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client); |
| WireResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client, |
| zx_time_t _deadline); |
| explicit WireResult(const ::fidl::Result& result) : ::fidl::Result(result) {} |
| WireResult(WireResult&&) = delete; |
| WireResult(const WireResult&) = delete; |
| WireResult* operator=(WireResult&&) = delete; |
| WireResult* operator=(const WireResult&) = delete; |
| ~WireResult() { |
| if (ok()) { |
| Unwrap()->_CloseHandles(); |
| } |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| Unwrap() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast< |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>*>( |
| bytes_.data()); |
| } |
| const ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| Unwrap() const { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChild>*>(bytes_.data()); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>& value() { |
| return *Unwrap(); |
| } |
| const ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>& |
| value() const { |
| return *Unwrap(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| operator->() { |
| return &value(); |
| } |
| const ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| operator->() const { |
| return &value(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>& |
| operator*() { |
| return value(); |
| } |
| const ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>& |
| operator*() const { |
| return value(); |
| } |
| |
| private: |
| ::fidl::internal::InlineMessageBuffer<24> bytes_; |
| }; |
| template <> |
| class ::fidl::WireUnownedResult<::fidl_test_protocolrequest::Parent::GetChild> |
| final : public ::fidl::Result { |
| public: |
| explicit WireUnownedResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client, |
| uint8_t* _response_bytes, uint32_t _response_byte_capacity); |
| explicit WireUnownedResult(const ::fidl::Result& result) |
| : ::fidl::Result(result) {} |
| WireUnownedResult(WireUnownedResult&&) = delete; |
| WireUnownedResult(const WireUnownedResult&) = delete; |
| WireUnownedResult* operator=(WireUnownedResult&&) = delete; |
| WireUnownedResult* operator=(const WireUnownedResult&) = delete; |
| ~WireUnownedResult() { |
| if (ok()) { |
| Unwrap()->_CloseHandles(); |
| } |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| Unwrap() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast< |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>*>( |
| bytes_); |
| } |
| const ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| Unwrap() const { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChild>*>(bytes_); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>& value() { |
| return *Unwrap(); |
| } |
| const ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>& |
| value() const { |
| return *Unwrap(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| operator->() { |
| return &value(); |
| } |
| const ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| operator->() const { |
| return &value(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>& |
| operator*() { |
| return value(); |
| } |
| const ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>& |
| operator*() const { |
| return value(); |
| } |
| |
| private: |
| uint8_t* bytes_; |
| }; |
| template <> |
| class ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChildRequest> |
| final : public ::fidl::Result { |
| public: |
| explicit WireResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client); |
| WireResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client, |
| zx_time_t _deadline); |
| explicit WireResult(const ::fidl::Result& result) : ::fidl::Result(result) {} |
| WireResult(WireResult&&) = delete; |
| WireResult(const WireResult&) = delete; |
| WireResult* operator=(WireResult&&) = delete; |
| WireResult* operator=(const WireResult&) = delete; |
| ~WireResult() { |
| if (ok()) { |
| Unwrap()->_CloseHandles(); |
| } |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| Unwrap() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>*>(bytes_.data()); |
| } |
| const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| Unwrap() const { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>*>(bytes_.data()); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>& |
| value() { |
| return *Unwrap(); |
| } |
| const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>& |
| value() const { |
| return *Unwrap(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| operator->() { |
| return &value(); |
| } |
| const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| operator->() const { |
| return &value(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>& |
| operator*() { |
| return value(); |
| } |
| const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>& |
| operator*() const { |
| return value(); |
| } |
| |
| private: |
| ::fidl::internal::InlineMessageBuffer<24> bytes_; |
| }; |
| template <> |
| class ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest> |
| final : public ::fidl::Result { |
| public: |
| explicit WireUnownedResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client, |
| uint8_t* _response_bytes, uint32_t _response_byte_capacity); |
| explicit WireUnownedResult(const ::fidl::Result& result) |
| : ::fidl::Result(result) {} |
| WireUnownedResult(WireUnownedResult&&) = delete; |
| WireUnownedResult(const WireUnownedResult&) = delete; |
| WireUnownedResult* operator=(WireUnownedResult&&) = delete; |
| WireUnownedResult* operator=(const WireUnownedResult&) = delete; |
| ~WireUnownedResult() { |
| if (ok()) { |
| Unwrap()->_CloseHandles(); |
| } |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| Unwrap() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>*>(bytes_); |
| } |
| const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| Unwrap() const { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>*>(bytes_); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>& |
| value() { |
| return *Unwrap(); |
| } |
| const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>& |
| value() const { |
| return *Unwrap(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| operator->() { |
| return &value(); |
| } |
| const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| operator->() const { |
| return &value(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>& |
| operator*() { |
| return value(); |
| } |
| const ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>& |
| operator*() const { |
| return value(); |
| } |
| |
| private: |
| uint8_t* bytes_; |
| }; |
| template <> |
| class ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChild> final |
| : public ::fidl::Result { |
| public: |
| explicit WireResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c); |
| explicit WireResult(const ::fidl::Result& result) : ::fidl::Result(result) {} |
| WireResult(WireResult&&) = delete; |
| WireResult(const WireResult&) = delete; |
| WireResult* operator=(WireResult&&) = delete; |
| WireResult* operator=(const WireResult&) = delete; |
| ~WireResult() = default; |
| |
| private: |
| }; |
| template <> |
| class ::fidl::WireUnownedResult<::fidl_test_protocolrequest::Parent::TakeChild> |
| final : public ::fidl::Result { |
| public: |
| explicit WireUnownedResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client, |
| uint8_t* _request_bytes, uint32_t _request_byte_capacity, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c); |
| explicit WireUnownedResult(const ::fidl::Result& result) |
| : ::fidl::Result(result) {} |
| WireUnownedResult(WireUnownedResult&&) = delete; |
| WireUnownedResult(const WireUnownedResult&) = delete; |
| WireUnownedResult* operator=(WireUnownedResult&&) = delete; |
| WireUnownedResult* operator=(const WireUnownedResult&) = delete; |
| ~WireUnownedResult() = default; |
| }; |
| template <> |
| class ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChildRequest> |
| final : public ::fidl::Result { |
| public: |
| explicit WireResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r); |
| explicit WireResult(const ::fidl::Result& result) : ::fidl::Result(result) {} |
| WireResult(WireResult&&) = delete; |
| WireResult(const WireResult&) = delete; |
| WireResult* operator=(WireResult&&) = delete; |
| WireResult* operator=(const WireResult&) = delete; |
| ~WireResult() = default; |
| |
| private: |
| }; |
| template <> |
| class ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest> |
| final : public ::fidl::Result { |
| public: |
| explicit WireUnownedResult( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client, |
| uint8_t* _request_bytes, uint32_t _request_byte_capacity, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r); |
| explicit WireUnownedResult(const ::fidl::Result& result) |
| : ::fidl::Result(result) {} |
| WireUnownedResult(WireUnownedResult&&) = delete; |
| WireUnownedResult(const WireUnownedResult&) = delete; |
| WireUnownedResult* operator=(WireUnownedResult&&) = delete; |
| WireUnownedResult* operator=(const WireUnownedResult&) = delete; |
| ~WireUnownedResult() = default; |
| }; |
| |
| // Methods to make a sync FIDL call directly on an unowned channel or a |
| // const reference to a |fidl::ClientEnd<::fidl_test_protocolrequest::Parent>|, |
| // avoiding setting up a client. |
| template <> |
| class ::fidl::internal::WireCaller<::fidl_test_protocolrequest::Parent> final { |
| public: |
| explicit WireCaller( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> client_end) |
| : client_end_(client_end) {} |
| |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| static ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChild> |
| GetChild(::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> |
| _client_end) { |
| return ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChild>( |
| _client_end); |
| } |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChild> |
| GetChild() && { |
| return ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChild>( |
| client_end_); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| static ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChild> |
| GetChild( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client_end, |
| ::fidl::BufferSpan _response_buffer) { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChild>( |
| _client_end, _response_buffer.data, _response_buffer.capacity); |
| } |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult<::fidl_test_protocolrequest::Parent::GetChild> |
| GetChild(::fidl::BufferSpan _response_buffer) && { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChild>( |
| client_end_, _response_buffer.data, _response_buffer.capacity); |
| } |
| |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| static ::fidl::WireResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest> |
| GetChildRequest(::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> |
| _client_end) { |
| return ::fidl::WireResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>(_client_end); |
| } |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChildRequest> |
| GetChildRequest() && { |
| return ::fidl::WireResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>(client_end_); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| static ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest> |
| GetChildRequest( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client_end, |
| ::fidl::BufferSpan _response_buffer) { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>( |
| _client_end, _response_buffer.data, _response_buffer.capacity); |
| } |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest> |
| GetChildRequest(::fidl::BufferSpan _response_buffer) && { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>( |
| client_end_, _response_buffer.data, _response_buffer.capacity); |
| } |
| |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| static ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChild> |
| TakeChild( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client_end, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) { |
| return ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChild>( |
| _client_end, std::move(c)); |
| } |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChild> TakeChild( |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) && { |
| return ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChild>( |
| client_end_, std::move(c)); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| static ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChild> |
| TakeChild( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client_end, |
| ::fidl::BufferSpan _request_buffer, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChild>( |
| _client_end, _request_buffer.data, _request_buffer.capacity, |
| std::move(c)); |
| } |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult<::fidl_test_protocolrequest::Parent::TakeChild> |
| TakeChild(::fidl::BufferSpan _request_buffer, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) && { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChild>( |
| client_end_, _request_buffer.data, _request_buffer.capacity, |
| std::move(c)); |
| } |
| |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| static ::fidl::WireResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest> |
| TakeChildRequest( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client_end, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) { |
| return ::fidl::WireResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>(_client_end, |
| std::move(r)); |
| } |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChildRequest> |
| TakeChildRequest( |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) && { |
| return ::fidl::WireResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>(client_end_, |
| std::move(r)); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| static ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest> |
| TakeChildRequest( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> _client_end, |
| ::fidl::BufferSpan _request_buffer, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>( |
| _client_end, _request_buffer.data, _request_buffer.capacity, |
| std::move(r)); |
| } |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest> |
| TakeChildRequest( |
| ::fidl::BufferSpan _request_buffer, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) && { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>( |
| client_end_, _request_buffer.data, _request_buffer.capacity, |
| std::move(r)); |
| } |
| |
| private: |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Parent> client_end_; |
| }; |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::WireEventHandlerInterface< |
| ::fidl_test_protocolrequest::Parent> { |
| public: |
| WireEventHandlerInterface() = default; |
| virtual ~WireEventHandlerInterface() = default; |
| }; |
| |
| template <> |
| class ::fidl::WireAsyncEventHandler<::fidl_test_protocolrequest::Parent> |
| : public ::fidl::internal::WireEventHandlerInterface< |
| ::fidl_test_protocolrequest::Parent> { |
| public: |
| WireAsyncEventHandler() = default; |
| |
| virtual void Unbound(::fidl::UnbindInfo info) {} |
| }; |
| |
| template <> |
| class ::fidl::WireSyncEventHandler<::fidl_test_protocolrequest::Parent> |
| : public ::fidl::internal::WireEventHandlerInterface< |
| ::fidl_test_protocolrequest::Parent> { |
| public: |
| WireSyncEventHandler() = 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<::fidl_test_protocolrequest::Parent> client_end); |
| }; |
| #endif // __Fuchsia__ |
| |
| template <> |
| class ::fidl::WireSyncClient<::fidl_test_protocolrequest::Parent> final { |
| public: |
| WireSyncClient() = default; |
| |
| explicit WireSyncClient( |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Parent> client_end) |
| : client_end_(std::move(client_end)) {} |
| |
| ~WireSyncClient() = default; |
| WireSyncClient(WireSyncClient&&) = default; |
| WireSyncClient& operator=(WireSyncClient&&) = default; |
| |
| const ::fidl::ClientEnd<::fidl_test_protocolrequest::Parent>& client_end() |
| const { |
| return client_end_; |
| } |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Parent>& client_end() { |
| return client_end_; |
| } |
| |
| const ::zx::channel& channel() const { return client_end_.channel(); } |
| ::zx::channel* mutable_channel() { return &client_end_.channel(); } |
| |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChild> GetChild() { |
| return ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChild>( |
| this->client_end()); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult<::fidl_test_protocolrequest::Parent::GetChild> |
| GetChild(::fidl::BufferSpan _response_buffer) { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChild>( |
| this->client_end(), _response_buffer.data, _response_buffer.capacity); |
| } |
| |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChildRequest> |
| GetChildRequest() { |
| return ::fidl::WireResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>( |
| this->client_end()); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest> |
| GetChildRequest(::fidl::BufferSpan _response_buffer) { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>( |
| this->client_end(), _response_buffer.data, _response_buffer.capacity); |
| } |
| |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChild> TakeChild( |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) { |
| return ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChild>( |
| this->client_end(), std::move(c)); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult<::fidl_test_protocolrequest::Parent::TakeChild> |
| TakeChild(::fidl::BufferSpan _request_buffer, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c) { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChild>( |
| this->client_end(), _request_buffer.data, _request_buffer.capacity, |
| std::move(c)); |
| } |
| |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::TakeChildRequest> |
| TakeChildRequest(::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) { |
| return ::fidl::WireResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>( |
| this->client_end(), std::move(r)); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest> |
| TakeChildRequest(::fidl::BufferSpan _request_buffer, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r) { |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>( |
| this->client_end(), _request_buffer.data, _request_buffer.capacity, |
| std::move(r)); |
| } |
| |
| private: |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Parent> client_end_; |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| // This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>| |
| // and |fidl::ServerEnd<SomeProtocol>|). |
| template <> |
| class ::fidl::WireServer<::fidl_test_protocolrequest::Parent> |
| : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| WireServer() = default; |
| virtual ~WireServer() = default; |
| |
| // The FIDL protocol type that is implemented by this server. |
| using _EnclosingProtocol = ::fidl_test_protocolrequest::Parent; |
| |
| class GetChildCompleterBase : public ::fidl::CompleterBase { |
| public: |
| // In the following methods, the return value indicates internal errors |
| // during the reply, such as encoding or writing to the transport. Note that |
| // any error will automatically lead to the destruction of the binding, |
| // after which the |on_unbound| callback will be triggered with a detailed |
| // reason. |
| // |
| // See //zircon/system/ulib/fidl/include/lib/fidl/llcpp/server.h. |
| // |
| // Because the reply status is identical to the unbinding status, it can be |
| // safely ignored. |
| ::fidl::Result Reply( |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c); |
| ::fidl::Result Reply( |
| ::fidl::BufferSpan _backing_buffer, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| using GetChildCompleter = ::fidl::Completer<GetChildCompleterBase>; |
| class GetChildRequestView { |
| public: |
| GetChildRequestView( |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChild>* |
| request) |
| : request_(request) {} |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChild>* |
| operator->() const { |
| return request_; |
| } |
| |
| private: |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChild>* |
| request_; |
| }; |
| |
| virtual void GetChild(GetChildRequestView request, |
| GetChildCompleter::Sync& _completer) = 0; |
| |
| class GetChildRequestCompleterBase : public ::fidl::CompleterBase { |
| public: |
| // In the following methods, the return value indicates internal errors |
| // during the reply, such as encoding or writing to the transport. Note that |
| // any error will automatically lead to the destruction of the binding, |
| // after which the |on_unbound| callback will be triggered with a detailed |
| // reason. |
| // |
| // See //zircon/system/ulib/fidl/include/lib/fidl/llcpp/server.h. |
| // |
| // Because the reply status is identical to the unbinding status, it can be |
| // safely ignored. |
| ::fidl::Result Reply( |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r); |
| ::fidl::Result Reply( |
| ::fidl::BufferSpan _backing_buffer, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| using GetChildRequestCompleter = |
| ::fidl::Completer<GetChildRequestCompleterBase>; |
| class GetChildRequestRequestView { |
| public: |
| GetChildRequestRequestView( |
| ::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>* request) |
| : request_(request) {} |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| operator->() const { |
| return request_; |
| } |
| |
| private: |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChildRequest>* |
| request_; |
| }; |
| |
| virtual void GetChildRequest(GetChildRequestRequestView request, |
| GetChildRequestCompleter::Sync& _completer) = 0; |
| |
| using TakeChildCompleter = ::fidl::Completer<>; |
| class TakeChildRequestView { |
| public: |
| TakeChildRequestView( |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChild>* |
| request) |
| : request_(request) {} |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChild>* |
| operator->() const { |
| return request_; |
| } |
| |
| private: |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChild>* |
| request_; |
| }; |
| |
| virtual void TakeChild(TakeChildRequestView request, |
| TakeChildCompleter::Sync& _completer) = 0; |
| |
| using TakeChildRequestCompleter = ::fidl::Completer<>; |
| class TakeChildRequestRequestView { |
| public: |
| TakeChildRequestRequestView( |
| ::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>* request) |
| : request_(request) {} |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChildRequest>* |
| operator->() const { |
| return request_; |
| } |
| |
| private: |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChildRequest>* |
| request_; |
| }; |
| |
| virtual void TakeChildRequest( |
| TakeChildRequestRequestView request, |
| TakeChildRequestCompleter::Sync& _completer) = 0; |
| |
| private: |
| ::fidl::DispatchResult dispatch_message(fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) final; |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| // This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>| |
| // and |fidl::ServerEnd<SomeProtocol>|). |
| template <> |
| class ::fidl::WireInterface<::fidl_test_protocolrequest::Parent> |
| : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| WireInterface() = default; |
| virtual ~WireInterface() = default; |
| |
| // The marker protocol type within which this |WireInterface| class is |
| // defined. |
| using _EnclosingProtocol = ::fidl_test_protocolrequest::Parent; |
| |
| using GetChildCompleterBase = ::fidl::WireServer< |
| ::fidl_test_protocolrequest::Parent>::GetChildCompleterBase; |
| |
| using GetChildCompleter = ::fidl::WireServer< |
| ::fidl_test_protocolrequest::Parent>::GetChildCompleter; |
| virtual void GetChild(GetChildCompleter::Sync& _completer) = 0; |
| |
| using GetChildRequestCompleterBase = ::fidl::WireServer< |
| ::fidl_test_protocolrequest::Parent>::GetChildRequestCompleterBase; |
| |
| using GetChildRequestCompleter = ::fidl::WireServer< |
| ::fidl_test_protocolrequest::Parent>::GetChildRequestCompleter; |
| virtual void GetChildRequest(GetChildRequestCompleter::Sync& _completer) = 0; |
| |
| using TakeChildCompleter = ::fidl::WireServer< |
| ::fidl_test_protocolrequest::Parent>::TakeChildCompleter; |
| virtual void TakeChild( |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child> c, |
| TakeChildCompleter::Sync& _completer) = 0; |
| |
| using TakeChildRequestCompleter = ::fidl::WireServer< |
| ::fidl_test_protocolrequest::Parent>::TakeChildRequestCompleter; |
| virtual void TakeChildRequest( |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child> r, |
| TakeChildRequestCompleter::Sync& _completer) = 0; |
| |
| private: |
| ::fidl::DispatchResult dispatch_message(fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) final; |
| }; |
| |
| namespace fidl_test_protocolrequest { |
| class Child final { |
| Child() = delete; |
| |
| public: |
| }; |
| } // namespace fidl_test_protocolrequest |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::ProtocolDetails<::fidl_test_protocolrequest::Child> {}; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::WireDispatcher<::fidl_test_protocolrequest::Child> |
| final { |
| WireDispatcher() = delete; |
| static ::fidl::DispatchResult TryDispatch( |
| ::fidl::WireInterface<::fidl_test_protocolrequest::Child>* impl, |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn); |
| static ::fidl::DispatchResult Dispatch( |
| ::fidl::WireInterface<::fidl_test_protocolrequest::Child>* impl, |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn); |
| }; |
| |
| template <> |
| struct ::fidl::internal::WireServerDispatcher< |
| ::fidl_test_protocolrequest::Child> |
| final { |
| WireServerDispatcher() = delete; |
| static ::fidl::DispatchResult TryDispatch( |
| ::fidl::WireServer<::fidl_test_protocolrequest::Child>* impl, |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn); |
| static ::fidl::DispatchResult Dispatch( |
| ::fidl::WireServer<::fidl_test_protocolrequest::Child>* impl, |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn); |
| }; |
| #endif // __Fuchsia__ |
| |
| // Methods to make a sync FIDL call directly on an unowned channel or a |
| // const reference to a |fidl::ClientEnd<::fidl_test_protocolrequest::Child>|, |
| // avoiding setting up a client. |
| template <> |
| class ::fidl::internal::WireCaller<::fidl_test_protocolrequest::Child> final { |
| public: |
| explicit WireCaller( |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Child> client_end) |
| : client_end_(client_end) {} |
| |
| private: |
| ::fidl::UnownedClientEnd<::fidl_test_protocolrequest::Child> client_end_; |
| }; |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::WireEventHandlerInterface< |
| ::fidl_test_protocolrequest::Child> { |
| public: |
| WireEventHandlerInterface() = default; |
| virtual ~WireEventHandlerInterface() = default; |
| }; |
| |
| template <> |
| class ::fidl::WireAsyncEventHandler<::fidl_test_protocolrequest::Child> |
| : public ::fidl::internal::WireEventHandlerInterface< |
| ::fidl_test_protocolrequest::Child> { |
| public: |
| WireAsyncEventHandler() = default; |
| |
| virtual void Unbound(::fidl::UnbindInfo info) {} |
| }; |
| |
| template <> |
| class ::fidl::WireSyncEventHandler<::fidl_test_protocolrequest::Child> |
| : public ::fidl::internal::WireEventHandlerInterface< |
| ::fidl_test_protocolrequest::Child> { |
| public: |
| WireSyncEventHandler() = 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<::fidl_test_protocolrequest::Child> client_end); |
| }; |
| #endif // __Fuchsia__ |
| |
| template <> |
| class ::fidl::WireSyncClient<::fidl_test_protocolrequest::Child> final { |
| public: |
| WireSyncClient() = default; |
| |
| explicit WireSyncClient( |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child> client_end) |
| : client_end_(std::move(client_end)) {} |
| |
| ~WireSyncClient() = default; |
| WireSyncClient(WireSyncClient&&) = default; |
| WireSyncClient& operator=(WireSyncClient&&) = default; |
| |
| const ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>& client_end() |
| const { |
| return client_end_; |
| } |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>& client_end() { |
| return client_end_; |
| } |
| |
| const ::zx::channel& channel() const { return client_end_.channel(); } |
| ::zx::channel* mutable_channel() { return &client_end_.channel(); } |
| |
| private: |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child> client_end_; |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| // This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>| |
| // and |fidl::ServerEnd<SomeProtocol>|). |
| template <> |
| class ::fidl::WireServer<::fidl_test_protocolrequest::Child> |
| : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| WireServer() = default; |
| virtual ~WireServer() = default; |
| |
| // The FIDL protocol type that is implemented by this server. |
| using _EnclosingProtocol = ::fidl_test_protocolrequest::Child; |
| |
| private: |
| ::fidl::DispatchResult dispatch_message(fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) final; |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| // This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>| |
| // and |fidl::ServerEnd<SomeProtocol>|). |
| template <> |
| class ::fidl::WireInterface<::fidl_test_protocolrequest::Child> |
| : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| WireInterface() = default; |
| virtual ~WireInterface() = default; |
| |
| // The marker protocol type within which this |WireInterface| class is |
| // defined. |
| using _EnclosingProtocol = ::fidl_test_protocolrequest::Child; |
| |
| private: |
| ::fidl::DispatchResult dispatch_message(fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) final; |
| }; |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType< |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChild>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChild>> |
| : public std::true_type {}; |
| static_assert( |
| sizeof( |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChild>) == |
| ::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::GetChild>::PrimarySize); |
| |
| template <> |
| struct IsFidlType< |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>> |
| : public std::true_type {}; |
| static_assert( |
| sizeof( |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>) == |
| ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChild>::PrimarySize); |
| static_assert( |
| offsetof( |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>, |
| c) == 16); |
| |
| template <> |
| struct IsFidlType< |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChildRequest>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::GetChildRequest>> |
| : public std::true_type {}; |
| static_assert( |
| sizeof(::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>) == |
| ::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>::PrimarySize); |
| |
| template <> |
| struct IsFidlType< |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChildRequest>> |
| : public std::true_type {}; |
| static_assert( |
| sizeof(::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>) == |
| ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>::PrimarySize); |
| static_assert( |
| offsetof(::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>, |
| r) == 16); |
| |
| template <> |
| struct IsFidlType< |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChild>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChild>> |
| : public std::true_type {}; |
| static_assert( |
| sizeof( |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChild>) == |
| ::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::TakeChild>::PrimarySize); |
| static_assert( |
| offsetof( |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChild>, |
| c) == 16); |
| |
| template <> |
| struct IsFidlType< |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChildRequest>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::fidl::WireRequest<::fidl_test_protocolrequest::Parent::TakeChildRequest>> |
| : public std::true_type {}; |
| static_assert( |
| sizeof(::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>) == |
| ::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>::PrimarySize); |
| static_assert( |
| offsetof(::fidl::WireRequest< |
| ::fidl_test_protocolrequest::Parent::TakeChildRequest>, |
| r) == 16); |
| } // namespace fidl |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::WireResponseContext<::fidl_test_protocolrequest::Parent::GetChild> |
| : public ::fidl::internal::ResponseContext { |
| public: |
| WireResponseContext(); |
| |
| virtual void OnReply( |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| message) = 0; |
| |
| private: |
| void OnReply(uint8_t* reply) override; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::WireResponseContext< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest> |
| : public ::fidl::internal::ResponseContext { |
| public: |
| WireResponseContext(); |
| |
| virtual void OnReply( |
| ::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>* message) = 0; |
| |
| private: |
| void OnReply(uint8_t* reply) override; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::WireClientImpl<::fidl_test_protocolrequest::Parent> |
| final : private ::fidl::internal::ClientBase { |
| public: |
| // Asynchronous variant of |Parent.GetChild()|. |
| // Allocates 16 bytes of request buffer on the stack. The callback is stored |
| // on the heap. |
| ::fidl::Result GetChild( |
| ::fit::callback<void( |
| ::fidl::WireResponse<::fidl_test_protocolrequest::Parent::GetChild>* |
| response)> |
| _cb); |
| |
| // Asynchronous variant of |Parent.GetChild()|. |
| // Caller provides the backing storage for FIDL message via request buffer. |
| // Ownership of |_context| is given unsafely to the binding until |OnError| |
| // or |OnReply| are called on it. |
| ::fidl::Result GetChild( |
| ::fidl::WireResponseContext< |
| ::fidl_test_protocolrequest::Parent::GetChild>* _context); |
| |
| // Synchronous variant of |Parent.GetChild()|. |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChild> |
| GetChild_Sync(); |
| |
| // Synchronous variant of |Parent.GetChild()|. |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult<::fidl_test_protocolrequest::Parent::GetChild> |
| GetChild_Sync(::fidl::BufferSpan _response_buffer); |
| |
| // Asynchronous variant of |Parent.GetChildRequest()|. |
| // Allocates 16 bytes of request buffer on the stack. The callback is stored |
| // on the heap. |
| ::fidl::Result GetChildRequest( |
| ::fit::callback< |
| void(::fidl::WireResponse< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>* response)> |
| _cb); |
| |
| // Asynchronous variant of |Parent.GetChildRequest()|. |
| // Caller provides the backing storage for FIDL message via request buffer. |
| // Ownership of |_context| is given unsafely to the binding until |OnError| |
| // or |OnReply| are called on it. |
| ::fidl::Result GetChildRequest( |
| ::fidl::WireResponseContext< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest>* _context); |
| |
| // Synchronous variant of |Parent.GetChildRequest()|. |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_protocolrequest::Parent::GetChildRequest> |
| GetChildRequest_Sync(); |
| |
| // Synchronous variant of |Parent.GetChildRequest()|. |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult< |
| ::fidl_test_protocolrequest::Parent::GetChildRequest> |
| GetChildRequest_Sync(::fidl::BufferSpan _response_buffer); |
| |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::Result TakeChild( |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c); |
| |
| // Caller provides the backing storage for FIDL message via request buffer. |
| ::fidl::Result TakeChild( |
| ::fidl::BufferSpan _request_buffer, |
| ::fidl::ClientEnd<::fidl_test_protocolrequest::Child>&& c); |
| |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::Result TakeChildRequest( |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r); |
| |
| // Caller provides the backing storage for FIDL message via request buffer. |
| ::fidl::Result TakeChildRequest( |
| ::fidl::BufferSpan _request_buffer, |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>&& r); |
| |
| ::fidl::WireAsyncEventHandler<::fidl_test_protocolrequest::Parent>* |
| event_handler() const { |
| return event_handler_.get(); |
| } |
| |
| private: |
| friend class ::fidl::Client<::fidl_test_protocolrequest::Parent>; |
| friend class ::fidl::internal::ControlBlock< |
| ::fidl_test_protocolrequest::Parent>; |
| |
| explicit WireClientImpl( |
| std::shared_ptr< |
| ::fidl::WireAsyncEventHandler<::fidl_test_protocolrequest::Parent>> |
| event_handler) |
| : event_handler_(std::move(event_handler)) {} |
| |
| std::optional<::fidl::UnbindInfo> DispatchEvent( |
| fidl_incoming_msg_t* msg) override; |
| |
| std::shared_ptr< |
| ::fidl::WireAsyncEventHandler<::fidl_test_protocolrequest::Parent>> |
| event_handler_; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| // |EventSender| owns a server endpoint of a channel speaking |
| // the Parent protocol, and can send events in that protocol. |
| template <> |
| class ::fidl::WireEventSender<::fidl_test_protocolrequest::Parent> { |
| public: |
| // Constructs an event sender with an invalid channel. |
| WireEventSender() = default; |
| |
| explicit WireEventSender( |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Parent> server_end) |
| : server_end_(std::move(server_end)) {} |
| |
| // The underlying server channel endpoint, which may be replaced at run-time. |
| const ::fidl::ServerEnd<::fidl_test_protocolrequest::Parent>& server_end() |
| const { |
| return server_end_; |
| } |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Parent>& 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(); } |
| |
| private: |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Parent> server_end_; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakEventSender< |
| ::fidl_test_protocolrequest::Parent> { |
| public: |
| private: |
| friend class ::fidl::ServerBindingRef<::fidl_test_protocolrequest::Parent>; |
| |
| explicit WireWeakEventSender( |
| std::weak_ptr<::fidl::internal::AsyncServerBinding< |
| ::fidl_test_protocolrequest::Parent>> |
| binding) |
| : binding_(std::move(binding)) {} |
| |
| std::weak_ptr< |
| ::fidl::internal::AsyncServerBinding<::fidl_test_protocolrequest::Parent>> |
| binding_; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::WireClientImpl<::fidl_test_protocolrequest::Child> final |
| : private ::fidl::internal::ClientBase { |
| public: |
| ::fidl::WireAsyncEventHandler<::fidl_test_protocolrequest::Child>* |
| event_handler() const { |
| return event_handler_.get(); |
| } |
| |
| private: |
| friend class ::fidl::Client<::fidl_test_protocolrequest::Child>; |
| friend class ::fidl::internal::ControlBlock< |
| ::fidl_test_protocolrequest::Child>; |
| |
| explicit WireClientImpl( |
| std::shared_ptr< |
| ::fidl::WireAsyncEventHandler<::fidl_test_protocolrequest::Child>> |
| event_handler) |
| : event_handler_(std::move(event_handler)) {} |
| |
| std::optional<::fidl::UnbindInfo> DispatchEvent( |
| fidl_incoming_msg_t* msg) override; |
| |
| std::shared_ptr< |
| ::fidl::WireAsyncEventHandler<::fidl_test_protocolrequest::Child>> |
| event_handler_; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| // |EventSender| owns a server endpoint of a channel speaking |
| // the Child protocol, and can send events in that protocol. |
| template <> |
| class ::fidl::WireEventSender<::fidl_test_protocolrequest::Child> { |
| public: |
| // Constructs an event sender with an invalid channel. |
| WireEventSender() = default; |
| |
| explicit WireEventSender( |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child> server_end) |
| : server_end_(std::move(server_end)) {} |
| |
| // The underlying server channel endpoint, which may be replaced at run-time. |
| const ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>& server_end() |
| const { |
| return server_end_; |
| } |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child>& 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(); } |
| |
| private: |
| ::fidl::ServerEnd<::fidl_test_protocolrequest::Child> server_end_; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakEventSender< |
| ::fidl_test_protocolrequest::Child> { |
| public: |
| private: |
| friend class ::fidl::ServerBindingRef<::fidl_test_protocolrequest::Child>; |
| |
| explicit WireWeakEventSender( |
| std::weak_ptr<::fidl::internal::AsyncServerBinding< |
| ::fidl_test_protocolrequest::Child>> |
| binding) |
| : binding_(std::move(binding)) {} |
| |
| std::weak_ptr< |
| ::fidl::internal::AsyncServerBinding<::fidl_test_protocolrequest::Child>> |
| binding_; |
| }; |
| #endif // __Fuchsia__ |