| // WARNING: This file is machine generated by fidlgen. |
| |
| #include <fidl/test.union/cpp/wire_messaging.h> |
| |
| #include <memory> |
| |
| namespace test_union { |
| [[maybe_unused]] constexpr uint64_t |
| kTestProtocol_StrictXUnionHenceResponseMayBeStackAllocated_Ordinal = |
| 582913180652179677lu; |
| |
| [[maybe_unused]] constexpr ::fidl::MessageDynamicFlags |
| kTestProtocol_StrictXUnionHenceResponseMayBeStackAllocated_DynamicFlags = |
| ::fidl::MessageDynamicFlags::kStrictMethod; |
| |
| extern "C" const fidl_type_t |
| test_union_TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponseTable; |
| |
| [[maybe_unused]] constexpr uint64_t |
| kTestProtocol_FlexibleXUnionHenceResponseMustBeHeapAllocated_Ordinal = |
| 7698084639218919941lu; |
| |
| [[maybe_unused]] constexpr ::fidl::MessageDynamicFlags |
| kTestProtocol_FlexibleXUnionHenceResponseMustBeHeapAllocated_DynamicFlags = |
| ::fidl::MessageDynamicFlags::kStrictMethod; |
| |
| extern "C" const fidl_type_t |
| test_union_TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponseTable; |
| #ifdef __Fuchsia__ |
| } // namespace test_union |
| ::fidl::WireResult< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>:: |
| WireResult(::fidl::UnownedClientEnd<::test_union::TestProtocol> client, |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>* request) { |
| FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT |
| ::fidl::unstable::OwnedEncodedMessage< |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>, |
| ::fidl::internal::ChannelTransport> |
| request_message(::fidl::internal::AllowUnownedInputRef{}, request); |
| auto& outgoing = request_message.GetOutgoingMessage(); |
| outgoing.Call<::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>>( |
| client.handle(), bytes_.data(), static_cast<uint32_t>(bytes_.size())); |
| SetStatus(outgoing); |
| } |
| |
| ::fidl::WireResult< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>:: |
| WireResult(::fidl::UnownedClientEnd<::test_union::TestProtocol> client, |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>* request, |
| zx_time_t deadline) { |
| FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT |
| ::fidl::unstable::OwnedEncodedMessage< |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>, |
| ::fidl::internal::ChannelTransport> |
| request_message(::fidl::internal::AllowUnownedInputRef{}, request); |
| auto& outgoing = request_message.GetOutgoingMessage(); |
| outgoing.Call<::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>>( |
| client.handle(), bytes_.data(), static_cast<uint32_t>(bytes_.size()), |
| fidl::CallOptions{.deadline = deadline}); |
| SetStatus(outgoing); |
| } |
| namespace test_union { |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| } // namespace test_union |
| ::fidl::WireUnownedResult< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>:: |
| WireUnownedResult( |
| ::fidl::UnownedClientEnd<::test_union::TestProtocol> client_end, |
| ::fidl::internal::AnyBufferAllocator& allocator, |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>* request) { |
| constexpr uint32_t buffer_size = ::fidl::SyncClientMethodBufferSizeInChannel< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>(); |
| ::fitx::result<::fidl::Error, ::fidl::BufferSpan> allocation = |
| allocator.TryAllocate(buffer_size); |
| if (!allocation.is_ok()) { |
| ::fidl::Status::operator=(allocation.error_value()); |
| return; |
| } |
| uint8_t* buffer = allocation->data; |
| constexpr uint32_t request_byte_capacity = ::fidl::MaxSizeInChannel< |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>, |
| ::fidl::MessageDirection::kSending>(); |
| uint8_t* request_bytes = buffer; |
| static_assert(buffer_size > request_byte_capacity); |
| uint32_t response_byte_capacity = buffer_size - request_byte_capacity; |
| uint8_t* response_bytes = &buffer[request_byte_capacity]; |
| |
| ::fidl::unstable::UnownedEncodedMessage< |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>> |
| request_message(request_bytes, request_byte_capacity, request); |
| auto& outgoing = request_message.GetOutgoingMessage(); |
| outgoing.Call<::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>>( |
| client_end.handle(), response_bytes, response_byte_capacity); |
| bytes_ = response_bytes; |
| ::fidl::Status::operator=(outgoing); |
| } |
| namespace test_union { |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| } // namespace test_union |
| ::fidl::WireResult<::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>:: |
| WireResult( |
| ::fidl::UnownedClientEnd<::test_union::TestProtocol> client, |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>* request) { |
| FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT |
| ::fidl::unstable::OwnedEncodedMessage< |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>, |
| ::fidl::internal::ChannelTransport> |
| request_message(::fidl::internal::AllowUnownedInputRef{}, request); |
| auto& outgoing = request_message.GetOutgoingMessage(); |
| outgoing.Call<::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>>( |
| client.handle(), bytes_.data(), static_cast<uint32_t>(bytes_.size())); |
| SetStatus(outgoing); |
| } |
| |
| ::fidl::WireResult<::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>:: |
| WireResult(::fidl::UnownedClientEnd<::test_union::TestProtocol> client, |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>* request, |
| zx_time_t deadline) { |
| FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT |
| ::fidl::unstable::OwnedEncodedMessage< |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>, |
| ::fidl::internal::ChannelTransport> |
| request_message(::fidl::internal::AllowUnownedInputRef{}, request); |
| auto& outgoing = request_message.GetOutgoingMessage(); |
| outgoing.Call<::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>>( |
| client.handle(), bytes_.data(), static_cast<uint32_t>(bytes_.size()), |
| fidl::CallOptions{.deadline = deadline}); |
| SetStatus(outgoing); |
| } |
| namespace test_union { |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| } // namespace test_union |
| ::fidl::WireUnownedResult<::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>:: |
| WireUnownedResult( |
| ::fidl::UnownedClientEnd<::test_union::TestProtocol> client_end, |
| ::fidl::internal::AnyBufferAllocator& allocator, |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>* request) { |
| constexpr uint32_t buffer_size = ::fidl::SyncClientMethodBufferSizeInChannel< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>(); |
| ::fitx::result<::fidl::Error, ::fidl::BufferSpan> allocation = |
| allocator.TryAllocate(buffer_size); |
| if (!allocation.is_ok()) { |
| ::fidl::Status::operator=(allocation.error_value()); |
| return; |
| } |
| uint8_t* buffer = allocation->data; |
| constexpr uint32_t request_byte_capacity = ::fidl::MaxSizeInChannel< |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>, |
| ::fidl::MessageDirection::kSending>(); |
| uint8_t* request_bytes = buffer; |
| static_assert(buffer_size > request_byte_capacity); |
| uint32_t response_byte_capacity = buffer_size - request_byte_capacity; |
| uint8_t* response_bytes = &buffer[request_byte_capacity]; |
| |
| ::fidl::unstable::UnownedEncodedMessage< |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>> |
| request_message(request_bytes, request_byte_capacity, request); |
| auto& outgoing = request_message.GetOutgoingMessage(); |
| outgoing.Call<::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>>( |
| client_end.handle(), response_bytes, response_byte_capacity); |
| bytes_ = response_bytes; |
| ::fidl::Status::operator=(outgoing); |
| } |
| namespace test_union { |
| #endif // __Fuchsia__ |
| |
| } // namespace test_union |
| #ifdef __Fuchsia__ |
| |
| ::fidl::internal::WireThenable< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> |
| fidl::internal::WireWeakAsyncClientImpl<::test_union::TestProtocol>:: |
| StrictXUnionHenceResponseMayBeStackAllocated() { |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> |
| _request{}; |
| return ::fidl::internal::WireThenable< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>{ |
| _client_base(), ::fidl::WriteOptions{}, |
| ::fidl::internal::AllowUnownedInputRef{}, &_request}; |
| } |
| |
| ::fidl::internal::WireThenable< |
| ::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> |
| fidl::internal::WireWeakAsyncClientImpl<::test_union::TestProtocol>:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated() { |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated> |
| _request{}; |
| return ::fidl::internal::WireThenable< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>{ |
| _client_base(), ::fidl::WriteOptions{}, |
| ::fidl::internal::AllowUnownedInputRef{}, &_request}; |
| } |
| ::fidl::internal::WireBufferThenable< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> |
| fidl::internal::WireWeakAsyncBufferClientImpl<::test_union::TestProtocol>:: |
| StrictXUnionHenceResponseMayBeStackAllocated() { |
| constexpr uint32_t _buffer_size = |
| ::fidl::AsyncClientMethodBufferSizeInChannel< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>(); |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> |
| _request{}; |
| return ::fidl::internal::WireBufferThenable< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>{ |
| _client_base(), ::fidl::WriteOptions{}, _allocator(), _buffer_size, |
| &_request}; |
| } |
| ::fidl::internal::WireBufferThenable< |
| ::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> |
| fidl::internal::WireWeakAsyncBufferClientImpl<::test_union::TestProtocol>:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated() { |
| constexpr uint32_t _buffer_size = |
| ::fidl::AsyncClientMethodBufferSizeInChannel< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>(); |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated> |
| _request{}; |
| return ::fidl::internal::WireBufferThenable< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>{ |
| _client_base(), ::fidl::WriteOptions{}, _allocator(), _buffer_size, |
| &_request}; |
| } |
| |
| ::fidl::WireResult< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> |
| fidl::internal::WireWeakSyncClientImpl<::test_union::TestProtocol>:: |
| StrictXUnionHenceResponseMayBeStackAllocated() { |
| return _client_base()->MakeSyncCallWith( |
| [&](std::shared_ptr<::fidl::internal::AnyTransport> _transport) { |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated> |
| _request{}; |
| return ::fidl::WireResult< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>( |
| ::fidl::UnownedClientEnd<::test_union::TestProtocol>( |
| _transport->get<::fidl::internal::ChannelTransport>()), |
| &_request); |
| }); |
| } |
| |
| ::fidl::WireResult< |
| ::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> |
| fidl::internal::WireWeakSyncClientImpl<::test_union::TestProtocol>:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated() { |
| return _client_base()->MakeSyncCallWith( |
| [&](std::shared_ptr<::fidl::internal::AnyTransport> _transport) { |
| ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated> |
| _request{}; |
| return ::fidl::WireResult< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>( |
| ::fidl::UnownedClientEnd<::test_union::TestProtocol>( |
| _transport->get<::fidl::internal::ChannelTransport>()), |
| &_request); |
| }); |
| } |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| ::fidl::Status |
| fidl::WireSyncEventHandler<::test_union::TestProtocol>::HandleOneEvent( |
| ::fidl::UnownedClientEnd<::test_union::TestProtocol> client_end) { |
| zx_status_t status = client_end.channel()->wait_one( |
| ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, ::zx::time::infinite(), |
| nullptr); |
| if (status != ZX_OK) { |
| return ::fidl::Status::TransportError( |
| status, ::fidl::internal::kErrorWaitOneFailed); |
| } |
| constexpr uint32_t kHandleAllocSize = ([]() constexpr { |
| uint32_t x = 0; |
| if (x > ZX_CHANNEL_MAX_MSG_HANDLES) { |
| x = ZX_CHANNEL_MAX_MSG_HANDLES; |
| } |
| return x; |
| })(); |
| static_assert(kHandleAllocSize <= ZX_CHANNEL_MAX_MSG_HANDLES); |
| ::fidl::internal::InlineMessageBuffer<72> read_storage; |
| std::array<zx_handle_t, kHandleAllocSize> read_handles; |
| // TODO(fxbug.dev/85734) Remove this channel-specific allocation. |
| std::array<fidl_channel_handle_metadata_t, kHandleAllocSize> |
| read_handle_metadata; |
| ::fidl::IncomingMessage msg = ::fidl::MessageRead( |
| zx::unowned_channel(client_end.handle()), read_storage.view(), |
| read_handles.data(), read_handle_metadata.data(), kHandleAllocSize, |
| ReadOptions{.discardable = true}); |
| if (msg.status() == ZX_ERR_BUFFER_TOO_SMALL) { |
| // Message size is unexpectedly larger than calculated. |
| // This can only be due to a newer version of the protocol defining a new |
| // event, whose size exceeds the maximum of known events in the current |
| // protocol. |
| return ::fidl::Status::UnexpectedMessage( |
| ZX_ERR_BUFFER_TOO_SMALL, |
| ::fidl::internal::kErrorSyncEventBufferTooSmall); |
| } |
| if (!msg.ok()) { |
| return msg; |
| } |
| fidl_message_header_t* hdr = msg.header(); |
| switch (hdr->ordinal) { |
| default: { |
| return ::fidl::Status::UnknownOrdinal(); |
| } |
| } |
| } |
| |
| std::optional<::fidl::UnbindInfo> |
| fidl::internal::WireEventDispatcher<::test_union::TestProtocol>::DispatchEvent( |
| ::fidl::IncomingMessage& msg, |
| ::fidl::internal::IncomingTransportContext transport_context) { |
| switch (msg.header()->ordinal) { |
| default: |
| break; |
| } |
| return ::fidl::UnbindInfo::UnknownOrdinal(); |
| } |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| constexpr ::fidl::internal::MethodEntry fidl::internal::WireServerDispatcher< |
| ::test_union::TestProtocol>::entries_[] = { |
| { |
| ::test_union:: |
| kTestProtocol_StrictXUnionHenceResponseMayBeStackAllocated_Ordinal, |
| [](void* interface, ::fidl::IncomingMessage&& msg, |
| internal::IncomingTransportContext transport_context, |
| ::fidl::Transaction* txn) { |
| ::fidl::WireRequest<::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated> |
| empty_request; |
| auto* primary = &empty_request; |
| ::fidl::internal::WireCompleter< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>::Sync |
| completer(txn); |
| reinterpret_cast<::fidl::WireServer<::test_union::TestProtocol>*>( |
| interface) |
| ->StrictXUnionHenceResponseMayBeStackAllocated(primary, |
| completer); |
| return ZX_OK; |
| }, |
| }, |
| { |
| ::test_union:: |
| kTestProtocol_FlexibleXUnionHenceResponseMustBeHeapAllocated_Ordinal, |
| [](void* interface, ::fidl::IncomingMessage&& msg, |
| internal::IncomingTransportContext transport_context, |
| ::fidl::Transaction* txn) { |
| ::fidl::WireRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated> |
| empty_request; |
| auto* primary = &empty_request; |
| ::fidl::internal::WireCompleter< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>::Sync |
| completer(txn); |
| reinterpret_cast<::fidl::WireServer<::test_union::TestProtocol>*>( |
| interface) |
| ->FlexibleXUnionHenceResponseMustBeHeapAllocated(primary, |
| completer); |
| return ZX_OK; |
| }, |
| }, |
| }; |
| |
| const ::fidl::internal::MethodEntry* fidl::internal::WireServerDispatcher< |
| ::test_union::TestProtocol>::entries_end_ = &entries_[2]; |
| |
| ::fidl::DispatchResult |
| fidl::internal::WireServerDispatcher<::test_union::TestProtocol>::TryDispatch( |
| ::fidl::WireServer<::test_union::TestProtocol>* impl, |
| ::fidl::IncomingMessage& msg, |
| internal::IncomingTransportContext transport_context, |
| ::fidl::Transaction* txn) { |
| return ::fidl::internal::TryDispatch(impl, msg, std::move(transport_context), |
| txn, entries_, entries_end_); |
| } |
| |
| void fidl::internal::WireServerDispatcher<::test_union::TestProtocol>::Dispatch( |
| ::fidl::WireServer<::test_union::TestProtocol>* impl, |
| ::fidl::IncomingMessage&& msg, |
| internal::IncomingTransportContext transport_context, |
| ::fidl::Transaction* txn) { |
| ::fidl::internal::Dispatch(impl, msg, std::move(transport_context), txn, |
| entries_, entries_end_); |
| } |
| void fidl::WireServer<::test_union::TestProtocol>::dispatch_message( |
| ::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn, |
| ::fidl::internal::IncomingTransportContext transport_context) { |
| ::fidl::internal::WireServerDispatcher<::test_union::TestProtocol>::Dispatch( |
| this, std::move(msg), std::move(transport_context), txn); |
| } |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| void fidl::internal::WireCompleterImpl< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>:: |
| Reply(::test_union::wire::StrictBoundedXUnion xu) { |
| ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> |
| _response{xu}; |
| FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT |
| ::fidl::unstable::OwnedEncodedMessage< |
| ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>, |
| ::fidl::internal::ChannelTransport> |
| _response_message{::fidl::internal::AllowUnownedInputRef{}, &_response}; |
| return _core()->SendReply(&_response_message.GetOutgoingMessage(), |
| ::fidl::internal::OutgoingTransportContext()); |
| } |
| |
| void fidl::internal::WireBufferCompleterImpl< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>:: |
| Reply(::test_union::wire::StrictBoundedXUnion xu) { |
| ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> |
| _response{xu}; |
| constexpr uint32_t _buffer_size = ::fidl::ServerReplyBufferSizeInChannel< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>(); |
| ::fitx::result<::fidl::Error, ::fidl::BufferSpan> _allocation = |
| _allocator().TryAllocate(_buffer_size); |
| if (!_allocation.is_ok()) { |
| ::fidl::OutgoingMessage _failure{_allocation.error_value()}; |
| return _core()->SendReply(&_failure, |
| ::fidl::internal::OutgoingTransportContext()); |
| } |
| ::fidl::unstable::UnownedEncodedMessage< |
| ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| StrictXUnionHenceResponseMayBeStackAllocated>, |
| ::fidl::internal::ChannelTransport> |
| _response_message(_allocation->data, _buffer_size, &_response); |
| return _core()->SendReply(&_response_message.GetOutgoingMessage(), |
| ::fidl::internal::OutgoingTransportContext()); |
| } |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| void fidl::internal::WireCompleterImpl< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>:: |
| Reply(::test_union::wire::OlderSimpleUnion xu) { |
| ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated> |
| _response{xu}; |
| FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT |
| ::fidl::unstable::OwnedEncodedMessage< |
| ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>, |
| ::fidl::internal::ChannelTransport> |
| _response_message{::fidl::internal::AllowUnownedInputRef{}, &_response}; |
| return _core()->SendReply(&_response_message.GetOutgoingMessage(), |
| ::fidl::internal::OutgoingTransportContext()); |
| } |
| |
| void fidl::internal::WireBufferCompleterImpl< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>:: |
| Reply(::test_union::wire::OlderSimpleUnion xu) { |
| ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated> |
| _response{xu}; |
| constexpr uint32_t _buffer_size = ::fidl::ServerReplyBufferSizeInChannel< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>(); |
| ::fitx::result<::fidl::Error, ::fidl::BufferSpan> _allocation = |
| _allocator().TryAllocate(_buffer_size); |
| if (!_allocation.is_ok()) { |
| ::fidl::OutgoingMessage _failure{_allocation.error_value()}; |
| return _core()->SendReply(&_failure, |
| ::fidl::internal::OutgoingTransportContext()); |
| } |
| ::fidl::unstable::UnownedEncodedMessage< |
| ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>, |
| ::fidl::internal::ChannelTransport> |
| _response_message(_allocation->data, _buffer_size, &_response); |
| return _core()->SendReply(&_response_message.GetOutgoingMessage(), |
| ::fidl::internal::OutgoingTransportContext()); |
| } |
| #endif // __Fuchsia__ |
| |
| void ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>:: |
| _InitHeader() { |
| ::fidl::InitTxnHeader( |
| &header, 0, |
| ::test_union:: |
| kTestProtocol_StrictXUnionHenceResponseMayBeStackAllocated_Ordinal, |
| ::test_union:: |
| kTestProtocol_StrictXUnionHenceResponseMayBeStackAllocated_DynamicFlags); |
| } |
| |
| void ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>:: |
| _InitHeader() { |
| ::fidl::InitTxnHeader( |
| &header, 0, |
| ::test_union:: |
| kTestProtocol_StrictXUnionHenceResponseMayBeStackAllocated_Ordinal, |
| ::test_union:: |
| kTestProtocol_StrictXUnionHenceResponseMayBeStackAllocated_DynamicFlags); |
| } |
| |
| void ::fidl::internal::TransactionalRequest< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>::_InitHeader() { |
| ::fidl::InitTxnHeader( |
| &header, 0, |
| ::test_union:: |
| kTestProtocol_FlexibleXUnionHenceResponseMustBeHeapAllocated_Ordinal, |
| ::test_union:: |
| kTestProtocol_FlexibleXUnionHenceResponseMustBeHeapAllocated_DynamicFlags); |
| } |
| |
| void ::fidl::internal::TransactionalResponse< |
| ::test_union::TestProtocol:: |
| FlexibleXUnionHenceResponseMustBeHeapAllocated>::_InitHeader() { |
| ::fidl::InitTxnHeader( |
| &header, 0, |
| ::test_union:: |
| kTestProtocol_FlexibleXUnionHenceResponseMustBeHeapAllocated_Ordinal, |
| ::test_union:: |
| kTestProtocol_FlexibleXUnionHenceResponseMustBeHeapAllocated_DynamicFlags); |
| } |
| |
| #ifdef __Fuchsia__ |
| |
| #endif // __Fuchsia__ |