blob: efc206e020de560dd4c06ac506b70fd96a42a56c [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <fidl/fidl.test.emptystruct/cpp/markers.h>
#include <fidl/fidl.test.emptystruct/cpp/wire_types.h>
#include <lib/fidl/llcpp/wire_messaging.h>
#ifdef __Fuchsia__
#include <lib/fidl/llcpp/client.h>
#include <lib/fidl/llcpp/connect_service.h>
#include <lib/fidl/llcpp/server.h>
#include <lib/fidl/llcpp/service_handler_interface.h>
#include <lib/fidl/llcpp/sync_call.h>
#endif // __Fuchsia__
namespace fidl_test_emptystruct {
class EmptyProtocol;
__LOCAL extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendRequestMessageTable;
__LOCAL extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendResponseMessageTable;
__LOCAL extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolReceiveRequestMessageTable;
__LOCAL extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolReceiveEventMessageTable;
__LOCAL extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendAndReceiveRequestMessageTable;
__LOCAL extern "C" const fidl_type_t
fidl_test_emptystruct_EmptyProtocolSendAndReceiveResponseMessageTable;
} // namespace fidl_test_emptystruct
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::ProtocolDetails<
::fidl_test_emptystruct::EmptyProtocol> {};
#endif // __Fuchsia__
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::WireServerDispatcher<
::fidl_test_emptystruct::EmptyProtocol>
final {
WireServerDispatcher() = delete;
static ::fidl::DispatchResult TryDispatch(
::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>* impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn);
static void Dispatch(
::fidl::WireServer<::fidl_test_emptystruct::EmptyProtocol>* impl,
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn);
private:
static const ::fidl::internal::MethodEntry entries_[];
static const ::fidl::internal::MethodEntry* entries_end_;
};
#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(const ::fidl_test_emptystruct::wire::Empty& e) : e(e) {
_InitHeader();
}
WireRequest() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl_test_emptystruct::
fidl_test_emptystruct_EmptyProtocolSendRequestMessageTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t PrimarySizeV1 = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr uint32_t MaxOutOfLineV1 = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
class UnownedEncodedMessage;
class OwnedEncodedMessage;
public:
class DecodedMessage;
private:
void _InitHeader();
};
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_EmptyProtocolReceiveEventMessageTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t PrimarySizeV1 = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr uint32_t MaxOutOfLineV1 = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
class UnownedEncodedMessage;
class OwnedEncodedMessage;
public:
class DecodedMessage;
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(const ::fidl_test_emptystruct::wire::Empty& e) : e(e) {
_InitHeader();
}
WireRequest() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl_test_emptystruct::
fidl_test_emptystruct_EmptyProtocolSendAndReceiveRequestMessageTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t PrimarySizeV1 = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr uint32_t MaxOutOfLineV1 = 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;
class OwnedEncodedMessage;
public:
class DecodedMessage;
private:
void _InitHeader();
};
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_EmptyProtocolSendAndReceiveResponseMessageTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t PrimarySizeV1 = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr uint32_t MaxOutOfLineV1 = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
class UnownedEncodedMessage;
class OwnedEncodedMessage;
public:
class DecodedMessage;
private:
void _InitHeader();
};
#ifdef __Fuchsia__
template <>
class ::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send> final
: public ::fidl::Result {
public:
WireResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> client,
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>*
request);
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_end,
::fidl::internal::AnyBufferAllocator& allocator,
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send>*
request);
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:
WireResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> client,
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* request);
WireResult(
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> client,
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* request,
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_end,
::fidl::internal::AnyBufferAllocator& allocator,
::fidl::WireRequest<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* request);
explicit WireUnownedResult(
::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* response)
: bytes_(reinterpret_cast<uint8_t*>(response)) {}
explicit WireUnownedResult(const ::fidl::Result& result)
: ::fidl::Result(result) {}
explicit WireUnownedResult(
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>&& decoded)
: ::fidl::Result(decoded) {
if (decoded.ok()) {
bytes_ = reinterpret_cast<uint8_t*>(decoded.PrimaryObject());
} else {
bytes_ = nullptr;
}
decoded.ReleasePrimaryObject();
}
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::WireSyncClientImpl<
::fidl_test_emptystruct::EmptyProtocol>
final : public ::fidl::internal::SyncEndpointManagedVeneer<
::fidl::internal::WireSyncClientImpl<
::fidl_test_emptystruct::EmptyProtocol>> {
public:
// 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) {
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send> _request{
e};
return ::fidl::WireResult<::fidl_test_emptystruct::EmptyProtocol::Send>(
_client_end(), &_request);
}
// 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) {
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_request{e};
return ::fidl::WireResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(_client_end(),
&_request);
}
private:
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> _client_end()
const {
return ::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>(
_channel());
}
};
template <>
class ::fidl::internal::WireSyncBufferClientImpl<
::fidl_test_emptystruct::EmptyProtocol>
final : public ::fidl::internal::SyncEndpointBufferVeneer<
::fidl::internal::WireSyncBufferClientImpl<
::fidl_test_emptystruct::EmptyProtocol>> {
public:
// Caller provides the backing storage for FIDL message via an argument to
// `.buffer()`.
::fidl::WireUnownedResult<::fidl_test_emptystruct::EmptyProtocol::Send> Send(
const ::fidl_test_emptystruct::wire::Empty& e) {
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::Send> _request{
e};
return ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::Send>(_client_end(),
_allocator(), &_request);
}
// Caller provides the backing storage for FIDL message via an argument to
// `.buffer()`.
::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
SendAndReceive(const ::fidl_test_emptystruct::wire::Empty& e) {
::fidl::WireRequest<::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_request{e};
return ::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>(
_client_end(), _allocator(), &_request);
}
private:
::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol> _client_end()
const {
return ::fidl::UnownedClientEnd<::fidl_test_emptystruct::EmptyProtocol>(
_channel());
}
};
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 ::fidl::internal::AsyncEventHandler {
public:
WireAsyncEventHandler() = default;
};
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);
};
template <>
class ::fidl::WireSyncClient<::fidl_test_emptystruct::EmptyProtocol> final
: public ::fidl::internal::WireSyncClientBase<
::fidl_test_emptystruct::EmptyProtocol> {
public:
using ::fidl::internal::WireSyncClientBase<
::fidl_test_emptystruct::EmptyProtocol>::WireSyncClientBase;
// 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) const {
return event_handler.HandleOneEvent(client_end());
}
};
template <>
class ::fidl::internal::WireCompleterBase<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
: 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 _buffer,
const ::fidl_test_emptystruct::wire::Empty& e);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
template <>
struct ::fidl::internal::WireMethodTypes<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive> {
using Completer = fidl::Completer<::fidl::internal::WireCompleterBase<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>>;
};
// 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 _Transport = ::fidl::internal::ChannelTransport;
using SendCompleter = ::fidl::internal::WireCompleter<
::fidl_test_emptystruct::EmptyProtocol::Send>;
using SendRequestView = ::fidl::internal::WireRequestView<
::fidl_test_emptystruct::EmptyProtocol::Send>;
virtual void Send(SendRequestView request,
SendCompleter::Sync& _completer) = 0;
using SendAndReceiveCompleter = ::fidl::internal::WireCompleter<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>;
using SendAndReceiveRequestView = ::fidl::internal::WireRequestView<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>;
virtual void SendAndReceive(SendAndReceiveRequestView request,
SendAndReceiveCompleter::Sync& _completer) = 0;
private:
void dispatch_message(
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn,
const internal::IncomingTransportContext* transport_context) final;
};
#endif // __Fuchsia__
namespace fidl {
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 OnResult(
::fidl::WireUnownedResult<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>& result) = 0;
private:
::cpp17::optional<::fidl::UnbindInfo> OnRawResult(
::fidl::IncomingMessage&& msg,
const internal::IncomingTransportContext* transport_context) override;
};
#endif // __Fuchsia__
#ifdef __Fuchsia__
template <>
class ::fidl::internal::WireClientImpl<::fidl_test_emptystruct::EmptyProtocol>
final : public ::fidl::internal::ClientBase {
public:
// 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 _buffer_span,
const ::fidl_test_emptystruct::wire::Empty& e);
// Asynchronous variant of |EmptyProtocol.SendAndReceive()|.
// Allocates 24 bytes of request buffer on the stack. The callback is stored
// on the heap.
void SendAndReceive(
const ::fidl_test_emptystruct::wire::Empty& e,
::fidl::WireClientCallback<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>
_cb);
void 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.
void SendAndReceive(
::fidl::BufferSpan _request_buffer,
const ::fidl_test_emptystruct::wire::Empty& e,
::fidl::WireResponseContext<
::fidl_test_emptystruct::EmptyProtocol::SendAndReceive>* _context);
// Synchronous variant of |SendAndReceive.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 |SendAndReceive.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 _buffer_span,
const ::fidl_test_emptystruct::wire::Empty& e);
WireClientImpl() = default;
private:
std::optional<::fidl::UnbindInfo> DispatchEvent(
::fidl::IncomingMessage& msg,
::fidl::internal::AsyncEventHandler* maybe_event_handler,
const internal::IncomingTransportContext* transport_context) override;
};
#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(); }
fidl::Result Receive(const ::fidl_test_emptystruct::wire::Empty& e) const;
// Caller provides the backing storage for FIDL message via response buffers.
fidl::Result 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:
WireWeakEventSender(
std::weak_ptr<::fidl::internal::AsyncServerBinding>&& binding)
: inner_(std::move(binding)) {}
fidl::Result Receive(const ::fidl_test_emptystruct::wire::Empty& e) const;
// Caller provides the backing storage for FIDL message via response buffers.
fidl::Result Receive(::fidl::BufferSpan _buffer,
const ::fidl_test_emptystruct::wire::Empty& e) const;
private:
friend ServerBindingRef<::fidl_test_emptystruct::EmptyProtocol,
::fidl::internal::ChannelTransport>;
::fidl::internal::WeakEventSenderInner inner_;
};
#endif // __Fuchsia__