| // WARNING: This file is machine generated by fidlgen. |
| |
| #include <fidl/test.drivertwoway/cpp/driver/wire_messaging.h> |
| |
| #include <memory> |
| |
| namespace test_drivertwoway { |
| [[maybe_unused]] constexpr uint64_t kTwoWay_Add_Ordinal = 989730524426044687lu; |
| |
| [[maybe_unused]] constexpr ::fidl::MessageDynamicFlags kTwoWay_Add_DynamicFlags = ::fidl::MessageDynamicFlags::kStrictMethod; |
| |
| extern "C" const fidl_type_t test_drivertwoway_TwoWayAddRequestTable; |
| |
| extern "C" const fidl_type_t test_drivertwoway_TwoWayAddTopResponseTable; |
| |
| #ifdef __Fuchsia__ |
| } // namespace test_drivertwoway |
| ::fdf::WireUnownedResult<::test_drivertwoway::TwoWay::Add>::WireUnownedResult(::fdf::UnownedClientEnd<::test_drivertwoway::TwoWay> client_end, const ::fdf::Arena& arena, ::fidl::internal::TransactionalRequest<::test_drivertwoway::TwoWay::Add>* request) { |
| constexpr uint32_t buffer_size = |
| ::fidl::MaxSizeInChannel<::fidl::internal::TransactionalRequest<::test_drivertwoway::TwoWay::Add>, ::fidl::MessageDirection::kSending>(); |
| uint8_t* buffer = static_cast<uint8_t*>(arena.Allocate(buffer_size)); |
| |
| ::fidl::unstable::UnownedEncodedMessage<::fidl::internal::TransactionalRequest<::test_drivertwoway::TwoWay::Add>, fidl::internal::DriverTransport> request_message( |
| buffer, buffer_size, request); |
| auto& outgoing = request_message.GetOutgoingMessage(); |
| ::fidl::internal::IncomingMessageStorage<::fidl::internal::TransactionalResponse<::test_drivertwoway::TwoWay::Add>> response_storage; |
| ::fidl::CallOptions call_options = { |
| .outgoing_transport_context = |
| ::fidl::internal::OutgoingTransportContext::Create<fidl::internal::DriverTransport>( |
| arena.get()), |
| }; |
| ::fidl::unstable::DecodedMessage<::fidl::internal::TransactionalResponse<::test_drivertwoway::TwoWay::Add>> decoded{ |
| outgoing.Call(client_end.handle(), response_storage.view(), std::move(call_options))}; |
| SetStatus(decoded); |
| if (ok()) { |
| decoded_ = decoded.Take(); |
| } |
| arena_ = std::move(response_storage.arena); |
| } |
| namespace test_drivertwoway { |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| } // namespace test_drivertwoway |
| |
| ::fidl::internal::WireBufferThenable<::test_drivertwoway::TwoWay::Add> fidl::internal::WireWeakAsyncBufferClientImpl<::test_drivertwoway::TwoWay>::Add(uint16_t addend1, uint16_t addend2) { |
| constexpr uint32_t _buffer_size = ::fidl::AsyncClientMethodBufferSizeInChannel<::test_drivertwoway::TwoWay::Add>(); |
| uint8_t* _buffer = static_cast<uint8_t*>(_arena().Allocate(_buffer_size)); |
| |
| ::fidl::internal::TransactionalRequest<::test_drivertwoway::TwoWay::Add> _request{addend1, addend2}; |
| fidl::WriteOptions _options = {}; |
| _options.outgoing_transport_context = |
| ::fidl::internal::OutgoingTransportContext::Create<::fidl::internal::DriverTransport>( |
| _arena().get()); |
| return ::fidl::internal::WireBufferThenable<::test_drivertwoway::TwoWay::Add>{ |
| _client_base(), std::move(_options), _buffer, _buffer_size, &_request}; |
| } |
| |
| ::fdf::WireUnownedResult<::test_drivertwoway::TwoWay::Add> |
| fidl::internal::WireWeakSyncClientImpl<::test_drivertwoway::TwoWay>::Add(uint16_t addend1, uint16_t addend2) { |
| return _client_base()->MakeSyncCallWith( |
| [&](std::shared_ptr<::fidl::internal::AnyTransport> _transport) { |
| ::fidl::internal::TransactionalRequest<::test_drivertwoway::TwoWay::Add> _request{addend1, addend2}; |
| return ::fdf::WireUnownedResult<::test_drivertwoway::TwoWay::Add>(::fdf::UnownedClientEnd<::test_drivertwoway::TwoWay>(_transport->get<::fidl::internal::DriverTransport>()), arena_, &_request); |
| }); |
| } |
| namespace test_drivertwoway { |
| #endif // __Fuchsia__ |
| |
| } // namespace test_drivertwoway |
| #ifdef __Fuchsia__ |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| constexpr ::fidl::internal::MethodEntry fidl::internal::WireServerDispatcher<::test_drivertwoway::TwoWay>::entries_[] = { |
| { |
| ::test_drivertwoway::kTwoWay_Add_Ordinal, |
| [](void* interface, ::fidl::IncomingMessage&& msg, |
| internal::MessageStorageViewBase* storage_view, ::fidl::Transaction* txn) { |
| fdf::Arena arena(::fidl::internal::TakeDriverArenaFromStorage(storage_view)); |
| ::fidl::unstable::DecodedMessage<::fidl::internal::TransactionalRequest<::test_drivertwoway::TwoWay::Add>> decoded{std::move(msg)}; |
| if (unlikely(!decoded.ok())) { |
| return ::fidl::Status{decoded}; |
| } |
| auto* primary = &decoded.PrimaryObject()->body; |
| ::fidl::internal::WireCompleter<::test_drivertwoway::TwoWay::Add>::Sync completer(txn); |
| reinterpret_cast<::fdf::WireServer<::test_drivertwoway::TwoWay>*>(interface)->Add( |
| primary, arena, completer); |
| return ::fidl::Status::Ok(); |
| }, |
| }, |
| }; |
| |
| const ::fidl::internal::MethodEntry* fidl::internal::WireServerDispatcher<::test_drivertwoway::TwoWay>::entries_end_ = |
| &entries_[1]; |
| |
| ::fidl::DispatchResult fidl::internal::WireServerDispatcher<::test_drivertwoway::TwoWay>::TryDispatch( |
| ::fdf::WireServer<::test_drivertwoway::TwoWay>* impl, ::fidl::IncomingMessage& 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_drivertwoway::TwoWay>::Dispatch(::fdf::WireServer<::test_drivertwoway::TwoWay>* impl, ::fidl::IncomingMessage&& msg, |
| internal::MessageStorageViewBase* storage_view, ::fidl::Transaction* txn) { |
| ::fidl::internal::Dispatch(impl, msg, storage_view, txn, entries_, entries_end_); |
| } |
| void fdf::WireServer<::test_drivertwoway::TwoWay>::dispatch_message( |
| ::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn, |
| ::fidl::internal::MessageStorageViewBase* storage_view) { |
| ::fidl::internal::WireServerDispatcher<::test_drivertwoway::TwoWay>::Dispatch(this, std::move(msg), storage_view, txn); |
| } |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| void fidl::internal::WireBufferCompleterImpl<::test_drivertwoway::TwoWay::Add>::Reply(uint16_t sum) { |
| return MakeReply(sum); |
| } |
| |
| void fidl::internal::WireBufferCompleterImpl<::test_drivertwoway::TwoWay::Add>::MakeReply(uint16_t sum) { |
| ::fidl::internal::TransactionalResponse<::test_drivertwoway::TwoWay::Add> _response{sum}; |
| constexpr uint32_t _buffer_size = ::fidl::ServerReplyBufferSizeInChannel<::test_drivertwoway::TwoWay::Add>(); |
| uint8_t* _buffer = static_cast<uint8_t*>(_arena().Allocate(_buffer_size)); |
| ::fidl::unstable::UnownedEncodedMessage< |
| ::fidl::internal::TransactionalResponse<::test_drivertwoway::TwoWay::Add>, ::fidl::internal::DriverTransport> |
| _response_message( |
| _buffer, _buffer_size, &_response); |
| return _core()->SendReply( |
| &_response_message.GetOutgoingMessage(), |
| ::fidl::internal::OutgoingTransportContext::Create<::fidl::internal::DriverTransport>( |
| _arena().get())); |
| } |
| #endif // __Fuchsia__ |
| |
| void ::fidl::internal::TransactionalRequest<::test_drivertwoway::TwoWay::Add>::_InitHeader() { |
| ::fidl::InitTxnHeader(&header, 0, ::test_drivertwoway::kTwoWay_Add_Ordinal, ::test_drivertwoway::kTwoWay_Add_DynamicFlags); |
| } |
| |
| void ::fidl::internal::TransactionalResponse<::test_drivertwoway::TwoWay::Add>::_InitHeader() { |
| ::fidl::InitTxnHeader(&header, 0, ::test_drivertwoway::kTwoWay_Add_Ordinal, ::test_drivertwoway::kTwoWay_Add_DynamicFlags); |
| } |