| // WARNING: This file is machine generated by fidlgen. |
| |
| #include <fidl/test/service/llcpp/fidl.h> |
| |
| #include <memory> |
| |
| namespace llcpp { |
| namespace fidl { |
| namespace test { |
| namespace service { |
| namespace { |
| |
| [[maybe_unused]] constexpr uint64_t kSecondProtocol_MethodOnSecond_Ordinal = |
| 6118813307380259369lu; |
| |
| extern "C" const fidl_type_t |
| fidl_test_service_SecondProtocolMethodOnSecondRequestTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_service_SecondProtocolMethodOnSecondResponseTable; |
| |
| } // namespace |
| #ifdef __Fuchsia__ |
| ::llcpp::fidl::test::service::SecondProtocol::ResultOf::MethodOnSecond:: |
| MethodOnSecond( |
| ::fidl::UnownedClientEnd<::llcpp::fidl::test::service::SecondProtocol> |
| _client) { |
| ::fidl::internal::EncodedMessageTypes<MethodOnSecondRequest>::OwnedByte |
| _request(zx_txid_t(0)); |
| _request.GetOutgoingMessage().Write(_client); |
| status_ = _request.status(); |
| error_ = _request.error(); |
| } |
| #endif |
| |
| #ifdef __Fuchsia__ |
| ::fidl::Result SecondProtocol::ClientImpl::MethodOnSecond() { |
| if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) { |
| auto _res = ResultOf::MethodOnSecond( |
| ::fidl::UnownedClientEnd<::llcpp::fidl::test::service::SecondProtocol>( |
| _channel->handle())); |
| return ::fidl::Result(_res.status(), _res.error()); |
| } |
| return ::fidl::Result(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound); |
| } |
| #endif |
| |
| #ifdef __Fuchsia__ |
| std::optional<::fidl::UnbindInfo> SecondProtocol::ClientImpl::DispatchEvent( |
| fidl_incoming_msg_t* msg) { |
| FidlHandleInfoCloseMany(msg->handles, msg->num_handles); |
| return ::fidl::UnbindInfo{::fidl::UnbindInfo::kUnexpectedMessage, |
| ZX_ERR_NOT_SUPPORTED}; |
| } |
| #endif |
| |
| #ifdef __Fuchsia__ |
| namespace methods { |
| |
| void SecondProtocolDispatchMethodOnSecond(void* interface, void* bytes, |
| ::fidl::Transaction* txn) { |
| ::llcpp::fidl::test::service::SecondProtocol::Interface:: |
| MethodOnSecondCompleter::Sync completer(txn); |
| reinterpret_cast<::llcpp::fidl::test::service::SecondProtocol::Interface*>( |
| interface) |
| ->MethodOnSecond(completer); |
| } |
| |
| } // namespace methods |
| |
| namespace entries { |
| |
| ::fidl::internal::MethodEntry SecondProtocol[] = { |
| {kSecondProtocol_MethodOnSecond_Ordinal, |
| ::llcpp::fidl::test::service::SecondProtocol::MethodOnSecondRequest::Type, |
| methods::SecondProtocolDispatchMethodOnSecond}, |
| }; |
| |
| } // namespace entries |
| |
| ::fidl::DispatchResult SecondProtocol::TryDispatch(Interface* impl, |
| fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) { |
| return ::fidl::internal::TryDispatch( |
| impl, msg, txn, entries::SecondProtocol, |
| entries::SecondProtocol + sizeof(entries::SecondProtocol) / |
| sizeof(::fidl::internal::MethodEntry)); |
| } |
| #endif |
| |
| #ifdef __Fuchsia__ |
| ::fidl::DispatchResult SecondProtocol::Dispatch(Interface* 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 SecondProtocol::Interface::dispatch_message( |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn) { |
| return SecondProtocol::Dispatch(this, msg, txn); |
| } |
| #endif |
| |
| void ::llcpp::fidl::test::service::SecondProtocol::MethodOnSecondRequest:: |
| _InitHeader(zx_txid_t _txid) { |
| fidl_init_txn_header(&_hdr, _txid, kSecondProtocol_MethodOnSecond_Ordinal); |
| } |
| |
| #ifdef __Fuchsia__ |
| #endif |
| |
| namespace { |
| |
| [[maybe_unused]] constexpr uint64_t kFirstProtocol_MethodOnFirst_Ordinal = |
| 6590661047173168036lu; |
| |
| extern "C" const fidl_type_t |
| fidl_test_service_FirstProtocolMethodOnFirstRequestTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_service_FirstProtocolMethodOnFirstResponseTable; |
| |
| } // namespace |
| #ifdef __Fuchsia__ |
| ::llcpp::fidl::test::service::FirstProtocol::ResultOf::MethodOnFirst:: |
| MethodOnFirst( |
| ::fidl::UnownedClientEnd<::llcpp::fidl::test::service::FirstProtocol> |
| _client) { |
| ::fidl::internal::EncodedMessageTypes<MethodOnFirstRequest>::OwnedByte |
| _request(zx_txid_t(0)); |
| _request.GetOutgoingMessage().Write(_client); |
| status_ = _request.status(); |
| error_ = _request.error(); |
| } |
| #endif |
| |
| #ifdef __Fuchsia__ |
| ::fidl::Result FirstProtocol::ClientImpl::MethodOnFirst() { |
| if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) { |
| auto _res = ResultOf::MethodOnFirst( |
| ::fidl::UnownedClientEnd<::llcpp::fidl::test::service::FirstProtocol>( |
| _channel->handle())); |
| return ::fidl::Result(_res.status(), _res.error()); |
| } |
| return ::fidl::Result(ZX_ERR_CANCELED, ::fidl::kErrorChannelUnbound); |
| } |
| #endif |
| |
| #ifdef __Fuchsia__ |
| std::optional<::fidl::UnbindInfo> FirstProtocol::ClientImpl::DispatchEvent( |
| fidl_incoming_msg_t* msg) { |
| FidlHandleInfoCloseMany(msg->handles, msg->num_handles); |
| return ::fidl::UnbindInfo{::fidl::UnbindInfo::kUnexpectedMessage, |
| ZX_ERR_NOT_SUPPORTED}; |
| } |
| #endif |
| |
| #ifdef __Fuchsia__ |
| namespace methods { |
| |
| void FirstProtocolDispatchMethodOnFirst(void* interface, void* bytes, |
| ::fidl::Transaction* txn) { |
| ::llcpp::fidl::test::service::FirstProtocol::Interface:: |
| MethodOnFirstCompleter::Sync completer(txn); |
| reinterpret_cast<::llcpp::fidl::test::service::FirstProtocol::Interface*>( |
| interface) |
| ->MethodOnFirst(completer); |
| } |
| |
| } // namespace methods |
| |
| namespace entries { |
| |
| ::fidl::internal::MethodEntry FirstProtocol[] = { |
| {kFirstProtocol_MethodOnFirst_Ordinal, |
| ::llcpp::fidl::test::service::FirstProtocol::MethodOnFirstRequest::Type, |
| methods::FirstProtocolDispatchMethodOnFirst}, |
| }; |
| |
| } // namespace entries |
| |
| ::fidl::DispatchResult FirstProtocol::TryDispatch(Interface* impl, |
| fidl_incoming_msg_t* msg, |
| ::fidl::Transaction* txn) { |
| return ::fidl::internal::TryDispatch( |
| impl, msg, txn, entries::FirstProtocol, |
| entries::FirstProtocol + sizeof(entries::FirstProtocol) / |
| sizeof(::fidl::internal::MethodEntry)); |
| } |
| #endif |
| |
| #ifdef __Fuchsia__ |
| ::fidl::DispatchResult FirstProtocol::Dispatch(Interface* 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 FirstProtocol::Interface::dispatch_message( |
| fidl_incoming_msg_t* msg, ::fidl::Transaction* txn) { |
| return FirstProtocol::Dispatch(this, msg, txn); |
| } |
| #endif |
| |
| void ::llcpp::fidl::test::service::FirstProtocol::MethodOnFirstRequest:: |
| _InitHeader(zx_txid_t _txid) { |
| fidl_init_txn_header(&_hdr, _txid, kFirstProtocol_MethodOnFirst_Ordinal); |
| } |
| |
| #ifdef __Fuchsia__ |
| #endif |
| |
| } // namespace service |
| } // namespace test |
| } // namespace fidl |
| } // namespace llcpp |