blob: abf77a5d876a772e5c15438f7d433792339c47e3 [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/buffer_allocator.h>
#include <lib/fidl/llcpp/buffer_then_heap_allocator.h>
#include <lib/fidl/llcpp/coding.h>
#include <lib/fidl/llcpp/envelope.h>
#include <lib/fidl/llcpp/errors.h>
#include <lib/fidl/llcpp/memory.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/tracking_ptr.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/txn_header.h>
#include <lib/zx/channel.h>
#endif // __Fuchsia__
#include <zircon/fidl.h>
namespace llcpp {
namespace fidl {
namespace test {
namespace inheritancewithrecursivedecl {
class Parent;
class Child;
extern "C" const fidl_type_t
fidl_test_inheritancewithrecursivedecl_ParentFirstRequestTable;
extern "C" const fidl_type_t
fidl_test_inheritancewithrecursivedecl_ParentFirstResponseTable;
class Parent final {
Parent() = delete;
public:
struct FirstRequest final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl::ServerEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request;
explicit FirstRequest(
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>& request)
: request(std::move(request)) {
_InitHeader(_txid);
}
explicit FirstRequest(zx_txid_t _txid) { _InitHeader(_txid); }
static constexpr const fidl_type_t* Type =
&::llcpp::fidl::test::inheritancewithrecursivedecl::
fidl_test_inheritancewithrecursivedecl_ParentFirstRequestTable;
static constexpr uint32_t MaxNumHandles = 1;
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;
void _CloseHandles();
private:
class UnownedEncodedByteMessage final {
public:
UnownedEncodedByteMessage(
uint8_t* _bytes, uint32_t _byte_size, zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(_bytes, _byte_size, sizeof(FirstRequest), handles_,
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), 0) {
FIDL_ALIGNDECL FirstRequest _request(_txid, request);
message_.Encode<FirstRequest>(&_request);
}
UnownedEncodedByteMessage(uint8_t* bytes, uint32_t byte_size,
FirstRequest* request)
: message_(bytes, byte_size, sizeof(FirstRequest), handles_,
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), 0) {
message_.Encode<FirstRequest>(request);
}
UnownedEncodedByteMessage(const UnownedEncodedByteMessage&) = delete;
UnownedEncodedByteMessage(UnownedEncodedByteMessage&&) = delete;
UnownedEncodedByteMessage* operator=(const UnownedEncodedByteMessage&) =
delete;
UnownedEncodedByteMessage* operator=(UnownedEncodedByteMessage&&) =
delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingByteMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
zx_handle_disposition_t
handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)];
::fidl::OutgoingByteMessage message_;
};
class UnownedEncodedIovecMessage final {
public:
UnownedEncodedIovecMessage(
zx_channel_iovec_t* iovecs, uint32_t iovec_size,
fidl_iovec_substitution_t* substitutions, uint32_t substitutions_size,
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(::fidl::OutgoingIovecMessage::constructor_args{
.iovecs = iovecs,
.iovecs_actual = 0,
.iovecs_capacity = iovec_size,
.substitutions = substitutions,
.substitutions_actual = 0,
.substitutions_capacity = substitutions_size,
.handles = handles_,
.handle_actual = 0,
.handle_capacity =
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles),
}) {
FIDL_ALIGNDECL FirstRequest _request(_txid, request);
message_.Encode<FirstRequest>(&_request);
}
UnownedEncodedIovecMessage(zx_channel_iovec_t* iovecs,
uint32_t iovec_size,
fidl_iovec_substitution_t* substitutions,
uint32_t substitutions_size,
FirstRequest* request)
: message_(::fidl::OutgoingIovecMessage::constructor_args{
.iovecs = iovecs,
.iovecs_actual = 0,
.iovecs_capacity = iovec_size,
.substitutions = substitutions,
.substitutions_actual = 0,
.substitutions_capacity = substitutions_size,
.handles = handles_,
.handle_actual = 0,
.handle_capacity =
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles),
}) {
message_.Encode<FirstRequest>(request);
}
UnownedEncodedIovecMessage(const UnownedEncodedIovecMessage&) = delete;
UnownedEncodedIovecMessage(UnownedEncodedIovecMessage&&) = delete;
UnownedEncodedIovecMessage* operator=(const UnownedEncodedIovecMessage&) =
delete;
UnownedEncodedIovecMessage* operator=(UnownedEncodedIovecMessage&&) =
delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingIovecMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
zx_handle_disposition_t
handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)];
::fidl::OutgoingIovecMessage message_;
};
class OwnedEncodedByteMessage final {
public:
explicit OwnedEncodedByteMessage(
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(bytes_, sizeof(bytes_), _txid, request) {}
explicit OwnedEncodedByteMessage(FirstRequest* request)
: message_(bytes_, sizeof(bytes_), request) {}
OwnedEncodedByteMessage(const OwnedEncodedByteMessage&) = delete;
OwnedEncodedByteMessage(OwnedEncodedByteMessage&&) = delete;
OwnedEncodedByteMessage* operator=(const OwnedEncodedByteMessage&) =
delete;
OwnedEncodedByteMessage* operator=(OwnedEncodedByteMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingByteMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
FIDL_ALIGNDECL
uint8_t bytes_[PrimarySize + MaxOutOfLine];
UnownedEncodedByteMessage message_;
};
class OwnedEncodedIovecMessage final {
public:
explicit OwnedEncodedIovecMessage(
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(iovecs_, ::fidl::internal::kIovecBufferSize,
substitutions_, ::fidl::internal::kIovecBufferSize, _txid,
request) {}
explicit OwnedEncodedIovecMessage(FirstRequest* request)
: message_(iovecs_, ::fidl::internal::kIovecBufferSize,
substitutions_, ::fidl::internal::kIovecBufferSize,
request) {}
OwnedEncodedIovecMessage(const OwnedEncodedIovecMessage&) = delete;
OwnedEncodedIovecMessage(OwnedEncodedIovecMessage&&) = delete;
OwnedEncodedIovecMessage* operator=(const OwnedEncodedIovecMessage&) =
delete;
OwnedEncodedIovecMessage* operator=(OwnedEncodedIovecMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingIovecMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
zx_channel_iovec_t iovecs_[::fidl::internal::kIovecBufferSize];
fidl_iovec_substitution_t
substitutions_[::fidl::internal::kIovecBufferSize];
UnownedEncodedIovecMessage message_;
};
public:
friend ::fidl::internal::EncodedMessageTypes<FirstRequest>;
using OwnedEncodedMessage = OwnedEncodedByteMessage;
using UnownedEncodedMessage = UnownedEncodedByteMessage;
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<FirstRequest>();
}
DecodedMessage(fidl_incoming_msg_t* msg)
: ::fidl::internal::IncomingMessage(msg) {
Decode<FirstRequest>();
}
DecodedMessage(const DecodedMessage&) = delete;
DecodedMessage(DecodedMessage&&) = delete;
DecodedMessage* operator=(const DecodedMessage&) = delete;
DecodedMessage* operator=(DecodedMessage&&) = delete;
~DecodedMessage() {
if (ok() && (PrimaryObject() != nullptr)) {
PrimaryObject()->_CloseHandles();
}
}
FirstRequest* PrimaryObject() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<FirstRequest*>(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);
};
class EventHandlerInterface {
public:
EventHandlerInterface() = default;
virtual ~EventHandlerInterface() = default;
};
#ifdef __Fuchsia__
// Collection of return types of FIDL calls in this protocol.
class ResultOf final {
ResultOf() = delete;
public:
class First final : public ::fidl::Result {
public:
explicit First(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
_client,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request);
explicit First(const ::fidl::Result& result) : ::fidl::Result(result) {}
First(First&&) = delete;
First(const First&) = delete;
First* operator=(First&&) = delete;
First* operator=(const First&) = delete;
~First() = default;
private:
};
};
// Collection of return types of FIDL calls in this protocol,
// when the caller-allocate flavor or in-place call is used.
class UnownedResultOf final {
UnownedResultOf() = delete;
public:
class First final : public ::fidl::Result {
public:
explicit First(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request);
explicit First(const ::fidl::Result& result) : ::fidl::Result(result) {}
First(First&&) = delete;
First(const First&) = delete;
First* operator=(First&&) = delete;
First* operator=(const First&) = delete;
~First() = default;
};
};
// Methods to make a sync FIDL call directly on an unowned channel or a
// const reference to a
// |fidl::ClientEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>|,
// avoiding setting up a client.
class Call final {
Call() = delete;
public:
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
static ResultOf::First First(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
_client_end,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return ResultOf::First(_client_end, request);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
static UnownedResultOf::First First(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
_client_end,
::fidl::BufferSpan _request_buffer,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return UnownedResultOf::First(_client_end, _request_buffer.data,
_request_buffer.capacity, request);
}
};
class SyncClient final {
public:
SyncClient() = default;
explicit SyncClient(::fidl::ClientEnd<Parent> client_end)
: client_end_(std::move(client_end)) {}
~SyncClient() = default;
SyncClient(SyncClient&&) = default;
SyncClient& operator=(SyncClient&&) = default;
const ::fidl::ClientEnd<Parent>& client_end() const { return client_end_; }
::fidl::ClientEnd<Parent>& 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.
ResultOf::First First(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return ResultOf::First(this->client_end(), request);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
UnownedResultOf::First First(
::fidl::BufferSpan _request_buffer,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return UnownedResultOf::First(this->client_end(), _request_buffer.data,
_request_buffer.capacity, request);
}
private:
::fidl::ClientEnd<Parent> client_end_;
};
#ifdef __Fuchsia__
class AsyncEventHandler;
class ClientImpl;
#endif
// Pure-virtual interface to be implemented by a server.
// This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>|
// and |fidl::ServerEnd<SomeProtocol>|).
class Interface : public ::fidl::internal::IncomingMessageDispatcher {
public:
Interface() = default;
virtual ~Interface() = default;
// The marker protocol type within which this |Interface| class is defined.
using _EnclosingProtocol = Parent;
using FirstCompleter = ::fidl::Completer<>;
virtual void First(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request,
FirstCompleter::Sync& _completer) = 0;
private:
::fidl::DispatchResult dispatch_message(fidl_incoming_msg_t* msg,
::fidl::Transaction* txn) final;
};
// Attempts to dispatch the incoming message to a handler function in the
// server implementation. If there is no matching handler, it returns false,
// leaving the message and transaction intact. In all other cases, it consumes
// the message and returns true. It is possible to chain multiple TryDispatch
// functions in this manner.
static ::fidl::DispatchResult TryDispatch(Interface* impl,
fidl_incoming_msg_t* msg,
::fidl::Transaction* txn);
// Dispatches the incoming message to one of the handlers functions in the
// protocol. If there is no matching handler, it closes all the handles in
// |msg| and closes the channel with a |ZX_ERR_NOT_SUPPORTED| epitaph, before
// returning false. The message should then be discarded.
static ::fidl::DispatchResult Dispatch(Interface* impl,
fidl_incoming_msg_t* msg,
::fidl::Transaction* txn);
// Same as |Dispatch|, but takes a |void*| instead of |Interface*|.
// Only used with |fidl::BindServer| to reduce template expansion.
// Do not call this method manually. Use |Dispatch| instead.
static ::fidl::DispatchResult TypeErasedDispatch(void* impl,
fidl_incoming_msg_t* msg,
::fidl::Transaction* txn) {
return Dispatch(static_cast<Interface*>(impl), msg, txn);
}
#endif
class EventSender;
class WeakEventSender;
};
extern "C" const fidl_type_t
fidl_test_inheritancewithrecursivedecl_ChildFirstRequestTable;
extern "C" const fidl_type_t
fidl_test_inheritancewithrecursivedecl_ChildFirstResponseTable;
extern "C" const fidl_type_t
fidl_test_inheritancewithrecursivedecl_ChildSecondRequestTable;
extern "C" const fidl_type_t
fidl_test_inheritancewithrecursivedecl_ChildSecondResponseTable;
class Child final {
Child() = delete;
public:
struct FirstRequest final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl::ServerEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request;
explicit FirstRequest(
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>& request)
: request(std::move(request)) {
_InitHeader(_txid);
}
explicit FirstRequest(zx_txid_t _txid) { _InitHeader(_txid); }
static constexpr const fidl_type_t* Type =
&::llcpp::fidl::test::inheritancewithrecursivedecl::
fidl_test_inheritancewithrecursivedecl_ChildFirstRequestTable;
static constexpr uint32_t MaxNumHandles = 1;
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;
void _CloseHandles();
private:
class UnownedEncodedByteMessage final {
public:
UnownedEncodedByteMessage(
uint8_t* _bytes, uint32_t _byte_size, zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(_bytes, _byte_size, sizeof(FirstRequest), handles_,
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), 0) {
FIDL_ALIGNDECL FirstRequest _request(_txid, request);
message_.Encode<FirstRequest>(&_request);
}
UnownedEncodedByteMessage(uint8_t* bytes, uint32_t byte_size,
FirstRequest* request)
: message_(bytes, byte_size, sizeof(FirstRequest), handles_,
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), 0) {
message_.Encode<FirstRequest>(request);
}
UnownedEncodedByteMessage(const UnownedEncodedByteMessage&) = delete;
UnownedEncodedByteMessage(UnownedEncodedByteMessage&&) = delete;
UnownedEncodedByteMessage* operator=(const UnownedEncodedByteMessage&) =
delete;
UnownedEncodedByteMessage* operator=(UnownedEncodedByteMessage&&) =
delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingByteMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
zx_handle_disposition_t
handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)];
::fidl::OutgoingByteMessage message_;
};
class UnownedEncodedIovecMessage final {
public:
UnownedEncodedIovecMessage(
zx_channel_iovec_t* iovecs, uint32_t iovec_size,
fidl_iovec_substitution_t* substitutions, uint32_t substitutions_size,
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(::fidl::OutgoingIovecMessage::constructor_args{
.iovecs = iovecs,
.iovecs_actual = 0,
.iovecs_capacity = iovec_size,
.substitutions = substitutions,
.substitutions_actual = 0,
.substitutions_capacity = substitutions_size,
.handles = handles_,
.handle_actual = 0,
.handle_capacity =
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles),
}) {
FIDL_ALIGNDECL FirstRequest _request(_txid, request);
message_.Encode<FirstRequest>(&_request);
}
UnownedEncodedIovecMessage(zx_channel_iovec_t* iovecs,
uint32_t iovec_size,
fidl_iovec_substitution_t* substitutions,
uint32_t substitutions_size,
FirstRequest* request)
: message_(::fidl::OutgoingIovecMessage::constructor_args{
.iovecs = iovecs,
.iovecs_actual = 0,
.iovecs_capacity = iovec_size,
.substitutions = substitutions,
.substitutions_actual = 0,
.substitutions_capacity = substitutions_size,
.handles = handles_,
.handle_actual = 0,
.handle_capacity =
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles),
}) {
message_.Encode<FirstRequest>(request);
}
UnownedEncodedIovecMessage(const UnownedEncodedIovecMessage&) = delete;
UnownedEncodedIovecMessage(UnownedEncodedIovecMessage&&) = delete;
UnownedEncodedIovecMessage* operator=(const UnownedEncodedIovecMessage&) =
delete;
UnownedEncodedIovecMessage* operator=(UnownedEncodedIovecMessage&&) =
delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingIovecMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
zx_handle_disposition_t
handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)];
::fidl::OutgoingIovecMessage message_;
};
class OwnedEncodedByteMessage final {
public:
explicit OwnedEncodedByteMessage(
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(bytes_, sizeof(bytes_), _txid, request) {}
explicit OwnedEncodedByteMessage(FirstRequest* request)
: message_(bytes_, sizeof(bytes_), request) {}
OwnedEncodedByteMessage(const OwnedEncodedByteMessage&) = delete;
OwnedEncodedByteMessage(OwnedEncodedByteMessage&&) = delete;
OwnedEncodedByteMessage* operator=(const OwnedEncodedByteMessage&) =
delete;
OwnedEncodedByteMessage* operator=(OwnedEncodedByteMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingByteMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
FIDL_ALIGNDECL
uint8_t bytes_[PrimarySize + MaxOutOfLine];
UnownedEncodedByteMessage message_;
};
class OwnedEncodedIovecMessage final {
public:
explicit OwnedEncodedIovecMessage(
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(iovecs_, ::fidl::internal::kIovecBufferSize,
substitutions_, ::fidl::internal::kIovecBufferSize, _txid,
request) {}
explicit OwnedEncodedIovecMessage(FirstRequest* request)
: message_(iovecs_, ::fidl::internal::kIovecBufferSize,
substitutions_, ::fidl::internal::kIovecBufferSize,
request) {}
OwnedEncodedIovecMessage(const OwnedEncodedIovecMessage&) = delete;
OwnedEncodedIovecMessage(OwnedEncodedIovecMessage&&) = delete;
OwnedEncodedIovecMessage* operator=(const OwnedEncodedIovecMessage&) =
delete;
OwnedEncodedIovecMessage* operator=(OwnedEncodedIovecMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingIovecMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
zx_channel_iovec_t iovecs_[::fidl::internal::kIovecBufferSize];
fidl_iovec_substitution_t
substitutions_[::fidl::internal::kIovecBufferSize];
UnownedEncodedIovecMessage message_;
};
public:
friend ::fidl::internal::EncodedMessageTypes<FirstRequest>;
using OwnedEncodedMessage = OwnedEncodedByteMessage;
using UnownedEncodedMessage = UnownedEncodedByteMessage;
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<FirstRequest>();
}
DecodedMessage(fidl_incoming_msg_t* msg)
: ::fidl::internal::IncomingMessage(msg) {
Decode<FirstRequest>();
}
DecodedMessage(const DecodedMessage&) = delete;
DecodedMessage(DecodedMessage&&) = delete;
DecodedMessage* operator=(const DecodedMessage&) = delete;
DecodedMessage* operator=(DecodedMessage&&) = delete;
~DecodedMessage() {
if (ok() && (PrimaryObject() != nullptr)) {
PrimaryObject()->_CloseHandles();
}
}
FirstRequest* PrimaryObject() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<FirstRequest*>(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);
};
struct SecondRequest final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl::ServerEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request;
explicit SecondRequest(
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>& request)
: request(std::move(request)) {
_InitHeader(_txid);
}
explicit SecondRequest(zx_txid_t _txid) { _InitHeader(_txid); }
static constexpr const fidl_type_t* Type =
&::llcpp::fidl::test::inheritancewithrecursivedecl::
fidl_test_inheritancewithrecursivedecl_ChildSecondRequestTable;
static constexpr uint32_t MaxNumHandles = 1;
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;
void _CloseHandles();
private:
class UnownedEncodedByteMessage final {
public:
UnownedEncodedByteMessage(
uint8_t* _bytes, uint32_t _byte_size, zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(_bytes, _byte_size, sizeof(SecondRequest), handles_,
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), 0) {
FIDL_ALIGNDECL SecondRequest _request(_txid, request);
message_.Encode<SecondRequest>(&_request);
}
UnownedEncodedByteMessage(uint8_t* bytes, uint32_t byte_size,
SecondRequest* request)
: message_(bytes, byte_size, sizeof(SecondRequest), handles_,
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles), 0) {
message_.Encode<SecondRequest>(request);
}
UnownedEncodedByteMessage(const UnownedEncodedByteMessage&) = delete;
UnownedEncodedByteMessage(UnownedEncodedByteMessage&&) = delete;
UnownedEncodedByteMessage* operator=(const UnownedEncodedByteMessage&) =
delete;
UnownedEncodedByteMessage* operator=(UnownedEncodedByteMessage&&) =
delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingByteMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
zx_handle_disposition_t
handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)];
::fidl::OutgoingByteMessage message_;
};
class UnownedEncodedIovecMessage final {
public:
UnownedEncodedIovecMessage(
zx_channel_iovec_t* iovecs, uint32_t iovec_size,
fidl_iovec_substitution_t* substitutions, uint32_t substitutions_size,
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(::fidl::OutgoingIovecMessage::constructor_args{
.iovecs = iovecs,
.iovecs_actual = 0,
.iovecs_capacity = iovec_size,
.substitutions = substitutions,
.substitutions_actual = 0,
.substitutions_capacity = substitutions_size,
.handles = handles_,
.handle_actual = 0,
.handle_capacity =
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles),
}) {
FIDL_ALIGNDECL SecondRequest _request(_txid, request);
message_.Encode<SecondRequest>(&_request);
}
UnownedEncodedIovecMessage(zx_channel_iovec_t* iovecs,
uint32_t iovec_size,
fidl_iovec_substitution_t* substitutions,
uint32_t substitutions_size,
SecondRequest* request)
: message_(::fidl::OutgoingIovecMessage::constructor_args{
.iovecs = iovecs,
.iovecs_actual = 0,
.iovecs_capacity = iovec_size,
.substitutions = substitutions,
.substitutions_actual = 0,
.substitutions_capacity = substitutions_size,
.handles = handles_,
.handle_actual = 0,
.handle_capacity =
std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles),
}) {
message_.Encode<SecondRequest>(request);
}
UnownedEncodedIovecMessage(const UnownedEncodedIovecMessage&) = delete;
UnownedEncodedIovecMessage(UnownedEncodedIovecMessage&&) = delete;
UnownedEncodedIovecMessage* operator=(const UnownedEncodedIovecMessage&) =
delete;
UnownedEncodedIovecMessage* operator=(UnownedEncodedIovecMessage&&) =
delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.status() == ZX_OK; }
const char* error() const { return message_.error(); }
::fidl::OutgoingIovecMessage& GetOutgoingMessage() { return message_; }
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
zx_handle_disposition_t
handles_[std::min(ZX_CHANNEL_MAX_MSG_HANDLES, MaxNumHandles)];
::fidl::OutgoingIovecMessage message_;
};
class OwnedEncodedByteMessage final {
public:
explicit OwnedEncodedByteMessage(
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(bytes_, sizeof(bytes_), _txid, request) {}
explicit OwnedEncodedByteMessage(SecondRequest* request)
: message_(bytes_, sizeof(bytes_), request) {}
OwnedEncodedByteMessage(const OwnedEncodedByteMessage&) = delete;
OwnedEncodedByteMessage(OwnedEncodedByteMessage&&) = delete;
OwnedEncodedByteMessage* operator=(const OwnedEncodedByteMessage&) =
delete;
OwnedEncodedByteMessage* operator=(OwnedEncodedByteMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingByteMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
FIDL_ALIGNDECL
uint8_t bytes_[PrimarySize + MaxOutOfLine];
UnownedEncodedByteMessage message_;
};
class OwnedEncodedIovecMessage final {
public:
explicit OwnedEncodedIovecMessage(
zx_txid_t _txid,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request)
: message_(iovecs_, ::fidl::internal::kIovecBufferSize,
substitutions_, ::fidl::internal::kIovecBufferSize, _txid,
request) {}
explicit OwnedEncodedIovecMessage(SecondRequest* request)
: message_(iovecs_, ::fidl::internal::kIovecBufferSize,
substitutions_, ::fidl::internal::kIovecBufferSize,
request) {}
OwnedEncodedIovecMessage(const OwnedEncodedIovecMessage&) = delete;
OwnedEncodedIovecMessage(OwnedEncodedIovecMessage&&) = delete;
OwnedEncodedIovecMessage* operator=(const OwnedEncodedIovecMessage&) =
delete;
OwnedEncodedIovecMessage* operator=(OwnedEncodedIovecMessage&&) = delete;
zx_status_t status() const { return message_.status(); }
#ifdef __Fuchsia__
const char* status_string() const { return message_.status_string(); }
#endif
bool ok() const { return message_.ok(); }
const char* error() const { return message_.error(); }
::fidl::OutgoingIovecMessage& GetOutgoingMessage() {
return message_.GetOutgoingMessage();
}
#ifdef __Fuchsia__
template <typename ChannelLike>
void Write(ChannelLike&& client) {
message_.Write(std::forward<ChannelLike>(client));
}
#endif
private:
zx_channel_iovec_t iovecs_[::fidl::internal::kIovecBufferSize];
fidl_iovec_substitution_t
substitutions_[::fidl::internal::kIovecBufferSize];
UnownedEncodedIovecMessage message_;
};
public:
friend ::fidl::internal::EncodedMessageTypes<SecondRequest>;
using OwnedEncodedMessage = OwnedEncodedByteMessage;
using UnownedEncodedMessage = UnownedEncodedByteMessage;
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<SecondRequest>();
}
DecodedMessage(fidl_incoming_msg_t* msg)
: ::fidl::internal::IncomingMessage(msg) {
Decode<SecondRequest>();
}
DecodedMessage(const DecodedMessage&) = delete;
DecodedMessage(DecodedMessage&&) = delete;
DecodedMessage* operator=(const DecodedMessage&) = delete;
DecodedMessage* operator=(DecodedMessage&&) = delete;
~DecodedMessage() {
if (ok() && (PrimaryObject() != nullptr)) {
PrimaryObject()->_CloseHandles();
}
}
SecondRequest* PrimaryObject() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<SecondRequest*>(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);
};
class EventHandlerInterface {
public:
EventHandlerInterface() = default;
virtual ~EventHandlerInterface() = default;
};
#ifdef __Fuchsia__
// Collection of return types of FIDL calls in this protocol.
class ResultOf final {
ResultOf() = delete;
public:
class First final : public ::fidl::Result {
public:
explicit First(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child>
_client,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request);
explicit First(const ::fidl::Result& result) : ::fidl::Result(result) {}
First(First&&) = delete;
First(const First&) = delete;
First* operator=(First&&) = delete;
First* operator=(const First&) = delete;
~First() = default;
private:
};
class Second final : public ::fidl::Result {
public:
explicit Second(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child>
_client,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request);
explicit Second(const ::fidl::Result& result) : ::fidl::Result(result) {}
Second(Second&&) = delete;
Second(const Second&) = delete;
Second* operator=(Second&&) = delete;
Second* operator=(const Second&) = delete;
~Second() = default;
private:
};
};
// Collection of return types of FIDL calls in this protocol,
// when the caller-allocate flavor or in-place call is used.
class UnownedResultOf final {
UnownedResultOf() = delete;
public:
class First final : public ::fidl::Result {
public:
explicit First(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request);
explicit First(const ::fidl::Result& result) : ::fidl::Result(result) {}
First(First&&) = delete;
First(const First&) = delete;
First* operator=(First&&) = delete;
First* operator=(const First&) = delete;
~First() = default;
};
class Second final : public ::fidl::Result {
public:
explicit Second(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>&
request);
explicit Second(const ::fidl::Result& result) : ::fidl::Result(result) {}
Second(Second&&) = delete;
Second(const Second&) = delete;
Second* operator=(Second&&) = delete;
Second* operator=(const Second&) = delete;
~Second() = default;
};
};
// Methods to make a sync FIDL call directly on an unowned channel or a
// const reference to a
// |fidl::ClientEnd<::llcpp::fidl::test::inheritancewithrecursivedecl::Child>|,
// avoiding setting up a client.
class Call final {
Call() = delete;
public:
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
static ResultOf::First First(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child>
_client_end,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return ResultOf::First(_client_end, request);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
static UnownedResultOf::First First(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child>
_client_end,
::fidl::BufferSpan _request_buffer,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return UnownedResultOf::First(_client_end, _request_buffer.data,
_request_buffer.capacity, request);
}
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
static ResultOf::Second Second(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child>
_client_end,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return ResultOf::Second(_client_end, request);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
static UnownedResultOf::Second Second(
::fidl::UnownedClientEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child>
_client_end,
::fidl::BufferSpan _request_buffer,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return UnownedResultOf::Second(_client_end, _request_buffer.data,
_request_buffer.capacity, request);
}
};
class SyncClient final {
public:
SyncClient() = default;
explicit SyncClient(::fidl::ClientEnd<Child> client_end)
: client_end_(std::move(client_end)) {}
~SyncClient() = default;
SyncClient(SyncClient&&) = default;
SyncClient& operator=(SyncClient&&) = default;
const ::fidl::ClientEnd<Child>& client_end() const { return client_end_; }
::fidl::ClientEnd<Child>& 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.
ResultOf::First First(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return ResultOf::First(this->client_end(), request);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
UnownedResultOf::First First(
::fidl::BufferSpan _request_buffer,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return UnownedResultOf::First(this->client_end(), _request_buffer.data,
_request_buffer.capacity, request);
}
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
ResultOf::Second Second(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return ResultOf::Second(this->client_end(), request);
}
// Caller provides the backing storage for FIDL message via request and
// response buffers.
UnownedResultOf::Second Second(
::fidl::BufferSpan _request_buffer,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request) {
return UnownedResultOf::Second(this->client_end(), _request_buffer.data,
_request_buffer.capacity, request);
}
private:
::fidl::ClientEnd<Child> client_end_;
};
#ifdef __Fuchsia__
class AsyncEventHandler;
class ClientImpl;
#endif
// Pure-virtual interface to be implemented by a server.
// This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>|
// and |fidl::ServerEnd<SomeProtocol>|).
class Interface : public ::fidl::internal::IncomingMessageDispatcher {
public:
Interface() = default;
virtual ~Interface() = default;
// The marker protocol type within which this |Interface| class is defined.
using _EnclosingProtocol = Child;
using FirstCompleter = ::fidl::Completer<>;
virtual void First(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request,
FirstCompleter::Sync& _completer) = 0;
using SecondCompleter = ::fidl::Completer<>;
virtual void Second(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request,
SecondCompleter::Sync& _completer) = 0;
private:
::fidl::DispatchResult dispatch_message(fidl_incoming_msg_t* msg,
::fidl::Transaction* txn) final;
};
// Attempts to dispatch the incoming message to a handler function in the
// server implementation. If there is no matching handler, it returns false,
// leaving the message and transaction intact. In all other cases, it consumes
// the message and returns true. It is possible to chain multiple TryDispatch
// functions in this manner.
static ::fidl::DispatchResult TryDispatch(Interface* impl,
fidl_incoming_msg_t* msg,
::fidl::Transaction* txn);
// Dispatches the incoming message to one of the handlers functions in the
// protocol. If there is no matching handler, it closes all the handles in
// |msg| and closes the channel with a |ZX_ERR_NOT_SUPPORTED| epitaph, before
// returning false. The message should then be discarded.
static ::fidl::DispatchResult Dispatch(Interface* impl,
fidl_incoming_msg_t* msg,
::fidl::Transaction* txn);
// Same as |Dispatch|, but takes a |void*| instead of |Interface*|.
// Only used with |fidl::BindServer| to reduce template expansion.
// Do not call this method manually. Use |Dispatch| instead.
static ::fidl::DispatchResult TypeErasedDispatch(void* impl,
fidl_incoming_msg_t* msg,
::fidl::Transaction* txn) {
return Dispatch(static_cast<Interface*>(impl), msg, txn);
}
#endif
class EventSender;
class WeakEventSender;
};
} // namespace inheritancewithrecursivedecl
} // namespace test
} // namespace fidl
} // namespace llcpp
namespace fidl {
template <>
struct IsFidlType<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent::FirstRequest>
: public std::true_type {};
template <>
struct IsFidlMessage<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent::FirstRequest>
: public std::true_type {};
static_assert(sizeof(::llcpp::fidl::test::inheritancewithrecursivedecl::Parent::
FirstRequest) ==
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent::
FirstRequest::PrimarySize);
static_assert(
offsetof(
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent::FirstRequest,
request) == 16);
template <>
struct IsFidlType<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child::FirstRequest>
: public std::true_type {};
template <>
struct IsFidlMessage<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child::FirstRequest>
: public std::true_type {};
static_assert(sizeof(::llcpp::fidl::test::inheritancewithrecursivedecl::Child::
FirstRequest) ==
::llcpp::fidl::test::inheritancewithrecursivedecl::Child::
FirstRequest::PrimarySize);
static_assert(
offsetof(
::llcpp::fidl::test::inheritancewithrecursivedecl::Child::FirstRequest,
request) == 16);
template <>
struct IsFidlType<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child::SecondRequest>
: public std::true_type {};
template <>
struct IsFidlMessage<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child::SecondRequest>
: public std::true_type {};
static_assert(sizeof(::llcpp::fidl::test::inheritancewithrecursivedecl::Child::
SecondRequest) ==
::llcpp::fidl::test::inheritancewithrecursivedecl::Child::
SecondRequest::PrimarySize);
static_assert(
offsetof(
::llcpp::fidl::test::inheritancewithrecursivedecl::Child::SecondRequest,
request) == 16);
} // namespace fidl
namespace llcpp {
namespace fidl {
namespace test {
namespace inheritancewithrecursivedecl {
#ifdef __Fuchsia__
class Parent::AsyncEventHandler : public Parent::EventHandlerInterface {
public:
AsyncEventHandler() = default;
virtual void Unbound(::fidl::UnbindInfo info) {}
};
class Parent::ClientImpl final : private ::fidl::internal::ClientBase {
public:
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::Result First(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request);
// Caller provides the backing storage for FIDL message via request buffer.
::fidl::Result First(
::fidl::BufferSpan _request_buffer,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request);
AsyncEventHandler* event_handler() const { return event_handler_.get(); }
private:
friend class ::fidl::Client<Parent>;
friend class ::fidl::internal::ControlBlock<Parent>;
explicit ClientImpl(std::shared_ptr<AsyncEventHandler> event_handler)
: event_handler_(std::move(event_handler)) {}
std::optional<::fidl::UnbindInfo> DispatchEvent(
fidl_incoming_msg_t* msg) override;
std::shared_ptr<AsyncEventHandler> event_handler_;
};
#endif
#ifdef __Fuchsia__
// |EventSender| owns a server endpoint of a channel speaking
// the Parent protocol, and can send events in that protocol.
class Parent::EventSender {
public:
// Constructs an event sender with an invalid channel.
EventSender() = default;
explicit EventSender(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
server_end)
: server_end_(std::move(server_end)) {}
// The underlying server channel endpoint, which may be replaced at run-time.
const ::fidl::ServerEnd<Parent>& server_end() const { return server_end_; }
::fidl::ServerEnd<Parent>& 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(); }
private:
::fidl::ServerEnd<Parent> server_end_;
};
class Parent::WeakEventSender {
public:
private:
friend class ::fidl::ServerBindingRef<Parent>;
explicit WeakEventSender(
std::weak_ptr<::fidl::internal::AsyncServerBinding<Parent>> binding)
: binding_(std::move(binding)) {}
std::weak_ptr<::fidl::internal::AsyncServerBinding<Parent>> binding_;
};
#endif
#ifdef __Fuchsia__
class Child::AsyncEventHandler : public Child::EventHandlerInterface {
public:
AsyncEventHandler() = default;
virtual void Unbound(::fidl::UnbindInfo info) {}
};
class Child::ClientImpl final : private ::fidl::internal::ClientBase {
public:
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::Result First(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request);
// Caller provides the backing storage for FIDL message via request buffer.
::fidl::Result First(
::fidl::BufferSpan _request_buffer,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request);
// Allocates 24 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::Result Second(
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request);
// Caller provides the backing storage for FIDL message via request buffer.
::fidl::Result Second(
::fidl::BufferSpan _request_buffer,
::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Parent>
request);
AsyncEventHandler* event_handler() const { return event_handler_.get(); }
private:
friend class ::fidl::Client<Child>;
friend class ::fidl::internal::ControlBlock<Child>;
explicit ClientImpl(std::shared_ptr<AsyncEventHandler> event_handler)
: event_handler_(std::move(event_handler)) {}
std::optional<::fidl::UnbindInfo> DispatchEvent(
fidl_incoming_msg_t* msg) override;
std::shared_ptr<AsyncEventHandler> event_handler_;
};
#endif
#ifdef __Fuchsia__
// |EventSender| owns a server endpoint of a channel speaking
// the Child protocol, and can send events in that protocol.
class Child::EventSender {
public:
// Constructs an event sender with an invalid channel.
EventSender() = default;
explicit EventSender(::fidl::ServerEnd<
::llcpp::fidl::test::inheritancewithrecursivedecl::Child>
server_end)
: server_end_(std::move(server_end)) {}
// The underlying server channel endpoint, which may be replaced at run-time.
const ::fidl::ServerEnd<Child>& server_end() const { return server_end_; }
::fidl::ServerEnd<Child>& 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(); }
private:
::fidl::ServerEnd<Child> server_end_;
};
class Child::WeakEventSender {
public:
private:
friend class ::fidl::ServerBindingRef<Child>;
explicit WeakEventSender(
std::weak_ptr<::fidl::internal::AsyncServerBinding<Child>> binding)
: binding_(std::move(binding)) {}
std::weak_ptr<::fidl::internal::AsyncServerBinding<Child>> binding_;
};
#endif
} // namespace inheritancewithrecursivedecl
} // namespace test
} // namespace fidl
} // namespace llcpp