| // WARNING: This file is machine generated by fidlgen. |
| |
| #include <fidl/test/inheritancewithrecursivedecl/llcpp/fidl.h> |
| |
| #include <memory> |
| |
| namespace llcpp { |
| |
| namespace fidl { |
| namespace test { |
| namespace inheritancewithrecursivedecl { |
| |
| namespace { |
| |
| [[maybe_unused]] constexpr uint64_t kParent_First_Ordinal = |
| 3051519745671742363lu; |
| extern "C" const fidl_type_t |
| fidl_test_inheritancewithrecursivedecl_ParentFirstRequestTable; |
| extern "C" const fidl_type_t |
| fidl_test_inheritancewithrecursivedecl_ParentFirstResponseTable; |
| |
| } // namespace |
| Parent::ResultOf::First::First( |
| ::fidl::UnownedClientEnd<Parent> _client, |
| ::fidl::ServerEnd< |
| ::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>& request) { |
| FirstRequest::OwnedEncodedMessage _request(zx_txid_t(0), request); |
| _request.GetOutgoingMessage().Write(_client); |
| status_ = _request.status(); |
| error_ = _request.error(); |
| } |
| |
| Parent::UnownedResultOf::First::First( |
| ::fidl::UnownedClientEnd<Parent> _client, uint8_t* _request_bytes, |
| uint32_t _request_byte_capacity, |
| ::fidl::ServerEnd< |
| ::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>& request) { |
| FirstRequest::UnownedEncodedMessage _request( |
| _request_bytes, _request_byte_capacity, 0, request); |
| _request.GetOutgoingMessage().Write(_client); |
| status_ = _request.status(); |
| error_ = _request.error(); |
| } |
| |
| ::fidl::Result Parent::ClientImpl::First( |
| ::fidl::ServerEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) { |
| auto _res = ResultOf::First( |
| ::fidl::UnownedClientEnd<Parent>(_channel->handle()), request); |
| return ::fidl::Result(_res.status(), _res.error()); |
| } |
| return ::fidl::Result(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound); |
| } |
| |
| ::fidl::Result Parent::ClientImpl::First( |
| ::fidl::BufferSpan _request_buffer, |
| ::fidl::ServerEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) { |
| auto _res = UnownedResultOf::First( |
| ::fidl::UnownedClientEnd<Parent>(_channel->handle()), |
| _request_buffer.data, _request_buffer.capacity, request); |
| return ::fidl::Result(_res.status(), _res.error()); |
| } |
| return ::fidl::Result(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound); |
| } |
| |
| std::optional<::fidl::UnbindInfo> Parent::ClientImpl::DispatchEvent( |
| fidl_incoming_msg_t* msg) { |
| FidlHandleInfoCloseMany(msg->handles, msg->num_handles); |
| return ::fidl::UnbindInfo{::fidl::UnbindInfo::kUnexpectedMessage, |
| ZX_ERR_NOT_SUPPORTED}; |
| } |
| |
| namespace methods { |
| |
| void ParentDispatchFirst(void* interface, void* bytes, |
| ::fidl::Transaction* txn) { |
| auto message = reinterpret_cast<Parent::FirstRequest*>(bytes); |
| Parent::TypedChannelInterface::FirstCompleter::Sync completer(txn); |
| reinterpret_cast<Parent::TypedChannelInterface*>(interface)->First( |
| std::move(message->request), completer); |
| } |
| |
| } // namespace methods |
| |
| namespace entries { |
| |
| ::fidl::internal::MethodEntry Parent[] = { |
| {kParent_First_Ordinal, Parent::FirstRequest::Type, |
| methods::ParentDispatchFirst}, |
| }; |
| |
| } // namespace entries |
| |
| ::fidl::DispatchResult Parent::TryDispatch(TypedChannelInterface* impl, |
| fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) { |
| return ::fidl::internal::TryDispatch( |
| impl, msg, txn, entries::Parent, |
| entries::Parent + |
| sizeof(entries::Parent) / sizeof(::fidl::internal::MethodEntry)); |
| } |
| |
| ::fidl::DispatchResult Parent::Dispatch(TypedChannelInterface* impl, |
| fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) { |
| ::fidl::DispatchResult dispatch_result = TryDispatch(impl, msg, txn); |
| if (dispatch_result == ::fidl::DispatchResult::kNotFound) { |
| FidlHandleInfoCloseMany(msg->handles, msg->num_handles); |
| txn->InternalError( |
| {::fidl::UnbindInfo::kUnexpectedMessage, ZX_ERR_NOT_SUPPORTED}); |
| } |
| return dispatch_result; |
| } |
| |
| ::fidl::DispatchResult Parent::TypedChannelInterface::dispatch_message( |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn) { |
| return Parent::Dispatch(this, msg, txn); |
| } |
| |
| void Parent::FirstRequest::_InitHeader(zx_txid_t _txid) { |
| fidl_init_txn_header(&_hdr, _txid, kParent_First_Ordinal); |
| } |
| |
| void Parent::FirstRequest::_CloseHandles() { request.reset(); } |
| |
| namespace { |
| |
| [[maybe_unused]] constexpr uint64_t kChild_First_Ordinal = |
| 3051519745671742363lu; |
| extern "C" const fidl_type_t |
| fidl_test_inheritancewithrecursivedecl_ChildFirstRequestTable; |
| extern "C" const fidl_type_t |
| fidl_test_inheritancewithrecursivedecl_ChildFirstResponseTable; |
| [[maybe_unused]] constexpr uint64_t kChild_Second_Ordinal = |
| 489667253787160198lu; |
| extern "C" const fidl_type_t |
| fidl_test_inheritancewithrecursivedecl_ChildSecondRequestTable; |
| extern "C" const fidl_type_t |
| fidl_test_inheritancewithrecursivedecl_ChildSecondResponseTable; |
| |
| } // namespace |
| Child::ResultOf::First::First( |
| ::fidl::UnownedClientEnd<Child> _client, |
| ::fidl::ServerEnd< |
| ::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>& request) { |
| FirstRequest::OwnedEncodedMessage _request(zx_txid_t(0), request); |
| _request.GetOutgoingMessage().Write(_client); |
| status_ = _request.status(); |
| error_ = _request.error(); |
| } |
| |
| Child::UnownedResultOf::First::First( |
| ::fidl::UnownedClientEnd<Child> _client, uint8_t* _request_bytes, |
| uint32_t _request_byte_capacity, |
| ::fidl::ServerEnd< |
| ::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>& request) { |
| FirstRequest::UnownedEncodedMessage _request( |
| _request_bytes, _request_byte_capacity, 0, request); |
| _request.GetOutgoingMessage().Write(_client); |
| status_ = _request.status(); |
| error_ = _request.error(); |
| } |
| |
| Child::ResultOf::Second::Second( |
| ::fidl::UnownedClientEnd<Child> _client, |
| ::fidl::ServerEnd< |
| ::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>& request) { |
| SecondRequest::OwnedEncodedMessage _request(zx_txid_t(0), request); |
| _request.GetOutgoingMessage().Write(_client); |
| status_ = _request.status(); |
| error_ = _request.error(); |
| } |
| |
| Child::UnownedResultOf::Second::Second( |
| ::fidl::UnownedClientEnd<Child> _client, uint8_t* _request_bytes, |
| uint32_t _request_byte_capacity, |
| ::fidl::ServerEnd< |
| ::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>& request) { |
| SecondRequest::UnownedEncodedMessage _request( |
| _request_bytes, _request_byte_capacity, 0, request); |
| _request.GetOutgoingMessage().Write(_client); |
| status_ = _request.status(); |
| error_ = _request.error(); |
| } |
| |
| ::fidl::Result Child::ClientImpl::First( |
| ::fidl::ServerEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) { |
| auto _res = ResultOf::First( |
| ::fidl::UnownedClientEnd<Child>(_channel->handle()), request); |
| return ::fidl::Result(_res.status(), _res.error()); |
| } |
| return ::fidl::Result(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound); |
| } |
| |
| ::fidl::Result Child::ClientImpl::First( |
| ::fidl::BufferSpan _request_buffer, |
| ::fidl::ServerEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) { |
| auto _res = UnownedResultOf::First( |
| ::fidl::UnownedClientEnd<Child>(_channel->handle()), |
| _request_buffer.data, _request_buffer.capacity, request); |
| return ::fidl::Result(_res.status(), _res.error()); |
| } |
| return ::fidl::Result(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound); |
| } |
| |
| ::fidl::Result Child::ClientImpl::Second( |
| ::fidl::ServerEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) { |
| auto _res = ResultOf::Second( |
| ::fidl::UnownedClientEnd<Child>(_channel->handle()), request); |
| return ::fidl::Result(_res.status(), _res.error()); |
| } |
| return ::fidl::Result(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound); |
| } |
| |
| ::fidl::Result Child::ClientImpl::Second( |
| ::fidl::BufferSpan _request_buffer, |
| ::fidl::ServerEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) { |
| auto _res = UnownedResultOf::Second( |
| ::fidl::UnownedClientEnd<Child>(_channel->handle()), |
| _request_buffer.data, _request_buffer.capacity, request); |
| return ::fidl::Result(_res.status(), _res.error()); |
| } |
| return ::fidl::Result(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound); |
| } |
| |
| std::optional<::fidl::UnbindInfo> Child::ClientImpl::DispatchEvent( |
| fidl_incoming_msg_t* msg) { |
| FidlHandleInfoCloseMany(msg->handles, msg->num_handles); |
| return ::fidl::UnbindInfo{::fidl::UnbindInfo::kUnexpectedMessage, |
| ZX_ERR_NOT_SUPPORTED}; |
| } |
| |
| namespace methods { |
| |
| void ChildDispatchFirst(void* interface, void* bytes, |
| ::fidl::Transaction* txn) { |
| auto message = reinterpret_cast<Child::FirstRequest*>(bytes); |
| Child::TypedChannelInterface::FirstCompleter::Sync completer(txn); |
| reinterpret_cast<Child::TypedChannelInterface*>(interface)->First( |
| std::move(message->request), completer); |
| } |
| |
| void ChildDispatchSecond(void* interface, void* bytes, |
| ::fidl::Transaction* txn) { |
| auto message = reinterpret_cast<Child::SecondRequest*>(bytes); |
| Child::TypedChannelInterface::SecondCompleter::Sync completer(txn); |
| reinterpret_cast<Child::TypedChannelInterface*>(interface)->Second( |
| std::move(message->request), completer); |
| } |
| |
| } // namespace methods |
| |
| namespace entries { |
| |
| ::fidl::internal::MethodEntry Child[] = { |
| {kChild_First_Ordinal, Child::FirstRequest::Type, |
| methods::ChildDispatchFirst}, |
| {kChild_Second_Ordinal, Child::SecondRequest::Type, |
| methods::ChildDispatchSecond}, |
| }; |
| |
| } // namespace entries |
| |
| ::fidl::DispatchResult Child::TryDispatch(TypedChannelInterface* impl, |
| fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) { |
| return ::fidl::internal::TryDispatch( |
| impl, msg, txn, entries::Child, |
| entries::Child + |
| sizeof(entries::Child) / sizeof(::fidl::internal::MethodEntry)); |
| } |
| |
| ::fidl::DispatchResult Child::Dispatch(TypedChannelInterface* impl, |
| fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) { |
| ::fidl::DispatchResult dispatch_result = TryDispatch(impl, msg, txn); |
| if (dispatch_result == ::fidl::DispatchResult::kNotFound) { |
| FidlHandleInfoCloseMany(msg->handles, msg->num_handles); |
| txn->InternalError( |
| {::fidl::UnbindInfo::kUnexpectedMessage, ZX_ERR_NOT_SUPPORTED}); |
| } |
| return dispatch_result; |
| } |
| |
| ::fidl::DispatchResult Child::TypedChannelInterface::dispatch_message( |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn) { |
| return Child::Dispatch(this, msg, txn); |
| } |
| |
| void Child::FirstRequest::_InitHeader(zx_txid_t _txid) { |
| fidl_init_txn_header(&_hdr, _txid, kChild_First_Ordinal); |
| } |
| |
| void Child::FirstRequest::_CloseHandles() { request.reset(); } |
| |
| void Child::SecondRequest::_InitHeader(zx_txid_t _txid) { |
| fidl_init_txn_header(&_hdr, _txid, kChild_Second_Ordinal); |
| } |
| |
| void Child::SecondRequest::_CloseHandles() { request.reset(); } |
| |
| } // namespace inheritancewithrecursivedecl |
| } // namespace test |
| } // namespace fidl |
| } // namespace llcpp |