blob: 19533072f522869e19c01755c1d2a9bcc1ed8b4e [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <fidl/fidl.test.transitivedependenciescompose/cpp/markers.h>
#include <fidl/fidl.test.transitivedependenciescompose/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__
#include <fidl/bottom/cpp/wire_messaging.h>
#include <fidl/middle/cpp/wire_messaging.h>
namespace fidl_test_transitivedependenciescompose {
class Top;
__LOCAL extern "C" const fidl_type_t
fidl_test_transitivedependenciescompose_TopGetFooRequestMessageTable;
__LOCAL extern "C" const fidl_type_t
fidl_test_transitivedependenciescompose_TopGetFooResponseMessageTable;
} // namespace fidl_test_transitivedependenciescompose
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::ProtocolDetails<
::fidl_test_transitivedependenciescompose::Top> {};
#endif // __Fuchsia__
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::WireServerDispatcher<
::fidl_test_transitivedependenciescompose::Top>
final {
WireServerDispatcher() = delete;
static ::fidl::DispatchResult TryDispatch(
::fidl::WireServer<::fidl_test_transitivedependenciescompose::Top>* impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn);
static void Dispatch(
::fidl::WireServer<::fidl_test_transitivedependenciescompose::Top>* 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_transitivedependenciescompose::Top::GetFoo>
final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
WireRequest() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl::_llcpp_coding_AnyZeroArgMessageTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 16;
static constexpr uint32_t PrimarySizeV1 = 16;
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_transitivedependenciescompose::Top::GetFoo>;
class UnownedEncodedMessage;
class OwnedEncodedMessage;
public:
class DecodedMessage;
private:
void _InitHeader();
};
template <>
struct ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>
final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::bottom::wire::Foo foo;
explicit WireResponse(const ::bottom::wire::Foo& foo) : foo(foo) {
_InitHeader();
}
WireResponse() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl_test_transitivedependenciescompose::
fidl_test_transitivedependenciescompose_TopGetFooResponseMessageTable;
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_transitivedependenciescompose::Top::GetFoo>
final : public ::fidl::Result {
public:
WireResult(
::fidl::UnownedClientEnd<::fidl_test_transitivedependenciescompose::Top>
client,
::fidl::WireRequest<
::fidl_test_transitivedependenciescompose::Top::GetFoo>* request);
WireResult(
::fidl::UnownedClientEnd<::fidl_test_transitivedependenciescompose::Top>
client,
::fidl::WireRequest<
::fidl_test_transitivedependenciescompose::Top::GetFoo>* 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_transitivedependenciescompose::Top::GetFoo>*
Unwrap() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>*>(
bytes_.data());
}
const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>*
Unwrap() const {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>*>(
bytes_.data());
}
::fidl::WireResponse<::fidl_test_transitivedependenciescompose::Top::GetFoo>&
value() {
return *Unwrap();
}
const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>&
value() const {
return *Unwrap();
}
::fidl::WireResponse<::fidl_test_transitivedependenciescompose::Top::GetFoo>*
operator->() {
return &value();
}
const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>*
operator->() const {
return &value();
}
::fidl::WireResponse<::fidl_test_transitivedependenciescompose::Top::GetFoo>&
operator*() {
return value();
}
const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>&
operator*() const {
return value();
}
private:
::fidl::internal::InlineMessageBuffer<24> bytes_;
};
template <>
class ::fidl::WireUnownedResult<
::fidl_test_transitivedependenciescompose::Top::GetFoo>
final : public ::fidl::Result {
public:
explicit WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_transitivedependenciescompose::Top>
client_end,
::fidl::internal::AnyBufferAllocator& allocator,
::fidl::WireRequest<
::fidl_test_transitivedependenciescompose::Top::GetFoo>* request);
explicit WireUnownedResult(
::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>* response)
: bytes_(reinterpret_cast<uint8_t*>(response)) {}
explicit WireUnownedResult(const ::fidl::Result& result)
: ::fidl::Result(result) {}
explicit WireUnownedResult(
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>>&& 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_transitivedependenciescompose::Top::GetFoo>*
Unwrap() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>*>(bytes_);
}
const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>*
Unwrap() const {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>*>(bytes_);
}
::fidl::WireResponse<::fidl_test_transitivedependenciescompose::Top::GetFoo>&
value() {
return *Unwrap();
}
const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>&
value() const {
return *Unwrap();
}
::fidl::WireResponse<::fidl_test_transitivedependenciescompose::Top::GetFoo>*
operator->() {
return &value();
}
const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>*
operator->() const {
return &value();
}
::fidl::WireResponse<::fidl_test_transitivedependenciescompose::Top::GetFoo>&
operator*() {
return value();
}
const ::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>&
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_transitivedependenciescompose::Top>|, avoiding
// setting up a client.
template <>
class ::fidl::internal::WireSyncClientImpl<
::fidl_test_transitivedependenciescompose::Top>
final : public ::fidl::internal::SyncEndpointManagedVeneer<
::fidl::internal::WireSyncClientImpl<
::fidl_test_transitivedependenciescompose::Top>> {
public:
// Allocates 40 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::WireResult<::fidl_test_transitivedependenciescompose::Top::GetFoo>
GetFoo() {
::fidl::WireRequest<::fidl_test_transitivedependenciescompose::Top::GetFoo>
_request{};
return ::fidl::WireResult<
::fidl_test_transitivedependenciescompose::Top::GetFoo>(_client_end(),
&_request);
}
private:
::fidl::UnownedClientEnd<::fidl_test_transitivedependenciescompose::Top>
_client_end() const {
return ::fidl::UnownedClientEnd<
::fidl_test_transitivedependenciescompose::Top>(_channel());
}
};
template <>
class ::fidl::internal::WireSyncBufferClientImpl<
::fidl_test_transitivedependenciescompose::Top>
final : public ::fidl::internal::SyncEndpointBufferVeneer<
::fidl::internal::WireSyncBufferClientImpl<
::fidl_test_transitivedependenciescompose::Top>> {
public:
// Caller provides the backing storage for FIDL message via an argument to
// `.buffer()`.
::fidl::WireUnownedResult<
::fidl_test_transitivedependenciescompose::Top::GetFoo>
GetFoo() {
::fidl::WireRequest<::fidl_test_transitivedependenciescompose::Top::GetFoo>
_request{};
return ::fidl::WireUnownedResult<
::fidl_test_transitivedependenciescompose::Top::GetFoo>(
_client_end(), _allocator(), &_request);
}
private:
::fidl::UnownedClientEnd<::fidl_test_transitivedependenciescompose::Top>
_client_end() const {
return ::fidl::UnownedClientEnd<
::fidl_test_transitivedependenciescompose::Top>(_channel());
}
};
template <>
class ::fidl::internal::WireEventHandlerInterface<
::fidl_test_transitivedependenciescompose::Top> {
public:
WireEventHandlerInterface() = default;
virtual ~WireEventHandlerInterface() = default;
};
template <>
class ::fidl::WireAsyncEventHandler<
::fidl_test_transitivedependenciescompose::Top>
: public ::fidl::internal::WireEventHandlerInterface<
::fidl_test_transitivedependenciescompose::Top>,
public ::fidl::internal::AsyncEventHandler {
public:
WireAsyncEventHandler() = default;
};
template <>
class ::fidl::WireSyncEventHandler<
::fidl_test_transitivedependenciescompose::Top>
: public ::fidl::internal::WireEventHandlerInterface<
::fidl_test_transitivedependenciescompose::Top> {
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_transitivedependenciescompose::Top>
client_end);
};
template <>
class ::fidl::WireSyncClient<::fidl_test_transitivedependenciescompose::Top>
final : public ::fidl::internal::WireSyncClientBase<
::fidl_test_transitivedependenciescompose::Top> {
public:
using ::fidl::internal::WireSyncClientBase<
::fidl_test_transitivedependenciescompose::Top>::WireSyncClientBase;
};
template <>
class ::fidl::internal::WireCompleterBase<
::fidl_test_transitivedependenciescompose::Top::GetFoo>
: 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 ::bottom::wire::Foo& foo);
::fidl::Result Reply(::fidl::BufferSpan _buffer,
const ::bottom::wire::Foo& foo);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
template <>
struct ::fidl::internal::WireMethodTypes<
::fidl_test_transitivedependenciescompose::Top::GetFoo> {
using Completer = fidl::Completer<::fidl::internal::WireCompleterBase<
::fidl_test_transitivedependenciescompose::Top::GetFoo>>;
};
// 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_transitivedependenciescompose::Top>
: public ::fidl::internal::IncomingMessageDispatcher {
public:
WireServer() = default;
virtual ~WireServer() = default;
// The FIDL protocol type that is implemented by this server.
using _EnclosingProtocol = ::fidl_test_transitivedependenciescompose::Top;
using _Transport = ::fidl::internal::ChannelTransport;
using GetFooCompleter = ::fidl::internal::WireCompleter<
::fidl_test_transitivedependenciescompose::Top::GetFoo>;
using GetFooRequestView = ::fidl::internal::WireRequestView<
::fidl_test_transitivedependenciescompose::Top::GetFoo>;
virtual void GetFoo(GetFooRequestView request,
GetFooCompleter::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_transitivedependenciescompose::Top::GetFoo>>
: public std::true_type {};
template <>
struct IsFidlMessage<
::fidl::WireRequest<::fidl_test_transitivedependenciescompose::Top::GetFoo>>
: public std::true_type {};
static_assert(
sizeof(::fidl::WireRequest<
::fidl_test_transitivedependenciescompose::Top::GetFoo>) ==
::fidl::WireRequest<
::fidl_test_transitivedependenciescompose::Top::GetFoo>::PrimarySize);
template <>
struct IsFidlType<::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>>
: public std::true_type {};
template <>
struct IsFidlMessage<::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>>
: public std::true_type {};
static_assert(
sizeof(::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>) ==
::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>::PrimarySize);
static_assert(
offsetof(::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>,
foo) == 16);
} // namespace fidl
#ifdef __Fuchsia__
template <>
class ::fidl::WireResponseContext<
::fidl_test_transitivedependenciescompose::Top::GetFoo>
: public ::fidl::internal::ResponseContext {
public:
WireResponseContext();
virtual void OnResult(
::fidl::WireUnownedResult<
::fidl_test_transitivedependenciescompose::Top::GetFoo>& 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_transitivedependenciescompose::Top>
final : public ::fidl::internal::ClientBase {
public:
// Asynchronous variant of |Top.GetFoo()|.
// Allocates 16 bytes of request buffer on the stack. The callback is stored
// on the heap.
void GetFoo(::fidl::WireClientCallback<
::fidl_test_transitivedependenciescompose::Top::GetFoo>
_cb);
void GetFoo(::fit::callback<
void(::fidl::WireResponse<
::fidl_test_transitivedependenciescompose::Top::GetFoo>*
response)>
_cb);
// Asynchronous variant of |Top.GetFoo()|.
// 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 GetFoo(
::fidl::WireResponseContext<
::fidl_test_transitivedependenciescompose::Top::GetFoo>* _context);
// Synchronous variant of |GetFoo.GetFoo()|.
// Allocates 40 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::WireResult<::fidl_test_transitivedependenciescompose::Top::GetFoo>
GetFoo_Sync();
// Synchronous variant of |GetFoo.GetFoo()|.
// Caller provides the backing storage for FIDL message via request and
// response buffers.
::fidl::WireUnownedResult<
::fidl_test_transitivedependenciescompose::Top::GetFoo>
GetFoo_Sync(::fidl::BufferSpan _buffer_span);
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 Top protocol, and can send events in that protocol.
template <>
class ::fidl::WireEventSender<::fidl_test_transitivedependenciescompose::Top> {
public:
// Constructs an event sender with an invalid channel.
WireEventSender() = default;
explicit WireEventSender(
::fidl::ServerEnd<::fidl_test_transitivedependenciescompose::Top>
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_transitivedependenciescompose::Top>&
server_end() const {
return server_end_;
}
::fidl::ServerEnd<::fidl_test_transitivedependenciescompose::Top>&
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<::fidl_test_transitivedependenciescompose::Top> server_end_;
};
template <>
class ::fidl::internal::WireWeakEventSender<
::fidl_test_transitivedependenciescompose::Top> {
public:
WireWeakEventSender(
std::weak_ptr<::fidl::internal::AsyncServerBinding>&& binding)
: inner_(std::move(binding)) {}
private:
friend ServerBindingRef<::fidl_test_transitivedependenciescompose::Top,
::fidl::internal::ChannelTransport>;
::fidl::internal::WeakEventSenderInner inner_;
};
#endif // __Fuchsia__