blob: fdb3e5e072a35770f18b7c4c8fccca617b05506d [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <lib/fidl/internal.h>
#include <lib/fidl/llcpp/array.h>
#include <lib/fidl/llcpp/coding.h>
#include <lib/fidl/llcpp/envelope.h>
#include <lib/fidl/llcpp/errors.h>
#include <lib/fidl/llcpp/message.h>
#include <lib/fidl/llcpp/message_storage.h>
#include <lib/fidl/llcpp/object_view.h>
#include <lib/fidl/llcpp/string_view.h>
#include <lib/fidl/llcpp/traits.h>
#include <lib/fidl/llcpp/vector_view.h>
#include <lib/fit/function.h>
#include <lib/stdcompat/optional.h>
#include <algorithm>
#include <cstddef>
#include <variant>
#ifdef __Fuchsia__
#include <lib/fidl/llcpp/client.h>
#include <lib/fidl/llcpp/client_end.h>
#include <lib/fidl/llcpp/connect_service.h>
#include <lib/fidl/llcpp/result.h>
#include <lib/fidl/llcpp/server.h>
#include <lib/fidl/llcpp/server_end.h>
#include <lib/fidl/llcpp/service_handler_interface.h>
#include <lib/fidl/llcpp/sync_call.h>
#include <lib/fidl/llcpp/transaction.h>
#include <lib/fidl/llcpp/wire_messaging.h>
#include <lib/fidl/txn_header.h>
#include <lib/zx/channel.h>
#endif // __Fuchsia__
#include <zircon/fidl.h>
namespace fidl_test_emptystruct {
namespace wire {
struct Empty;
} // namespace wire
class EmptyProtocol;
namespace wire {
extern "C" const fidl_type_t fidl_test_emptystruct_EmptyTable;
struct Empty {
static constexpr const fidl_type_t* Type = &fidl_test_emptystruct_EmptyTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 1;
[[maybe_unused]] static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasPointer = false;
uint8_t __reserved = {};
class UnownedEncodedMessage final {
public:
UnownedEncodedMessage(uint8_t* backing_buffer, uint32_t backing_buffer_size,
Empty* value)
: message_(::fidl::OutgoingMessage::ConstructorArgs{
.iovecs = iovecs_,
.iovec_capacity = ::fidl::internal::IovecBufferSize,
.backing_buffer = backing_buffer,
.backing_buffer_capacity = backing_buffer_size,
}) {
if (backing_buffer_size < sizeof(Empty)) {
::fidl::internal::OutgoingMessageResultSetter::SetResult(
message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr);
return;
}
message_.Encode<Empty>(value);
}
UnownedEncodedMessage(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage(UnownedEncodedMessage&&) = delete;
UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; }
private:
::fidl::internal::IovecBuffer iovecs_;
::fidl::OutgoingMessage message_;
};
class OwnedEncodedMessage final {
public:
explicit OwnedEncodedMessage(Empty* value)
: message_(backing_buffer_.data(), backing_buffer_.size(), value) {}
OwnedEncodedMessage(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage(OwnedEncodedMessage&&) = delete;
OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
private:
::fidl::internal::InlineMessageBuffer<8> backing_buffer_;
UnownedEncodedMessage message_;
};
class DecodedMessage final : public ::fidl::internal::IncomingMessage {
public:
DecodedMessage(uint8_t* bytes, uint32_t byte_actual,
zx_handle_info_t* handles = nullptr,
uint32_t handle_actual = 0)
: ::fidl::internal::IncomingMessage(bytes, byte_actual, handles,
handle_actual) {
Decode<struct Empty>();
}
DecodedMessage(fidl_incoming_msg_t* msg)
: ::fidl::internal::IncomingMessage(msg) {
Decode<struct Empty>();
}
DecodedMessage(const DecodedMessage&) = delete;
DecodedMessage(DecodedMessage&&) = delete;
DecodedMessage* operator=(const DecodedMessage&) = delete;
DecodedMessage* operator=(DecodedMessage&&) = delete;
struct Empty* PrimaryObject() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<struct Empty*>(bytes());
}
// Release the ownership of the decoded message. That means that the handles
// won't be closed When the object is destroyed. After calling this method,
// the DecodedMessage object should not be used anymore.
void ReleasePrimaryObject() { ResetBytes(); }
};
};
} // namespace wire
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendRequestTable;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendResponseTable;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolReceiveRequestTable;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolReceiveEventTable;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendAndReceiveRequestTable;
extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendAndReceiveResponseTable;
class EmptyProtocol final {
EmptyProtocol() = delete;
public:
class Send final {
Send() = delete;
};
class Receive final {
Receive() = delete;
};
class SendAndReceive final {
SendAndReceive() = delete;
};
};
} // namespace fidl_test_emptystruct
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::ProtocolDetails<
::fidl_test_emptystruct::EmptyProtocol> {};
#endif // __Fuchsia__
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::WireDispatcher<::fidl_test_emptystruct::EmptyProtocol>
final {
WireDispatcher() = delete;
static ::fidl::DispatchResult TryDispatch(
::fidl::WireInterface<::fidl_test_emptystruct::EmptyProtocol>* impl,
fidl_incoming_msg_t* msg, ::fidl::Transaction* txn);
static ::fidl::DispatchResult Dispatch(
::fidl::WireInterface<::fidl_test_emptystruct::EmptyProtocol>* impl,
fidl_incoming_msg_t* msg, ::fidl::Transaction* txn);
};
template <>
struct ::fidl::internal::WireServerDispatcher<
::fidl_test_emptystruct::EmptyProtocol>
final {
WireServerDispatcher() = delete;
static ::fidl::DispatchResult TryDispatch(
::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>* impl,
fidl_incoming_msg_t* msg, ::fidl::Transaction* txn);
static ::fidl::DispatchResult Dispatch(
::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>* impl,
fidl_incoming_msg_t* msg, ::fidl::Transaction* txn);
};
#endif // __Fuchsia__
template <>
struct ::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send> final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl_test_emptystruct::wire::Empty e;
explicit WireRequest(zx_txid_t _txid,
const ::fidl_test_emptystruct::wire::Empty& e)
: e(e) {
_InitHeader(_txid);
}
explicit WireRequest(zx_txid_t _txid) { _InitHeader(_txid); }
static constexpr const fidl_type_t* Type =
&::fidl_test_emptystruct::
fidl_test_emptystruct_EmptyProtocolSendRequestTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr uint32_t AltPrimarySize = 24;
static constexpr uint32_t AltMaxOutOfLine = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
class UnownedEncodedMessage final {
public:
UnownedEncodedMessage(uint8_t* _backing_buffer,
uint32_t _backing_buffer_size, zx_txid_t _txid,
const ::fidl_test_emptystruct::wire::Empty& e)
: message_(::fidl::OutgoingMessage::ConstructorArgs{
.iovecs = iovecs_,
.iovec_capacity = ::fidl::internal::IovecBufferSize,
.backing_buffer = _backing_buffer,
.backing_buffer_capacity = _backing_buffer_size,
}) {
if (_backing_buffer_size < sizeof(WireRequest)) {
::fidl::internal::OutgoingMessageResultSetter::SetResult(
message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr);
return;
}
FIDL_ALIGNDECL WireRequest _request(_txid, e);
message_.Encode<WireRequest>(&_request);
}
UnownedEncodedMessage(uint8_t* _backing_buffer,
uint32_t _backing_buffer_size, WireRequest* request)
: message_(::fidl::OutgoingMessage::ConstructorArgs{
.iovecs = iovecs_,
.iovec_capacity = ::fidl::internal::IovecBufferSize,
.backing_buffer = _backing_buffer,
.backing_buffer_capacity = _backing_buffer_size,
}) {
if (_backing_buffer_size < sizeof(WireRequest)) {
::fidl::internal::OutgoingMessageResultSetter::SetResult(
message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr);
return;
}
message_.Encode<WireRequest>(request);
}
UnownedEncodedMessage(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage(UnownedEncodedMessage&&) = delete;
UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif // __Fuchsia__
private:
::fidl::internal::IovecBuffer iovecs_;
::fidl::OutgoingMessage message_;
};
class OwnedEncodedMessage final {
public:
explicit OwnedEncodedMessage(zx_txid_t _txid,
const ::fidl_test_emptystruct::wire::Empty& e)
: message_(backing_buffer_.data(), backing_buffer_.size(), _txid, e) {}
explicit OwnedEncodedMessage(WireRequest* request)
: message_(backing_buffer_.data(), backing_buffer_.size(), request) {}
OwnedEncodedMessage(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage(OwnedEncodedMessage&&) = delete;
OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif // __Fuchsia__
private:
::fidl::internal::InlineMessageBuffer<24> backing_buffer_;
UnownedEncodedMessage message_;
};
public:
class DecodedMessage final : public ::fidl::internal::IncomingMessage {
public:
DecodedMessage(uint8_t* bytes, uint32_t byte_actual,
zx_handle_info_t* handles = nullptr,
uint32_t handle_actual = 0)
: ::fidl::internal::IncomingMessage(bytes, byte_actual, handles,
handle_actual) {
Decode<WireRequest>();
}
DecodedMessage(fidl_incoming_msg_t* msg)
: ::fidl::internal::IncomingMessage(msg) {
Decode<WireRequest>();
}
DecodedMessage(const DecodedMessage&) = delete;
DecodedMessage(DecodedMessage&&) = delete;
DecodedMessage* operator=(const DecodedMessage&) = delete;
DecodedMessage* operator=(DecodedMessage&&) = delete;
WireRequest* PrimaryObject() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<WireRequest*>(bytes());
}
// Release the ownership of the decoded message. That means that the handles
// won't be closed When the object is destroyed. After calling this method,
// the DecodedMessage object should not be used anymore.
void ReleasePrimaryObject() { ResetBytes(); }
};
private:
void _InitHeader(zx_txid_t _txid);
};
template <>
struct ::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>
final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl_test_emptystruct::wire::Empty e;
explicit WireResponse(const ::fidl_test_emptystruct::wire::Empty& e) : e(e) {
_InitHeader();
}
WireResponse() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl_test_emptystruct::
fidl_test_emptystruct_EmptyProtocolReceiveEventTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
class UnownedEncodedMessage final {
public:
UnownedEncodedMessage(uint8_t* _backing_buffer,
uint32_t _backing_buffer_size,
const ::fidl_test_emptystruct::wire::Empty& e)
: message_(::fidl::OutgoingMessage::ConstructorArgs{
.iovecs = iovecs_,
.iovec_capacity = ::fidl::internal::IovecBufferSize,
.backing_buffer = _backing_buffer,
.backing_buffer_capacity = _backing_buffer_size,
}) {
FIDL_ALIGNDECL WireResponse _response{e};
if (_backing_buffer_size < sizeof(WireResponse)) {
::fidl::internal::OutgoingMessageResultSetter::SetResult(
message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr);
return;
}
message_.Encode<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>>(&_response);
}
UnownedEncodedMessage(uint8_t* _backing_buffer,
uint32_t _backing_buffer_size, WireResponse* response)
: message_(::fidl::OutgoingMessage::ConstructorArgs{
.iovecs = iovecs_,
.iovec_capacity = ::fidl::internal::IovecBufferSize,
.backing_buffer = _backing_buffer,
.backing_buffer_capacity = _backing_buffer_size,
}) {
if (_backing_buffer_size < sizeof(WireResponse)) {
::fidl::internal::OutgoingMessageResultSetter::SetResult(
message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr);
return;
}
message_.Encode<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>>(response);
}
UnownedEncodedMessage(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage(UnownedEncodedMessage&&) = delete;
UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif // __Fuchsia__
private:
::fidl::internal::IovecBuffer iovecs_;
::fidl::OutgoingMessage message_;
};
class OwnedEncodedMessage final {
public:
explicit OwnedEncodedMessage(const ::fidl_test_emptystruct::wire::Empty& e)
: message_(backing_buffer_.data(), backing_buffer_.size(), e) {}
explicit OwnedEncodedMessage(
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>*
response)
: message_(backing_buffer_.data(), backing_buffer_.size(), response) {}
OwnedEncodedMessage(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage(OwnedEncodedMessage&&) = delete;
OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif // __Fuchsia__
private:
::fidl::internal::InlineMessageBuffer<24> backing_buffer_;
UnownedEncodedMessage message_;
};
public:
class DecodedMessage final : public ::fidl::internal::IncomingMessage {
public:
DecodedMessage(uint8_t* bytes, uint32_t byte_actual,
zx_handle_info_t* handles = nullptr,
uint32_t handle_actual = 0)
: ::fidl::internal::IncomingMessage(bytes, byte_actual, handles,
handle_actual) {
Decode<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>>();
}
DecodedMessage(fidl_incoming_msg_t* msg)
: ::fidl::internal::IncomingMessage(msg) {
Decode<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>>();
}
DecodedMessage(const DecodedMessage&) = delete;
DecodedMessage(DecodedMessage&&) = delete;
DecodedMessage* operator=(const DecodedMessage&) = delete;
DecodedMessage* operator=(DecodedMessage&&) = delete;
WireResponse* PrimaryObject() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>*>(bytes());
}
// Release the ownership of the decoded message. That means that the handles
// won't be closed When the object is destroyed. After calling this method,
// the DecodedMessage object should not be used anymore.
void ReleasePrimaryObject() { ResetBytes(); }
};
private:
void _InitHeader();
};
template <>
struct ::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl_test_emptystruct::wire::Empty e;
explicit WireRequest(zx_txid_t _txid,
const ::fidl_test_emptystruct::wire::Empty& e)
: e(e) {
_InitHeader(_txid);
}
explicit WireRequest(zx_txid_t _txid) { _InitHeader(_txid); }
static constexpr const fidl_type_t* Type =
&::fidl_test_emptystruct::
fidl_test_emptystruct_EmptyProtocolSendAndReceiveRequestTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr uint32_t AltPrimarySize = 24;
static constexpr uint32_t AltMaxOutOfLine = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
using ResponseType = ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>;
class UnownedEncodedMessage final {
public:
UnownedEncodedMessage(uint8_t* _backing_buffer,
uint32_t _backing_buffer_size, zx_txid_t _txid,
const ::fidl_test_emptystruct::wire::Empty& e)
: message_(::fidl::OutgoingMessage::ConstructorArgs{
.iovecs = iovecs_,
.iovec_capacity = ::fidl::internal::IovecBufferSize,
.backing_buffer = _backing_buffer,
.backing_buffer_capacity = _backing_buffer_size,
}) {
if (_backing_buffer_size < sizeof(WireRequest)) {
::fidl::internal::OutgoingMessageResultSetter::SetResult(
message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr);
return;
}
FIDL_ALIGNDECL WireRequest _request(_txid, e);
message_.Encode<WireRequest>(&_request);
}
UnownedEncodedMessage(uint8_t* _backing_buffer,
uint32_t _backing_buffer_size, WireRequest* request)
: message_(::fidl::OutgoingMessage::ConstructorArgs{
.iovecs = iovecs_,
.iovec_capacity = ::fidl::internal::IovecBufferSize,
.backing_buffer = _backing_buffer,
.backing_buffer_capacity = _backing_buffer_size,
}) {
if (_backing_buffer_size < sizeof(WireRequest)) {
::fidl::internal::OutgoingMessageResultSetter::SetResult(
message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr);
return;
}
message_.Encode<WireRequest>(request);
}
UnownedEncodedMessage(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage(UnownedEncodedMessage&&) = delete;
UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif // __Fuchsia__
private:
::fidl::internal::IovecBuffer iovecs_;
::fidl::OutgoingMessage message_;
};
class OwnedEncodedMessage final {
public:
explicit OwnedEncodedMessage(zx_txid_t _txid,
const ::fidl_test_emptystruct::wire::Empty& e)
: message_(backing_buffer_.data(), backing_buffer_.size(), _txid, e) {}
explicit OwnedEncodedMessage(WireRequest* request)
: message_(backing_buffer_.data(), backing_buffer_.size(), request) {}
OwnedEncodedMessage(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage(OwnedEncodedMessage&&) = delete;
OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif // __Fuchsia__
private:
::fidl::internal::InlineMessageBuffer<24> backing_buffer_;
UnownedEncodedMessage message_;
};
public:
class DecodedMessage final : public ::fidl::internal::IncomingMessage {
public:
DecodedMessage(uint8_t* bytes, uint32_t byte_actual,
zx_handle_info_t* handles = nullptr,
uint32_t handle_actual = 0)
: ::fidl::internal::IncomingMessage(bytes, byte_actual, handles,
handle_actual) {
Decode<WireRequest>();
}
DecodedMessage(fidl_incoming_msg_t* msg)
: ::fidl::internal::IncomingMessage(msg) {
Decode<WireRequest>();
}
DecodedMessage(const DecodedMessage&) = delete;
DecodedMessage(DecodedMessage&&) = delete;
DecodedMessage* operator=(const DecodedMessage&) = delete;
DecodedMessage* operator=(DecodedMessage&&) = delete;
WireRequest* PrimaryObject() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<WireRequest*>(bytes());
}
// Release the ownership of the decoded message. That means that the handles
// won't be closed When the object is destroyed. After calling this method,
// the DecodedMessage object should not be used anymore.
void ReleasePrimaryObject() { ResetBytes(); }
};
private:
void _InitHeader(zx_txid_t _txid);
};
template <>
struct ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl_test_emptystruct::wire::Empty e;
explicit WireResponse(const ::fidl_test_emptystruct::wire::Empty& e) : e(e) {
_InitHeader();
}
WireResponse() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl_test_emptystruct::
fidl_test_emptystruct_EmptyProtocolSendAndReceiveResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
class UnownedEncodedMessage final {
public:
UnownedEncodedMessage(uint8_t* _backing_buffer,
uint32_t _backing_buffer_size,
const ::fidl_test_emptystruct::wire::Empty& e)
: message_(::fidl::OutgoingMessage::ConstructorArgs{
.iovecs = iovecs_,
.iovec_capacity = ::fidl::internal::IovecBufferSize,
.backing_buffer = _backing_buffer,
.backing_buffer_capacity = _backing_buffer_size,
}) {
FIDL_ALIGNDECL WireResponse _response{e};
if (_backing_buffer_size < sizeof(WireResponse)) {
::fidl::internal::OutgoingMessageResultSetter::SetResult(
message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr);
return;
}
message_.Encode<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>(&_response);
}
UnownedEncodedMessage(uint8_t* _backing_buffer,
uint32_t _backing_buffer_size, WireResponse* response)
: message_(::fidl::OutgoingMessage::ConstructorArgs{
.iovecs = iovecs_,
.iovec_capacity = ::fidl::internal::IovecBufferSize,
.backing_buffer = _backing_buffer,
.backing_buffer_capacity = _backing_buffer_size,
}) {
if (_backing_buffer_size < sizeof(WireResponse)) {
::fidl::internal::OutgoingMessageResultSetter::SetResult(
message_, ZX_ERR_BUFFER_TOO_SMALL, nullptr);
return;
}
message_.Encode<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>(response);
}
UnownedEncodedMessage(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage(UnownedEncodedMessage&&) = delete;
UnownedEncodedMessage* operator=(const UnownedEncodedMessage&) = delete;
UnownedEncodedMessage* operator=(UnownedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif // __Fuchsia__
private:
::fidl::internal::IovecBuffer iovecs_;
::fidl::OutgoingMessage message_;
};
class OwnedEncodedMessage final {
public:
explicit OwnedEncodedMessage(const ::fidl_test_emptystruct::wire::Empty& e)
: message_(backing_buffer_.data(), backing_buffer_.size(), e) {}
explicit OwnedEncodedMessage(
::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* response)
: message_(backing_buffer_.data(), backing_buffer_.size(), response) {}
OwnedEncodedMessage(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage(OwnedEncodedMessage&&) = delete;
OwnedEncodedMessage* operator=(const OwnedEncodedMessage&) = delete;
OwnedEncodedMessage* operator=(OwnedEncodedMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif // __Fuchsia__
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif // __Fuchsia__
private:
::fidl::internal::InlineMessageBuffer<24> backing_buffer_;
UnownedEncodedMessage message_;
};
public:
class DecodedMessage final : public ::fidl::internal::IncomingMessage {
public:
DecodedMessage(uint8_t* bytes, uint32_t byte_actual,
zx_handle_info_t* handles = nullptr,
uint32_t handle_actual = 0)
: ::fidl::internal::IncomingMessage(bytes, byte_actual, handles,
handle_actual) {
Decode<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>();
}
DecodedMessage(fidl_incoming_msg_t* msg)
: ::fidl::internal::IncomingMessage(msg) {
Decode<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>();
}
DecodedMessage(const DecodedMessage&) = delete;
DecodedMessage(DecodedMessage&&) = delete;
DecodedMessage* operator=(const DecodedMessage&) = delete;
DecodedMessage* operator=(DecodedMessage&&) = delete;
WireResponse* PrimaryObject() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*>(bytes());
}
// Release the ownership of the decoded message. That means that the handles
// won't be closed When the object is destroyed. After calling this method,
// the DecodedMessage object should not be used anymore.
void ReleasePrimaryObject() { ResetBytes(); }
};
private:
void _InitHeader();
};
template <>
class ::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send> final
: public ::fidl::Result {
public:
explicit WireResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> _client,
const ::fidl_test_emptystruct::wire::Empty& e);
explicit WireResult(const ::fidl::Result& result) : ::fidl::Result(result) {}
WireResult(WireResult&&) = delete;
WireResult(const WireResult&) = delete;
WireResult* operator=(WireResult&&) = delete;
WireResult* operator=(const WireResult&) = delete;
~WireResult() = default;
private:
};
template <>
class ::fidl::WireUnownedResult<::fidl_test_emptystruct::EmptyProtocol::Send>
final : public ::fidl::Result {
public:
explicit WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> _client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
const ::fidl_test_emptystruct::wire::Empty& e);
explicit WireUnownedResult(const ::fidl::Result& result)
: ::fidl::Result(result) {}
WireUnownedResult(WireUnownedResult&&) = delete;
WireUnownedResult(const WireUnownedResult&) = delete;
WireUnownedResult* operator=(WireUnownedResult&&) = delete;
WireUnownedResult* operator=(const WireUnownedResult&) = delete;
~WireUnownedResult() = default;
};
template <>
class ::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
final : public ::fidl::Result {
public:
explicit WireResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> _client,
const ::fidl_test_emptystruct::wire::Empty& e);
WireResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> _client,
const ::fidl_test_emptystruct::wire::Empty& e, zx_time_t _deadline);
explicit WireResult(const ::fidl::Result& result) : ::fidl::Result(result) {}
WireResult(WireResult&&) = delete;
WireResult(const WireResult&) = delete;
WireResult* operator=(WireResult&&) = delete;
WireResult* operator=(const WireResult&) = delete;
~WireResult() = default;
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
Unwrap() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*>(
bytes_.data());
}
const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
Unwrap() const {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*>(
bytes_.data());
}
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
value() {
return *Unwrap();
}
const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
value() const {
return *Unwrap();
}
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
operator->() {
return &value();
}
const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
operator->() const {
return &value();
}
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
operator*() {
return value();
}
const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
operator*() const {
return value();
}
private:
::fidl::internal::InlineMessageBuffer<24> bytes_;
};
template <>
class ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
final : public ::fidl::Result {
public:
explicit WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> _client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
const ::fidl_test_emptystruct::wire::Empty& e, uint8_t* _response_bytes,
uint32_t _response_byte_capacity);
explicit WireUnownedResult(const ::fidl::Result& result)
: ::fidl::Result(result) {}
WireUnownedResult(WireUnownedResult&&) = delete;
WireUnownedResult(const WireUnownedResult&) = delete;
WireUnownedResult* operator=(WireUnownedResult&&) = delete;
WireUnownedResult* operator=(const WireUnownedResult&) = delete;
~WireUnownedResult() = default;
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
Unwrap() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*>(bytes_);
}
const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
Unwrap() const {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*>(bytes_);
}
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
value() {
return *Unwrap();
}
const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
value() const {
return *Unwrap();
}
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
operator->() {
return &value();
}
const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
operator->() const {
return &value();
}
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
operator*() {
return value();
}
const ::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>&
operator*() const {
return value();
}
private:
uint8_t* bytes_;
};
// Methods to make a sync FIDL call directly on an unowned channel or a
// const reference to a
// |fidl::ClientEnd<::fidl_test_emptystruct::EmptyProtocol>|, avoiding setting
// up a client.
template <>
class ::fidl::internal::WireCaller<::fidl_test_emptystruct::EmptyProtocol>
final {
public:
explicit WireCaller(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>
client_end)
: client_end_(client_end) {}
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
static ::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send> Send(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>
_client_end,
const ::fidl_test_emptystruct::wire::Empty& e) {
return ::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send>(
_client_end, e);
}
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send> Send(
const ::fidl_test_emptystruct::wire::Empty& e) && {
return ::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send>(
client_end_, e);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
static ::fidl::WireUnownedResult<::fidl_test_emptystruct::EmptyProtocol::Send>
Send(::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>
_client_end,
::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e) {
return ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::Send>(
_client_end, _request_buffer.data, _request_buffer.capacity, e);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
::fidl::WireUnownedResult<::fidl_test_emptystruct::EmptyProtocol::Send> Send(
::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e) && {
return ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::Send>(
client_end_, _request_buffer.data, _request_buffer.capacity, e);
}
// Allocates 48 bytes of message buffer on the stack. No heap allocation
// necessary.
static ::fidl::WireResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
SendAndReceive(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>
_client_end,
const ::fidl_test_emptystruct::wire::Empty& e) {
return ::fidl::WireResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(_client_end, e);
}
// Allocates 48 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
SendAndReceive(const ::fidl_test_emptystruct::wire::Empty& e) && {
return ::fidl::WireResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(client_end_, e);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
static ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
SendAndReceive(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>
_client_end,
::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e,
::fidl::BufferSpan _response_buffer) {
return ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(
_client_end, _request_buffer.data, _request_buffer.capacity, e,
_response_buffer.data, _response_buffer.capacity);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
SendAndReceive(::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e,
::fidl::BufferSpan _response_buffer) && {
return ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(
client_end_, _request_buffer.data, _request_buffer.capacity, e,
_response_buffer.data, _response_buffer.capacity);
}
private:
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> client_end_;
};
#ifdef __Fuchsia__
template <>
class ::fidl::internal::WireEventHandlerInterface<
::fidl_test_emptystruct::EmptyProtocol> {
public:
WireEventHandlerInterface() = default;
virtual ~WireEventHandlerInterface() = default;
virtual void Receive(
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>*
event) {}
};
template <>
class ::fidl::WireAsyncEventHandler<::fidl_test_emptystruct::EmptyProtocol>
: public ::fidl::internal::WireEventHandlerInterface<
::fidl_test_emptystruct::EmptyProtocol> {
public:
WireAsyncEventHandler() = default;
virtual void Unbound(::fidl::UnbindInfo info) {}
};
template <>
class ::fidl::WireSyncEventHandler<::fidl_test_emptystruct::EmptyProtocol>
: public ::fidl::internal::WireEventHandlerInterface<
::fidl_test_emptystruct::EmptyProtocol> {
public:
WireSyncEventHandler() = default;
// Method called when an unknown event is found. This methods gives the status
// which, in this case, is returned by HandleOneEvent.
virtual zx_status_t Unknown() = 0;
// Handle all possible events defined in this protocol.
// Blocks to consume exactly one message from the channel, then call the
// corresponding virtual method.
::fidl::Result HandleOneEvent(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>
client_end);
};
#endif // __Fuchsia__
template <>
class ::fidl::WireSyncClient<::fidl_test_emptystruct::EmptyProtocol> final {
public:
WireSyncClient() = default;
explicit WireSyncClient(
::fidl::ClientEnd<::fidl_test_emptystruct::EmptyProtocol> client_end)
: client_end_(std::move(client_end)) {}
~WireSyncClient() = default;
WireSyncClient(WireSyncClient&&) = default;
WireSyncClient& operator=(WireSyncClient&&) = default;
const ::fidl::ClientEnd<::fidl_test_emptystruct::EmptyProtocol>& client_end()
const {
return client_end_;
}
::fidl::ClientEnd<::fidl_test_emptystruct::EmptyProtocol>& client_end() {
return client_end_;
}
const ::zx::channel& channel() const { return client_end_.channel(); }
::zx::channel* mutable_channel() { return &client_end_.channel(); }
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send> Send(
const ::fidl_test_emptystruct::wire::Empty& e) {
return ::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send>(
this->client_end(), e);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
::fidl::WireUnownedResult<::fidl_test_emptystruct::EmptyProtocol::Send> Send(
::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e) {
return ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::Send>(
this->client_end(), _request_buffer.data, _request_buffer.capacity, e);
}
// Allocates 48 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
SendAndReceive(const ::fidl_test_emptystruct::wire::Empty& e) {
return ::fidl::WireResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(
this->client_end(), e);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
SendAndReceive(::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e,
::fidl::BufferSpan _response_buffer) {
return ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(
this->client_end(), _request_buffer.data, _request_buffer.capacity, e,
_response_buffer.data, _response_buffer.capacity);
}
// Handle all possible events defined in this protocol.
// Blocks to consume exactly one message from the channel, then call the
// corresponding virtual method defined in |SyncEventHandler|. The return
// status of the handler function is folded with any transport-level errors
// and returned.
::fidl::Result HandleOneEvent(
::fidl::WireSyncEventHandler<::fidl_test_emptystruct::EmptyProtocol>&
event_handler) {
return event_handler.HandleOneEvent(client_end_);
}
private:
::fidl::ClientEnd<::fidl_test_emptystruct::EmptyProtocol> client_end_;
};
// Pure-virtual interface to be implemented by a server.
// This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>|
// and |fidl::ServerEnd<SomeProtocol>|).
template <>
class ::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>
: public ::fidl::internal::IncomingMessageDispatcher {
public:
WireServer() = default;
virtual ~WireServer() = default;
// The FIDL protocol type that is implemented by this server.
using _EnclosingProtocol = ::fidl_test_emptystruct::EmptyProtocol;
using SendCompleter = ::fidl::Completer<>;
class SendRequestView {
public:
SendRequestView(
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>*
request)
: request_(request) {}
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>*
operator->() const {
return request_;
}
private:
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>* request_;
};
virtual void Send(SendRequestView request,
SendCompleter::Sync& _completer) = 0;
class SendAndReceiveCompleterBase : public ::fidl::CompleterBase {
public:
// In the following methods, the return value indicates internal errors
// during the reply, such as encoding or writing to the transport. Note that
// any error will automatically lead to the destruction of the binding,
// after which the |on_unbound| callback will be triggered with a detailed
// reason.
//
// See //zircon/system/ulib/fidl/include/lib/fidl/llcpp/server.h.
//
// Because the reply status is identical to the unbinding status, it can be
// safely ignored.
::fidl::Result Reply(const ::fidl_test_emptystruct::wire::Empty& e);
::fidl::Result Reply(::fidl::BufferSpan _backing_buffer,
const ::fidl_test_emptystruct::wire::Empty& e);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using SendAndReceiveCompleter =
::fidl::Completer<SendAndReceiveCompleterBase>;
class SendAndReceiveRequestView {
public:
SendAndReceiveRequestView(
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* request)
: request_(request) {}
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
operator->() const {
return request_;
}
private:
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>*
request_;
};
virtual void SendAndReceive(SendAndReceiveRequestView request,
SendAndReceiveCompleter::Sync& _completer) = 0;
private:
::fidl::DispatchResult dispatch_message(fidl_incoming_msg_t* msg,
::fidl::Transaction* txn) final;
};
// Pure-virtual interface to be implemented by a server.
// This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>|
// and |fidl::ServerEnd<SomeProtocol>|).
template <>
class ::fidl::WireInterface<::fidl_test_emptystruct::EmptyProtocol>
: public ::fidl::internal::IncomingMessageDispatcher {
public:
WireInterface() = default;
virtual ~WireInterface() = default;
// The marker protocol type within which this |WireInterface| class is
// defined.
using _EnclosingProtocol = ::fidl_test_emptystruct::EmptyProtocol;
using SendCompleter =
::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>::SendCompleter;
virtual void Send(::fidl_test_emptystruct::wire::Empty e,
SendCompleter::Sync& _completer) = 0;
using SendAndReceiveCompleterBase = ::fidl::WireServer<
::fidl_test_emptystruct::EmptyProtocol>::SendAndReceiveCompleterBase;
using SendAndReceiveCompleter = ::fidl::WireServer<
::fidl_test_emptystruct::EmptyProtocol>::SendAndReceiveCompleter;
virtual void SendAndReceive(::fidl_test_emptystruct::wire::Empty e,
SendAndReceiveCompleter::Sync& _completer) = 0;
private:
::fidl::DispatchResult dispatch_message(fidl_incoming_msg_t* msg,
::fidl::Transaction* txn) final;
};
namespace fidl {
template <>
struct IsFidlType<::fidl_test_emptystruct::wire::Empty>
: public std::true_type {};
template <>
struct IsStruct<::fidl_test_emptystruct::wire::Empty> : public std::true_type {
};
static_assert(std::is_standard_layout_v<::fidl_test_emptystruct::wire::Empty>);
static_assert(offsetof(::fidl_test_emptystruct::wire::Empty, __reserved) == 0);
static_assert(sizeof(::fidl_test_emptystruct::wire::Empty) ==
::fidl_test_emptystruct::wire::Empty::PrimarySize);
template <>
struct IsFidlType<
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>>
: public std::true_type {};
template <>
struct IsFidlMessage<
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>>
: public std::true_type {};
static_assert(
sizeof(::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>) ==
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::Send>::PrimarySize);
static_assert(
offsetof(::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>,
e) == 16);
template <>
struct IsFidlType<
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>>
: public std::true_type {};
template <>
struct IsFidlMessage<
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>>
: public std::true_type {};
static_assert(
sizeof(::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>) ==
::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::Receive>::PrimarySize);
static_assert(
offsetof(
::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::Receive>,
e) == 16);
template <>
struct IsFidlType<
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
: public std::true_type {};
template <>
struct IsFidlMessage<
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
: public std::true_type {};
static_assert(
sizeof(::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>) ==
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::PrimarySize);
static_assert(
offsetof(::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>,
e) == 16);
template <>
struct IsFidlType<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
: public std::true_type {};
template <>
struct IsFidlMessage<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>
: public std::true_type {};
static_assert(
sizeof(::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>) ==
::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>::PrimarySize);
static_assert(
offsetof(::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>,
e) == 16);
} // namespace fidl
#ifdef __Fuchsia__
template <>
class ::fidl::WireResponseContext<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
: public ::fidl::internal::ResponseContext {
public:
WireResponseContext();
virtual void OnReply(
::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* message) = 0;
private:
void OnReply(uint8_t* reply) override;
};
#endif // __Fuchsia__
#ifdef __Fuchsia__
template <>
class ::fidl::internal::WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>
final : private ::fidl::internal::ClientBase {
public:
// Asynchronous variant of |EmptyProtocol.SendAndReceive()|.
// Allocates 24 bytes of request buffer on the stack. The callback is stored
// on the heap.
::fidl::Result SendAndReceive(
const ::fidl_test_emptystruct::wire::Empty& e,
::fit::callback<
void(::fidl::WireResponse<::fidl_test_emptystruct::EmptyProtocol::
SendAndReceive>* response)>
_cb);
// Asynchronous variant of |EmptyProtocol.SendAndReceive()|.
// Caller provides the backing storage for FIDL message via request buffer.
// Ownership of |_context| is given unsafely to the binding until |OnError|
// or |OnReply| are called on it.
::fidl::Result SendAndReceive(
::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e,
::fidl::WireResponseContext<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* _context);
// Synchronous variant of |EmptyProtocol.SendAndReceive()|.
// Allocates 48 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
SendAndReceive_Sync(const ::fidl_test_emptystruct::wire::Empty& e);
// Synchronous variant of |EmptyProtocol.SendAndReceive()|.
// Caller provides the backing storage for FIDL message via request and
// response buffers.
::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
SendAndReceive_Sync(::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e,
::fidl::BufferSpan _response_buffer);
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::Result Send(const ::fidl_test_emptystruct::wire::Empty& e);
// Caller provides the backing storage for FIDL message via request buffer.
::fidl::Result Send(::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e);
::fidl::WireAsyncEventHandler<::fidl_test_emptystruct::EmptyProtocol>*
event_handler() const {
return event_handler_.get();
}
private:
friend class ::fidl::Client<::fidl_test_emptystruct::EmptyProtocol>;
friend class ::fidl::internal::ControlBlock<
::fidl_test_emptystruct::EmptyProtocol>;
explicit WireClientImpl(
std::shared_ptr<
::fidl::WireAsyncEventHandler<::fidl_test_emptystruct::EmptyProtocol>>
event_handler)
: event_handler_(std::move(event_handler)) {}
std::optional<::fidl::UnbindInfo> DispatchEvent(
fidl_incoming_msg_t* msg) override;
std::shared_ptr<
::fidl::WireAsyncEventHandler<::fidl_test_emptystruct::EmptyProtocol>>
event_handler_;
};
#endif // __Fuchsia__
#ifdef __Fuchsia__
// |EventSender| owns a server endpoint of a channel speaking
// the EmptyProtocol protocol, and can send events in that protocol.
template <>
class ::fidl::WireEventSender<::fidl_test_emptystruct::EmptyProtocol> {
public:
// Constructs an event sender with an invalid channel.
WireEventSender() = default;
explicit WireEventSender(
::fidl::ServerEnd<::fidl_test_emptystruct::EmptyProtocol> server_end)
: server_end_(std::move(server_end)) {}
// The underlying server channel endpoint, which may be replaced at run-time.
const ::fidl::ServerEnd<::fidl_test_emptystruct::EmptyProtocol>& server_end()
const {
return server_end_;
}
::fidl::ServerEnd<::fidl_test_emptystruct::EmptyProtocol>& server_end() {
return server_end_;
}
const ::zx::channel& channel() const { return server_end_.channel(); }
::zx::channel& channel() { return server_end_.channel(); }
// Whether the underlying channel is valid.
bool is_valid() const { return server_end_.is_valid(); }
zx_status_t Receive(const ::fidl_test_emptystruct::wire::Empty& e) const;
// Caller provides the backing storage for FIDL message via response buffers.
zx_status_t Receive(::fidl::BufferSpan _buffer,
const ::fidl_test_emptystruct::wire::Empty& e) const;
private:
::fidl::ServerEnd<::fidl_test_emptystruct::EmptyProtocol> server_end_;
};
template <>
class ::fidl::internal::WireWeakEventSender<
::fidl_test_emptystruct::EmptyProtocol> {
public:
zx_status_t Receive(const ::fidl_test_emptystruct::wire::Empty& e) const {
if (auto _binding = binding_.lock()) {
return _binding->event_sender().Receive(std::move(e));
}
return ZX_ERR_CANCELED;
}
// Caller provides the backing storage for FIDL message via response buffers.
zx_status_t Receive(::fidl::BufferSpan _buffer,
const ::fidl_test_emptystruct::wire::Empty& e) const {
if (auto _binding = binding_.lock()) {
return _binding->event_sender().Receive(std::move(_buffer), std::move(e));
}
return ZX_ERR_CANCELED;
}
private:
friend class ::fidl::ServerBindingRef<::fidl_test_emptystruct::EmptyProtocol>;
explicit WireWeakEventSender(
std::weak_ptr<::fidl::internal::AsyncServerBinding<
::fidl_test_emptystruct::EmptyProtocol>>
binding)
: binding_(std::move(binding)) {}
std::weak_ptr<::fidl::internal::AsyncServerBinding<
::fidl_test_emptystruct::EmptyProtocol>>
binding_;
};
#endif // __Fuchsia__