| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #include <fidl/test.foreigntypeinresponseusedthroughcompose/cpp/wire_messaging.h> |
| |
| #include <memory> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace test_foreigntypeinresponseusedthroughcompose { |
| |
| [[maybe_unused]] |
| constexpr uint64_t kTop_GetFoo_Ordinal = 4619180266423108403lu; |
| |
| [[maybe_unused]] |
| constexpr ::fidl::MessageDynamicFlags kTop_GetFoo_DynamicFlags = ::fidl::MessageDynamicFlags::kStrictMethod; |
| #ifdef __Fuchsia__ |
| } // namespace test_foreigntypeinresponseusedthroughcompose |
| |
| ::fidl::WireResult<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>::WireResult( |
| ::fidl::UnownedClientEnd<::test_foreigntypeinresponseusedthroughcompose::Top> client, |
| ::fidl::internal::TransactionalRequest<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>* request) { |
| FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT |
| ::fidl::internal::OwnedEncodedMessage<::fidl::internal::TransactionalRequest<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>, ::fidl::internal::ChannelTransport> request_message( |
| ::fidl::internal::AllowUnownedInputRef{}, request); |
| auto& outgoing = request_message.GetOutgoingMessage(); |
| ::fidl::internal::IncomingMessageHandleStorage<::fidl::internal::TransactionalResponse<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>> handle_storage; |
| ::fit::result decoded = ::fidl::internal::InplaceDecodeTransactionalResponse<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>( |
| outgoing.Call(client.handle(), handle_storage.view(bytes_.view()), fidl::CallOptions{})); |
| SetStatus(::fidl::internal::StatusFromResult(decoded)); |
| if (ok()) { |
| decoded_ = std::move(decoded.value()); |
| ExtractValueFromDecoded(decoded_.pointer()); |
| } |
| } |
| namespace test_foreigntypeinresponseusedthroughcompose { |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| } // namespace test_foreigntypeinresponseusedthroughcompose |
| |
| ::fidl::WireUnownedResult<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>::WireUnownedResult(::fidl::UnownedClientEnd<::test_foreigntypeinresponseusedthroughcompose::Top> client_end, ::fidl::internal::AnyBufferAllocator& allocator, ::fidl::internal::TransactionalRequest<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>* request) { |
| constexpr uint32_t buffer_size = ::fidl::SyncClientMethodBufferSizeInChannel<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>(); |
| ::fit::result<::fidl::Error, ::fidl::BufferSpan> allocation = allocator.TryAllocate(buffer_size); |
| if (!allocation.is_ok()) { |
| SetStatus(allocation.error_value()); |
| return; |
| } |
| uint8_t* buffer = allocation->data; |
| constexpr uint32_t request_byte_capacity = ::fidl::MaxSizeInChannel< |
| ::fidl::internal::TransactionalRequest<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>, ::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::internal::UnownedEncodedMessage<::fidl::internal::TransactionalRequest<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>> request_message( |
| request_bytes, request_byte_capacity, request); |
| auto& outgoing = request_message.GetOutgoingMessage(); |
| ::fidl::internal::IncomingMessageHandleStorage<::fidl::internal::TransactionalResponse<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>> handle_storage; |
| ::fit::result decoded = ::fidl::internal::InplaceDecodeTransactionalResponse<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>( |
| outgoing.Call( |
| client_end.handle(), |
| handle_storage.view(fidl::BufferSpan(response_bytes, response_byte_capacity)))); |
| SetStatus(::fidl::internal::StatusFromResult(decoded)); |
| if (ok()) { |
| decoded_ = std::move(decoded.value()); |
| ExtractValueFromDecoded(decoded_.pointer()); |
| } |
| } |
| namespace test_foreigntypeinresponseusedthroughcompose { |
| |
| #endif // __Fuchsia__ |
| |
| } // namespace test_foreigntypeinresponseusedthroughcompose |
| |
| #ifdef __Fuchsia__ |
| |
| ::fidl::internal::WireThenable<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo> fidl::internal::WireWeakAsyncClientImpl<::test_foreigntypeinresponseusedthroughcompose::Top>::GetFoo() { |
| ::fidl::internal::TransactionalRequest<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo> _request{}; |
| return ::fidl::internal::WireThenable<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>{ |
| _client_base(), ::fidl::WriteOptions{}, ::fidl::internal::AllowUnownedInputRef{}, &_request}; |
| } |
| ::fidl::internal::WireBufferThenable<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo> fidl::internal::WireWeakAsyncBufferClientImpl<::test_foreigntypeinresponseusedthroughcompose::Top>::GetFoo() { |
| constexpr uint32_t _buffer_size = ::fidl::AsyncClientMethodBufferSizeInChannel<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>(); |
| ::fidl::internal::TransactionalRequest<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo> _request{}; |
| return ::fidl::internal::WireBufferThenable<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>{ |
| _client_base(), ::fidl::WriteOptions{}, _allocator(), _buffer_size, &_request}; |
| } |
| |
| ::fidl::WireResult<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo> |
| fidl::internal::WireWeakSyncClientImpl<::test_foreigntypeinresponseusedthroughcompose::Top>::GetFoo() { |
| return _client_base()->MakeSyncCallWith( |
| [&](std::shared_ptr<::fidl::internal::AnyTransport> _transport) { |
| ::fidl::internal::TransactionalRequest<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo> _request{}; |
| return ::fidl::WireResult<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>(::fidl::UnownedClientEnd<::test_foreigntypeinresponseusedthroughcompose::Top>(_transport->get<::fidl::internal::ChannelTransport>()), &_request); |
| }); |
| } |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| ::fidl::Status fidl::WireSyncEventHandler<::test_foreigntypeinresponseusedthroughcompose::Top>::HandleOneEvent( |
| ::fidl::UnownedClientEnd<::test_foreigntypeinresponseusedthroughcompose::Top> client_end) { |
| ::fidl::internal::IncomingEventsStorage<::test_foreigntypeinresponseusedthroughcompose::Top> event_storage; |
| fidl::internal::WireEventDispatcher<::test_foreigntypeinresponseusedthroughcompose::Top> dispatcher{this}; |
| return HandleOneEventImpl_(client_end.channel(), event_storage.view(), dispatcher); |
| } |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| constexpr ::fidl::internal::MethodEntry fidl::internal::WireServerDispatcher<::test_foreigntypeinresponseusedthroughcompose::Top>::entries_[] = { |
| { |
| ::test_foreigntypeinresponseusedthroughcompose::kTop_GetFoo_Ordinal, |
| [](void* interface, ::fidl::EncodedMessage& msg, ::fidl::WireFormatMetadata metadata, |
| internal::MessageStorageViewBase* storage_view, ::fidl::Transaction* txn) { |
| ::fit::result decoded = ::fidl::internal::DecodeTransactionalMessageWithoutBody( |
| msg, metadata); |
| if (unlikely(!decoded.is_ok())) { |
| return decoded.error_value(); |
| } |
| ::fidl::internal::WireCompleter<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>::Sync completer(txn); |
| reinterpret_cast<::fidl::WireServer<::test_foreigntypeinresponseusedthroughcompose::Top>*>(interface)->GetFoo( |
| completer); |
| return ::fidl::Status::Ok(); |
| }, |
| }, |
| }; |
| |
| const ::fidl::internal::MethodEntry* fidl::internal::WireServerDispatcher<::test_foreigntypeinresponseusedthroughcompose::Top>::entries_end_ = |
| &entries_[1]; |
| |
| ::fidl::DispatchResult fidl::internal::WireServerDispatcher<::test_foreigntypeinresponseusedthroughcompose::Top>::TryDispatch( |
| ::fidl::WireServer<::test_foreigntypeinresponseusedthroughcompose::Top>* impl, ::fidl::IncomingHeaderAndMessage& msg, |
| internal::MessageStorageViewBase* storage_view, ::fidl::Transaction* txn) { |
| return ::fidl::internal::TryDispatch( |
| impl, msg, storage_view, txn, entries_, entries_end_); |
| } |
| |
| void fidl::internal::WireServerDispatcher<::test_foreigntypeinresponseusedthroughcompose::Top>::Dispatch(::fidl::WireServer<::test_foreigntypeinresponseusedthroughcompose::Top>* impl, ::fidl::IncomingHeaderAndMessage&& msg, |
| internal::MessageStorageViewBase* storage_view, ::fidl::Transaction* txn) { |
| ::fidl::internal::Dispatch(impl, msg, storage_view, txn, entries_, entries_end_, |
| &unknown_method_handler_entry_); |
| } |
| |
| void fidl::WireServer<::test_foreigntypeinresponseusedthroughcompose::Top>::dispatch_message( |
| ::fidl::IncomingHeaderAndMessage&& msg, ::fidl::Transaction* txn, |
| ::fidl::internal::MessageStorageViewBase* storage_view) { |
| ::fidl::internal::WireServerDispatcher<::test_foreigntypeinresponseusedthroughcompose::Top>::Dispatch(this, std::move(msg), storage_view, txn); |
| } |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| void fidl::internal::WireCompleterImpl<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>::Reply(const ::test_bottom::wire::Foo& foo) { |
| return MakeReply(foo); |
| } |
| |
| void fidl::internal::WireCompleterImpl<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>::MakeReply(const ::test_bottom::wire::Foo& foo) { |
| ::fidl::internal::TransactionalResponse<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo> _response{foo}; |
| FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT |
| ::fidl::internal::OwnedEncodedMessage< |
| ::fidl::internal::TransactionalResponse<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>, ::fidl::internal::ChannelTransport> |
| _response_message{ |
| ::fidl::internal::AllowUnownedInputRef{}, &_response}; |
| return _core()->SendReply(&_response_message.GetOutgoingMessage(), |
| ::fidl::internal::OutgoingTransportContext()); |
| } |
| |
| void fidl::internal::WireBufferCompleterImpl<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>::Reply(const ::test_bottom::wire::Foo& foo) { |
| return MakeReply(foo); |
| } |
| |
| void fidl::internal::WireBufferCompleterImpl<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>::MakeReply(const ::test_bottom::wire::Foo& foo) { |
| ::fidl::internal::TransactionalResponse<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo> _response{foo}; |
| constexpr uint32_t _buffer_size = ::fidl::ServerReplyBufferSizeInChannel<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>(); |
| ::fit::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::internal::UnownedEncodedMessage< |
| ::fidl::internal::TransactionalResponse<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>, ::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::TransactionalRequest<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>::_InitHeader() { |
| ::fidl::InitTxnHeader(&header, 0, ::test_foreigntypeinresponseusedthroughcompose::kTop_GetFoo_Ordinal, ::test_foreigntypeinresponseusedthroughcompose::kTop_GetFoo_DynamicFlags); |
| } |
| |
| #endif // __Fuchsia__ |
| |
| void ::fidl::internal::TransactionalResponse<::test_foreigntypeinresponseusedthroughcompose::Top::GetFoo>::_InitHeader() { |
| ::fidl::InitTxnHeader(&header, 0, ::test_foreigntypeinresponseusedthroughcompose::kTop_GetFoo_Ordinal, ::test_foreigntypeinresponseusedthroughcompose::kTop_GetFoo_DynamicFlags); |
| } |
| |
| #ifdef __Fuchsia__ |
| |
| #endif // __Fuchsia__ |
| |
| #pragma clang diagnostic pop |