blob: 13acb906044ed6f2c01d79b1ebbe19b04c3f0663 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <fidl/fidl.test.errorsyntax/cpp/markers.h>
#include <fidl/fidl.test.errorsyntax/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/fidl.test.errorsyntax.parent/cpp/wire_messaging.h>
namespace fidl_test_errorsyntax {
class ExampleUseOfErrorSyntax;
__LOCAL extern "C" const fidl_type_t
fidl_test_errorsyntax_ExampleUseOfErrorSyntaxComposedCallWhichMayFailRequestMessageTable;
__LOCAL extern "C" const fidl_type_t
fidl_test_errorsyntax_ExampleUseOfErrorSyntaxComposedCallWhichMayFailResponseMessageTable;
__LOCAL extern "C" const fidl_type_t
fidl_test_errorsyntax_ExampleUseOfErrorSyntaxCallWhichMayFailRequestMessageTable;
__LOCAL extern "C" const fidl_type_t
fidl_test_errorsyntax_ExampleUseOfErrorSyntaxCallWhichMayFailResponseMessageTable;
} // namespace fidl_test_errorsyntax
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::ProtocolDetails<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax> {};
#endif // __Fuchsia__
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::WireServerDispatcher<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
final {
WireServerDispatcher() = delete;
static ::fidl::DispatchResult TryDispatch(
::fidl::WireServer<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>*
impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn);
static void Dispatch(
::fidl::WireServer<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>*
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_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>
final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl::StringView s;
explicit WireRequest(::fidl::StringView s) : s(s) { _InitHeader(); }
WireRequest() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl_test_errorsyntax::
fidl_test_errorsyntax_ExampleUseOfErrorSyntaxComposedCallWhichMayFailRequestMessageTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 32;
static constexpr uint32_t PrimarySizeV1 = 32;
static constexpr uint32_t MaxOutOfLine = 4294967295;
static constexpr uint32_t MaxOutOfLineV1 = 4294967295;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
using ResponseType =
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>;
class UnownedEncodedMessage;
class OwnedEncodedMessage;
public:
class DecodedMessage;
private:
void _InitHeader();
};
template <>
struct ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>
final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl_test_errorsyntax_parent::wire::
ParentUsesErrorSyntaxComposedCallWhichMayFailResult result;
explicit WireResponse(
::fidl_test_errorsyntax_parent::wire::
ParentUsesErrorSyntaxComposedCallWhichMayFailResult result)
: result(result) {
_InitHeader();
}
WireResponse() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl_test_errorsyntax::
fidl_test_errorsyntax_ExampleUseOfErrorSyntaxComposedCallWhichMayFailResponseMessageTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 32;
static constexpr uint32_t PrimarySizeV1 = 40;
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr uint32_t MaxOutOfLineV1 = 8;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
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_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl::StringView s;
explicit WireRequest(::fidl::StringView s) : s(s) { _InitHeader(); }
WireRequest() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl_test_errorsyntax::
fidl_test_errorsyntax_ExampleUseOfErrorSyntaxCallWhichMayFailRequestMessageTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 32;
static constexpr uint32_t PrimarySizeV1 = 32;
static constexpr uint32_t MaxOutOfLine = 4294967295;
static constexpr uint32_t MaxOutOfLineV1 = 4294967295;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
using ResponseType = ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>;
class UnownedEncodedMessage;
class OwnedEncodedMessage;
public:
class DecodedMessage;
private:
void _InitHeader();
};
template <>
struct ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
final {
using Result = fidl_test_errorsyntax::wire::
ExampleUseOfErrorSyntaxCallWhichMayFailResult;
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl_test_errorsyntax::wire::ExampleUseOfErrorSyntaxCallWhichMayFailResult
result;
explicit WireResponse(
::fidl_test_errorsyntax::wire::
ExampleUseOfErrorSyntaxCallWhichMayFailResult result)
: result(result) {
_InitHeader();
}
WireResponse() { _InitHeader(); }
static constexpr const fidl_type_t* Type =
&::fidl_test_errorsyntax::
fidl_test_errorsyntax_ExampleUseOfErrorSyntaxCallWhichMayFailResponseMessageTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 32;
static constexpr uint32_t PrimarySizeV1 = 40;
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr uint32_t MaxOutOfLineV1 = 8;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
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_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>
final : public ::fidl::Result {
public:
WireResult(
::fidl::UnownedClientEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
client,
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>* request);
WireResult(
::fidl::UnownedClientEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
client,
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>* 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_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*
Unwrap() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*>(bytes_.data());
}
const ::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*
Unwrap() const {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*>(bytes_.data());
}
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>&
value() {
return *Unwrap();
}
const ::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>&
value() const {
return *Unwrap();
}
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*
operator->() {
return &value();
}
const ::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*
operator->() const {
return &value();
}
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>&
operator*() {
return value();
}
const ::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>&
operator*() const {
return value();
}
private:
::fidl::internal::InlineMessageBuffer<48> bytes_;
};
template <>
class ::fidl::WireUnownedResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>
final : public ::fidl::Result {
public:
explicit WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
client_end,
::fidl::internal::AnyBufferAllocator& allocator,
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>* request);
explicit WireUnownedResult(
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>* response)
: bytes_(reinterpret_cast<uint8_t*>(response)) {}
explicit WireUnownedResult(const ::fidl::Result& result)
: ::fidl::Result(result) {}
explicit WireUnownedResult(
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>>&& 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_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*
Unwrap() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*>(bytes_);
}
const ::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*
Unwrap() const {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*>(bytes_);
}
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>&
value() {
return *Unwrap();
}
const ::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>&
value() const {
return *Unwrap();
}
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*
operator->() {
return &value();
}
const ::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>*
operator->() const {
return &value();
}
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>&
operator*() {
return value();
}
const ::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>&
operator*() const {
return value();
}
private:
uint8_t* bytes_;
};
template <>
class ::fidl::WireResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
final : public ::fidl::Result {
public:
WireResult(
::fidl::UnownedClientEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
client,
::fidl::WireRequest<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
request);
WireResult(
::fidl::UnownedClientEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
client,
::fidl::WireRequest<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
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_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
Unwrap() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*>(
bytes_.data());
}
const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
Unwrap() const {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*>(
bytes_.data());
}
::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>&
value() {
return *Unwrap();
}
const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>&
value() const {
return *Unwrap();
}
::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
operator->() {
return &value();
}
const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
operator->() const {
return &value();
}
::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>&
operator*() {
return value();
}
const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>&
operator*() const {
return value();
}
private:
::fidl::internal::InlineMessageBuffer<48> bytes_;
};
template <>
class ::fidl::WireUnownedResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
final : public ::fidl::Result {
public:
explicit WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
client_end,
::fidl::internal::AnyBufferAllocator& allocator,
::fidl::WireRequest<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
request);
explicit WireUnownedResult(
::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
response)
: bytes_(reinterpret_cast<uint8_t*>(response)) {}
explicit WireUnownedResult(const ::fidl::Result& result)
: ::fidl::Result(result) {}
explicit WireUnownedResult(
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>>&&
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_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
Unwrap() {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*>(
bytes_);
}
const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
Unwrap() const {
ZX_DEBUG_ASSERT(ok());
return reinterpret_cast<const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*>(
bytes_);
}
::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>&
value() {
return *Unwrap();
}
const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>&
value() const {
return *Unwrap();
}
::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
operator->() {
return &value();
}
const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
operator->() const {
return &value();
}
::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>&
operator*() {
return value();
}
const ::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>&
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_errorsyntax::ExampleUseOfErrorSyntax>|, avoiding
// setting up a client.
template <>
class ::fidl::internal::WireSyncClientImpl<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
final : public ::fidl::internal::SyncEndpointManagedVeneer<
::fidl::internal::WireSyncClientImpl<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>> {
public:
// Allocates 40 bytes of response buffer on the stack. Request is
// heap-allocated.
::fidl::WireResult<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>
ComposedCallWhichMayFail(::fidl::StringView s) {
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>
_request{s};
return ::fidl::WireResult<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>(_client_end(),
&_request);
}
// Allocates 40 bytes of response buffer on the stack. Request is
// heap-allocated.
::fidl::WireResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
CallWhichMayFail(::fidl::StringView s) {
::fidl::WireRequest<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
_request{s};
return ::fidl::WireResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>(
_client_end(), &_request);
}
private:
::fidl::UnownedClientEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
_client_end() const {
return ::fidl::UnownedClientEnd<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>(_channel());
}
};
template <>
class ::fidl::internal::WireSyncBufferClientImpl<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
final : public ::fidl::internal::SyncEndpointBufferVeneer<
::fidl::internal::WireSyncBufferClientImpl<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>> {
public:
// Caller provides the backing storage for FIDL message via an argument to
// `.buffer()`.
::fidl::WireUnownedResult<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>
ComposedCallWhichMayFail(::fidl::StringView s) {
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>
_request{s};
return ::fidl::WireUnownedResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>(_client_end(), _allocator(), &_request);
}
// Caller provides the backing storage for FIDL message via an argument to
// `.buffer()`.
::fidl::WireUnownedResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
CallWhichMayFail(::fidl::StringView s) {
::fidl::WireRequest<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
_request{s};
return ::fidl::WireUnownedResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>(
_client_end(), _allocator(), &_request);
}
private:
::fidl::UnownedClientEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
_client_end() const {
return ::fidl::UnownedClientEnd<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>(_channel());
}
};
template <>
class ::fidl::internal::WireEventHandlerInterface<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax> {
public:
WireEventHandlerInterface() = default;
virtual ~WireEventHandlerInterface() = default;
};
template <>
class ::fidl::WireAsyncEventHandler<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
: public ::fidl::internal::WireEventHandlerInterface<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>,
public ::fidl::internal::AsyncEventHandler {
public:
WireAsyncEventHandler() = default;
};
template <>
class ::fidl::WireSyncEventHandler<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
: public ::fidl::internal::WireEventHandlerInterface<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax> {
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_errorsyntax::ExampleUseOfErrorSyntax>
client_end);
};
template <>
class ::fidl::WireSyncClient<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
final : public ::fidl::internal::WireSyncClientBase<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax> {
public:
using ::fidl::internal::WireSyncClientBase<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>::WireSyncClientBase;
};
template <>
class ::fidl::internal::WireCompleterBase<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>
: 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(
::fidl_test_errorsyntax_parent::wire::
ParentUsesErrorSyntaxComposedCallWhichMayFailResult result);
::fidl::Result ReplySuccess(int64_t value);
::fidl::Result ReplyError(uint32_t error);
::fidl::Result Reply(
::fidl::BufferSpan _buffer,
::fidl_test_errorsyntax_parent::wire::
ParentUsesErrorSyntaxComposedCallWhichMayFailResult result);
::fidl::Result ReplySuccess(::fidl::BufferSpan _buffer, int64_t value);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
template <>
struct ::fidl::internal::WireMethodTypes<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail> {
using Completer = fidl::Completer<::fidl::internal::WireCompleterBase<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>>;
};
template <>
class ::fidl::internal::WireCompleterBase<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
: 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(
::fidl_test_errorsyntax::wire::
ExampleUseOfErrorSyntaxCallWhichMayFailResult result);
::fidl::Result ReplySuccess(int64_t value);
::fidl::Result ReplyError(uint32_t error);
::fidl::Result Reply(
::fidl::BufferSpan _buffer,
::fidl_test_errorsyntax::wire::
ExampleUseOfErrorSyntaxCallWhichMayFailResult result);
::fidl::Result ReplySuccess(::fidl::BufferSpan _buffer, int64_t value);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
template <>
struct ::fidl::internal::WireMethodTypes<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail> {
using Completer = fidl::Completer<::fidl::internal::WireCompleterBase<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>>;
};
// 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_errorsyntax::ExampleUseOfErrorSyntax>
: public ::fidl::internal::IncomingMessageDispatcher {
public:
WireServer() = default;
virtual ~WireServer() = default;
// The FIDL protocol type that is implemented by this server.
using _EnclosingProtocol = ::fidl_test_errorsyntax::ExampleUseOfErrorSyntax;
using _Transport = ::fidl::internal::ChannelTransport;
using ComposedCallWhichMayFailCompleter = ::fidl::internal::WireCompleter<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>;
using ComposedCallWhichMayFailRequestView = ::fidl::internal::WireRequestView<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>;
virtual void ComposedCallWhichMayFail(
ComposedCallWhichMayFailRequestView request,
ComposedCallWhichMayFailCompleter::Sync& _completer) = 0;
using CallWhichMayFailCompleter = ::fidl::internal::WireCompleter<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>;
using CallWhichMayFailRequestView = ::fidl::internal::WireRequestView<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>;
virtual void CallWhichMayFail(
CallWhichMayFailRequestView request,
CallWhichMayFailCompleter::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_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>>
: public std::true_type {};
template <>
struct IsFidlMessage<::fidl::WireRequest<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>>
: public std::true_type {};
static_assert(
sizeof(
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>) ==
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>::PrimarySize);
static_assert(
offsetof(
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>,
s) == 16);
template <>
struct IsFidlType<::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>>
: public std::true_type {};
template <>
struct IsFidlMessage<::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>>
: public std::true_type {};
static_assert(
sizeof(
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>) ==
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>::PrimarySize);
static_assert(
offsetof(
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>,
result) == 16);
template <>
struct IsFidlType<::fidl::WireRequest<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>>
: public std::true_type {};
template <>
struct IsFidlMessage<::fidl::WireRequest<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>>
: public std::true_type {};
static_assert(
sizeof(
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
CallWhichMayFail>) ==
::fidl::WireRequest<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
CallWhichMayFail>::PrimarySize);
static_assert(
offsetof(
::fidl::WireRequest<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>,
s) == 16);
template <>
struct IsFidlType<::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>>
: public std::true_type {};
template <>
struct IsFidlMessage<::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>>
: public std::true_type {};
static_assert(
sizeof(
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
CallWhichMayFail>) ==
::fidl::WireResponse<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
CallWhichMayFail>::PrimarySize);
static_assert(
offsetof(
::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>,
result) == 16);
} // namespace fidl
#ifdef __Fuchsia__
template <>
class ::fidl::WireResponseContext<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::ComposedCallWhichMayFail>
: public ::fidl::internal::ResponseContext {
public:
WireResponseContext();
virtual void OnResult(::fidl::WireUnownedResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>& result) = 0;
private:
::cpp17::optional<::fidl::UnbindInfo> OnRawResult(
::fidl::IncomingMessage&& msg,
const internal::IncomingTransportContext* transport_context) override;
};
#endif // __Fuchsia__
#ifdef __Fuchsia__
template <>
class ::fidl::WireResponseContext<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
: public ::fidl::internal::ResponseContext {
public:
WireResponseContext();
virtual void OnResult(
::fidl::WireUnownedResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>&
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_errorsyntax::ExampleUseOfErrorSyntax>
final : public ::fidl::internal::ClientBase {
public:
// Asynchronous variant of
// |ExampleUseOfErrorSyntax.ComposedCallWhichMayFail()|. The request and
// callback are allocated on the heap.
void ComposedCallWhichMayFail(
::fidl::StringView s,
::fidl::WireClientCallback<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>
_cb);
void ComposedCallWhichMayFail(
::fidl::StringView s,
::fit::callback<void(::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>* response)>
_cb);
// Asynchronous variant of
// |ExampleUseOfErrorSyntax.ComposedCallWhichMayFail()|. 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 ComposedCallWhichMayFail(
::fidl::BufferSpan _request_buffer, ::fidl::StringView s,
::fidl::WireResponseContext<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>* _context);
// Synchronous variant of
// |ComposedCallWhichMayFail.ComposedCallWhichMayFail()|.
// Allocates 40 bytes of response buffer on the stack. Request is
// heap-allocated.
::fidl::WireResult<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>
ComposedCallWhichMayFail_Sync(::fidl::StringView s);
// Synchronous variant of
// |ComposedCallWhichMayFail.ComposedCallWhichMayFail()|. Caller provides the
// backing storage for FIDL message via request and response buffers.
::fidl::WireUnownedResult<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
ComposedCallWhichMayFail>
ComposedCallWhichMayFail_Sync(::fidl::BufferSpan _buffer_span,
::fidl::StringView s);
// Asynchronous variant of |ExampleUseOfErrorSyntax.CallWhichMayFail()|.
// The request and callback are allocated on the heap.
void CallWhichMayFail(
::fidl::StringView s,
::fidl::WireClientCallback<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
_cb);
void CallWhichMayFail(
::fidl::StringView s,
::fit::callback<void(::fidl::WireResponse<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::
CallWhichMayFail>* response)>
_cb);
// Asynchronous variant of |ExampleUseOfErrorSyntax.CallWhichMayFail()|.
// 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 CallWhichMayFail(
::fidl::BufferSpan _request_buffer, ::fidl::StringView s,
::fidl::WireResponseContext<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>*
_context);
// Synchronous variant of |CallWhichMayFail.CallWhichMayFail()|.
// Allocates 40 bytes of response buffer on the stack. Request is
// heap-allocated.
::fidl::WireResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
CallWhichMayFail_Sync(::fidl::StringView s);
// Synchronous variant of |CallWhichMayFail.CallWhichMayFail()|.
// Caller provides the backing storage for FIDL message via request and
// response buffers.
::fidl::WireUnownedResult<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax::CallWhichMayFail>
CallWhichMayFail_Sync(::fidl::BufferSpan _buffer_span, ::fidl::StringView s);
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 ExampleUseOfErrorSyntax protocol, and can send events in that protocol.
template <>
class ::fidl::WireEventSender<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax> {
public:
// Constructs an event sender with an invalid channel.
WireEventSender() = default;
explicit WireEventSender(
::fidl::ServerEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>
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_errorsyntax::ExampleUseOfErrorSyntax>&
server_end() const {
return server_end_;
}
::fidl::ServerEnd<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax>&
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_errorsyntax::ExampleUseOfErrorSyntax>
server_end_;
};
template <>
class ::fidl::internal::WireWeakEventSender<
::fidl_test_errorsyntax::ExampleUseOfErrorSyntax> {
public:
WireWeakEventSender(
std::weak_ptr<::fidl::internal::AsyncServerBinding>&& binding)
: inner_(std::move(binding)) {}
private:
friend ServerBindingRef<::fidl_test_errorsyntax::ExampleUseOfErrorSyntax,
::fidl::internal::ChannelTransport>;
::fidl::internal::WeakEventSenderInner inner_;
};
#endif // __Fuchsia__