blob: 3ffd3cfd5e330d73f647503fe1bf41f6d1b42678 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#include <fidl/fidl.test.emptystruct/cpp/wire_messaging.h>
#include <memory>
namespace fidl_test_emptystruct {
[[maybe_unused]] constexpr uint64_t kEmptyProtocol_Send_Ordinal =
2183815705502904104lu;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendRequestMessageTable;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendResponseMessageTable;
[[maybe_unused]] constexpr uint64_t kEmptyProtocol_Receive_Ordinal =
5025214662316626400lu;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolReceiveRequestMessageTable;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolReceiveEventMessageTable;
[[maybe_unused]] constexpr uint64_t kEmptyProtocol_SendAndReceive_Ordinal =
6253929606062814577lu;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendAndReceiveRequestMessageTable;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendAndReceiveResponseMessageTable;
#ifdef __Fuchsia__
} // namespace fidl_test_emptystruct
::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send>::WireResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> client,
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>*
request) {
FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>>
request_message(::fidl::internal::AllowUnownedInputRef{}, request);
auto& outgoing = request_message.GetOutgoingMessage();
outgoing.Write(client.channel());
SetResult(outgoing);
}
namespace fidl_test_emptystruct {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_emptystruct
::fidl::WireUnownedResult<::fidl_test_emptystruct::EmptyProtocol::Send>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>
client_end,
::fidl::internal::AnyBufferAllocator& allocator,
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>*
request) {
constexpr uint32_t buffer_size = ::fidl::SyncClientMethodBufferSizeInChannel<
::fidl_test_emptystruct::EmptyProtocol::Send>();
uint8_t* buffer = allocator.Allocate(buffer_size);
if (!buffer) {
::fidl::Result::operator=(::fidl::Result::EncodeError(
ZX_ERR_BUFFER_TOO_SMALL,
::fidl::internal::kCallerAllocatedBufferTooSmall));
return;
}
uint32_t request_byte_capacity = buffer_size;
uint8_t* request_bytes = buffer;
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>>
request_message(request_bytes, request_byte_capacity, request);
auto& outgoing = request_message.GetOutgoingMessage();
outgoing.Write(client_end.channel());
::fidl::Result::operator=(outgoing);
}
namespace fidl_test_emptystruct {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_emptystruct
::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::
WireResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> client,
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* request) {
FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
request_message(::fidl::internal::AllowUnownedInputRef{}, request);
auto& outgoing = request_message.GetOutgoingMessage();
outgoing.Call<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>(
client.channel(), bytes_.data(), static_cast<uint32_t>(bytes_.size()));
SetResult(outgoing);
}
::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::
WireResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> client,
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* request,
zx_time_t deadline) {
FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
request_message(::fidl::internal::AllowUnownedInputRef{}, request);
auto& outgoing = request_message.GetOutgoingMessage();
outgoing.Call<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>(
client.channel(), bytes_.data(), static_cast<uint32_t>(bytes_.size()),
fidl::CallOptions{.deadline = deadline});
SetResult(outgoing);
}
namespace fidl_test_emptystruct {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_emptystruct
::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>
client_end,
::fidl::internal::AnyBufferAllocator& allocator,
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* request) {
constexpr uint32_t buffer_size = ::fidl::SyncClientMethodBufferSizeInChannel<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>();
uint8_t* buffer = allocator.Allocate(buffer_size);
if (!buffer) {
::fidl::Result::operator=(::fidl::Result::EncodeError(
ZX_ERR_BUFFER_TOO_SMALL,
::fidl::internal::kCallerAllocatedBufferTooSmall));
return;
}
constexpr uint32_t request_byte_capacity = ::fidl::MaxSizeInChannel<
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>,
::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::UnownedEncodedMessage<::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
request_message(request_bytes, request_byte_capacity, request);
auto& outgoing = request_message.GetOutgoingMessage();
outgoing.Call<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>(
client_end.channel(), response_bytes, response_byte_capacity);
bytes_ = response_bytes;
::fidl::Result::operator=(outgoing);
}
namespace fidl_test_emptystruct {
#endif // __Fuchsia__
} // namespace fidl_test_emptystruct
#ifdef __Fuchsia__
::fidl::WireResponseContext<::fidl_test_emptystruct::EmptyProtocol::
SendAndReceive>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_emptystruct::kEmptyProtocol_SendAndReceive_Ordinal) {}
::cpp17::optional<::fidl::UnbindInfo> fidl::WireResponseContext<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::
OnRawResult(::fidl::IncomingMessage&& msg,
const internal::IncomingTransportContext* transport_context) {
if (unlikely(!msg.ok())) {
::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
result{msg.error()};
OnResult(result);
return cpp17::nullopt;
}
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
decoded{std::move(msg)};
::fidl::Result maybe_error = decoded;
::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
result{std::move(decoded)};
OnResult(result);
if (unlikely(!maybe_error.ok())) {
return ::fidl::UnbindInfo(maybe_error);
}
return cpp17::nullopt;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>::Send(
const ::fidl_test_emptystruct::wire::Empty& e) {
FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>
_request_object{e};
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>>
_request_message(::fidl::internal::AllowUnownedInputRef{},
&_request_object);
return ::fidl::internal::ClientBase::SendOneWay(
_request_message.GetOutgoingMessage());
}
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>::Send(
::fidl::BufferSpan _buffer_span,
const ::fidl_test_emptystruct::wire::Empty& e) {
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>
_request_object{e};
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>>
_request_message(_buffer_span.data, _buffer_span.capacity,
&_request_object);
return ::fidl::internal::ClientBase::SendOneWay(
_request_message.GetOutgoingMessage());
}
void fidl::internal::WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>::
SendAndReceive(const ::fidl_test_emptystruct::wire::Empty& e,
::fidl::WireClientCallback<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_cb) {
using Callback = decltype(_cb);
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive> {
public:
ResponseContext(Callback cb) : cb_(std::move(cb)) {}
void OnResult(::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
result) override {
cb_(result);
delete this;
}
private:
Callback cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_request{e};
FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
_request_message(::fidl::internal::AllowUnownedInputRef{}, &_request);
::fidl::internal::ClientBase::SendTwoWay(
_request_message.GetOutgoingMessage(), _context);
}
void fidl::internal::WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>::
SendAndReceive(
const ::fidl_test_emptystruct::wire::Empty& e,
::fit::callback<
void(::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::
SendAndReceive>* response)>
_cb) {
using Callback = decltype(_cb);
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive> {
public:
ResponseContext(Callback cb) : cb_(std::move(cb)) {}
void OnResult(::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
result) override {
if (result.ok()) {
::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* response =
result.Unwrap();
cb_(response);
}
delete this;
}
private:
Callback cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_request{e};
FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
_request_message(::fidl::internal::AllowUnownedInputRef{}, &_request);
::fidl::internal::ClientBase::SendTwoWay(
_request_message.GetOutgoingMessage(), _context);
}
void fidl::internal::WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>::
SendAndReceive(
::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e,
::fidl::WireResponseContext<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* _context) {
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_request{e};
::fidl::UnownedEncodedMessage<::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
_request_message(_request_buffer.data, _request_buffer.capacity,
&_request);
::fidl::internal::ClientBase::SendTwoWay(
_request_message.GetOutgoingMessage(), _context);
}
::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
fidl::internal::WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>::
SendAndReceive_Sync(const ::fidl_test_emptystruct::wire::Empty& e) {
return ::fidl::internal::ClientBase::MakeSyncCallWith(
[&](std::shared_ptr<::fidl::internal::AnyTransport> _transport) {
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_request{e};
return ::fidl::WireResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>(
_transport->get<fidl::internal::ChannelTransport>()),
&_request);
});
}
::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
fidl::internal::WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>::
SendAndReceive_Sync(::fidl::BufferSpan _buffer_span,
const ::fidl_test_emptystruct::wire::Empty& e) {
auto _allocator = ::fidl::internal::MakeAnyBufferAllocator(_buffer_span);
return ::fidl::internal::ClientBase::MakeSyncCallWith(
[&](std::shared_ptr<::fidl::internal::AnyTransport> _transport) {
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_request{e};
return ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>(
_transport->get<fidl::internal::ChannelTransport>()),
_allocator, &_request);
});
}
std::optional<::fidl::UnbindInfo> fidl::internal::
WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>::DispatchEvent(
fidl::IncomingMessage& msg,
::fidl::internal::AsyncEventHandler* maybe_event_handler,
const internal::IncomingTransportContext* transport_context) {
auto* event_handler = static_cast<
::fidl::WireAsyncEventHandler<::fidl_test_emptystruct::EmptyProtocol>*>(
maybe_event_handler);
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_emptystruct::kEmptyProtocol_Receive_Ordinal: {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>>
decoded{std::move(msg)};
if (!decoded.ok()) {
return ::fidl::UnbindInfo{decoded};
}
if (event_handler) {
event_handler->Receive(decoded.PrimaryObject());
}
return std::nullopt;
}
default:
break;
}
return ::fidl::UnbindInfo::UnknownOrdinal();
}
#endif // __Fuchsia__
::fidl::Result
fidl::WireSyncEventHandler<::fidl_test_emptystruct::EmptyProtocol>::
HandleOneEvent(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>
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::Result::TransportError(
status, ::fidl::internal::kErrorWaitOneFailed);
}
constexpr uint32_t kHandleAllocSize = ([]() constexpr {
uint32_t x = 0;
if (::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>::MaxNumHandles >=
x) {
x = ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>::MaxNumHandles;
}
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<24> 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::Result::UnexpectedMessage(Unknown());
}
if (!msg.ok()) {
return msg;
}
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_emptystruct::kEmptyProtocol_Receive_Ordinal: {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>>
decoded{::std::move(msg)};
if (!decoded.ok()) {
return ::fidl::Result(decoded);
}
Receive(decoded.PrimaryObject());
return ::fidl::Result::Ok();
}
default: {
return ::fidl::Result::UnexpectedMessage(Unknown());
}
}
}
#ifdef __Fuchsia__
constexpr ::fidl::internal::MethodEntry fidl::internal::WireServerDispatcher<
::fidl_test_emptystruct::EmptyProtocol>::entries_[] = {
{
::fidl_test_emptystruct::kEmptyProtocol_Send_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::internal::WireCompleter<
::fidl_test_emptystruct::EmptyProtocol::Send>::Sync
completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>*>(
interface)
->Send(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_emptystruct::kEmptyProtocol_SendAndReceive_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::internal::WireCompleter<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::Sync
completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>*>(
interface)
->SendAndReceive(primary, completer);
return ZX_OK;
},
},
};
const ::fidl::internal::MethodEntry* fidl::internal::WireServerDispatcher<
::fidl_test_emptystruct::EmptyProtocol>::entries_end_ = &entries_[2];
::fidl::DispatchResult fidl::internal::
WireServerDispatcher<::fidl_test_emptystruct::EmptyProtocol>::TryDispatch(
::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>* impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn) {
return ::fidl::internal::TryDispatch(impl, msg, txn, entries_, entries_end_);
}
void fidl::internal::
WireServerDispatcher<::fidl_test_emptystruct::EmptyProtocol>::Dispatch(
::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>* impl,
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
::fidl::internal::Dispatch(impl, msg, txn, entries_, entries_end_);
}
void fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>::dispatch_message(
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn,
const ::fidl::internal::IncomingTransportContext* transport_context) {
::fidl::internal::WireServerDispatcher<
::fidl_test_emptystruct::EmptyProtocol>::Dispatch(this, std::move(msg),
txn);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireCompleterBase<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::
Reply(const ::fidl_test_emptystruct::wire::Empty& e) {
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_response{e};
FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
_response_message{::fidl::internal::AllowUnownedInputRef{}, &_response};
return ::fidl::internal::WireCompleterBase<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::
SendReply(&_response_message.GetOutgoingMessage());
}
::fidl::Result fidl::internal::WireCompleterBase<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::
Reply(::fidl::BufferSpan _buffer,
const ::fidl_test_emptystruct::wire::Empty& e) {
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_response{e};
::fidl::UnownedEncodedMessage<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
_response_message(_buffer.data, _buffer.capacity, &_response);
return CompleterBase::SendReply(&_response_message.GetOutgoingMessage());
}
#endif // __Fuchsia__
void ::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::Send>::_InitHeader() {
fidl_init_txn_header(&_hdr, 0,
::fidl_test_emptystruct::kEmptyProtocol_Send_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>::_InitHeader() {
fidl_init_txn_header(&_hdr, 0,
::fidl_test_emptystruct::kEmptyProtocol_Receive_Ordinal);
}
void ::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0, ::fidl_test_emptystruct::kEmptyProtocol_SendAndReceive_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0, ::fidl_test_emptystruct::kEmptyProtocol_SendAndReceive_Ordinal);
}
#ifdef __Fuchsia__
fidl::Result
fidl::WireEventSender<::fidl_test_emptystruct::EmptyProtocol>::Receive(
const ::fidl_test_emptystruct::wire::Empty& e) const {
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>
_response{e};
FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT
::fidl::OwnedEncodedMessage<
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>>
_response_message{::fidl::internal::AllowUnownedInputRef{}, &_response};
auto& _message = _response_message.GetOutgoingMessage();
_message.Write(server_end_.channel());
return ::fidl::Result{_message};
}
fidl::Result
fidl::WireEventSender<::fidl_test_emptystruct::EmptyProtocol>::Receive(
::fidl::BufferSpan _buffer,
const ::fidl_test_emptystruct::wire::Empty& e) const {
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>
_response{e};
::fidl::UnownedEncodedMessage<
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>>
_response_message(_buffer.data, _buffer.capacity, &_response);
auto& _message = _response_message.GetOutgoingMessage();
_message.Write(server_end_.channel());
return ::fidl::Result{_message};
}
fidl::Result fidl::internal::
WireWeakEventSender<::fidl_test_emptystruct::EmptyProtocol>::Receive(
const ::fidl_test_emptystruct::wire::Empty& e) const {
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>
_response{e};
FIDL_INTERNAL_DISABLE_AUTO_VAR_INIT
::fidl::OwnedEncodedMessage<
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>>
_response_message{::fidl::internal::AllowUnownedInputRef{}, &_response};
return inner_.SendEvent(_response_message.GetOutgoingMessage());
}
fidl::Result fidl::internal::
WireWeakEventSender<::fidl_test_emptystruct::EmptyProtocol>::Receive(
::fidl::BufferSpan _buffer,
const ::fidl_test_emptystruct::wire::Empty& e) const {
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>
_response{e};
::fidl::UnownedEncodedMessage<
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>>
_response_message(_buffer.data, _buffer.capacity, &_response);
return inner_.SendEvent(_response_message.GetOutgoingMessage());
}
#endif // __Fuchsia__