blob: c5299b9c0fd469f57948bdf40bb69b3b455f66f8 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <fidl/test.placementofattributes/cpp/markers.h>
#include <fidl/test.placementofattributes/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/test.exampleusing/cpp/wire_messaging.h>
namespace test_placementofattributes {
class ExampleProtocol;
__LOCAL extern "C" const fidl_type_t
test_placementofattributes_ExampleProtocolMethodRequestTable;
} // namespace test_placementofattributes
template <>
struct ::fidl::internal::WireOrdinal<
::test_placementofattributes::ExampleProtocol::Method>
final {
static constexpr uint64_t value = 6023439637367187273lu;
};
namespace test_placementofattributes {} // namespace test_placementofattributes
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::ProtocolDetails<
::test_placementofattributes::ExampleProtocol> {};
#endif // __Fuchsia__
#ifdef __Fuchsia__
template <>
struct ::fidl::internal::WireServerDispatcher<
::test_placementofattributes::ExampleProtocol>
final {
WireServerDispatcher() = delete;
static ::fidl::DispatchResult TryDispatch(
::fidl::WireServer<::test_placementofattributes::ExampleProtocol>* impl,
::fidl::IncomingMessage& msg,
internal::IncomingTransportContext transport_context,
::fidl::Transaction* txn);
static void Dispatch(
::fidl::WireServer<::test_placementofattributes::ExampleProtocol>* impl,
::fidl::IncomingMessage&& msg,
internal::IncomingTransportContext transport_context,
::fidl::Transaction* txn);
private:
static const ::fidl::internal::MethodEntry entries_[];
static const ::fidl::internal::MethodEntry* entries_end_;
};
#endif // __Fuchsia__
template <>
struct ::fidl::WireRequest<
::test_placementofattributes::ExampleProtocol::Method>
final
: public ::test_placementofattributes::wire::ExampleProtocolMethodRequest {
explicit WireRequest(
::test_placementofattributes::wire::ExampleProtocolMethodRequest base)
: ::test_placementofattributes::wire::ExampleProtocolMethodRequest(
std::move(base)) {}
explicit WireRequest(const ::test_exampleusing::wire::Empty& arg)
: ::test_placementofattributes::wire::ExampleProtocolMethodRequest{
.arg = std::move(arg)} {}
WireRequest() = default;
};
template <>
struct ::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>
final {
FIDL_ALIGNDECL
fidl_message_header_t header;
::fidl::WireRequest<::test_placementofattributes::ExampleProtocol::Method>
body;
explicit TransactionalRequest(const ::test_exampleusing::wire::Empty& arg)
: body(::fidl::WireRequest<
::test_placementofattributes::ExampleProtocol::Method>(arg)) {
_InitHeader();
}
TransactionalRequest() { _InitHeader(); }
private:
void _InitHeader();
};
namespace fidl {
template <>
struct IsFidlType<::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>>
: public std::true_type {};
template <>
struct IsFidlType<
::fidl::WireRequest<::test_placementofattributes::ExampleProtocol::Method>>
: public std::true_type {};
template <>
struct IsFidlTransactionalMessage<::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>>
: public std::true_type {};
template <>
struct IsFidlTransactionalMessage<
::fidl::WireRequest<::test_placementofattributes::ExampleProtocol::Method>>
: public std::false_type {};
template <>
struct TypeTraits<::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>> {
static constexpr const fidl_type_t* kType =
&::test_placementofattributes::
test_placementofattributes_ExampleProtocolMethodRequestTable;
static constexpr uint32_t kMaxNumHandles = 0;
static constexpr uint32_t kPrimarySize =
FIDL_ALIGN(1 + sizeof(fidl_message_header_t));
static constexpr uint32_t kPrimarySizeV1 =
FIDL_ALIGN(1 + sizeof(fidl_message_header_t));
static constexpr uint32_t kMaxOutOfLine = 0;
static constexpr uint32_t kMaxOutOfLineV1 = 0;
static constexpr bool kHasFlexibleEnvelope = false;
static constexpr bool kHasPointer = false;
static constexpr ::fidl::internal::TransactionalMessageKind kMessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
};
static_assert(
sizeof(::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>) ==
TypeTraits<::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>>::kPrimarySize);
static_assert(
offsetof(::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>,
header) == 0);
static_assert(
offsetof(::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>,
body) == sizeof(fidl_message_header_t));
template <>
struct TypeTraits<::fidl::WireRequest<
::test_placementofattributes::ExampleProtocol::Method>> {
static constexpr const fidl_type_t* kType =
&::test_placementofattributes::
test_placementofattributes_ExampleProtocolMethodRequestTable;
static constexpr uint32_t kMaxNumHandles = 0;
static constexpr uint32_t kPrimarySize = 1;
static constexpr uint32_t kPrimarySizeV1 = 1;
static constexpr uint32_t kMaxOutOfLine = 0;
static constexpr uint32_t kMaxOutOfLineV1 = 0;
static constexpr bool kHasFlexibleEnvelope = false;
static constexpr bool kHasPointer = false;
static constexpr ::fidl::internal::TransactionalMessageKind kMessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
};
static_assert(
sizeof(::fidl::WireRequest<
::test_placementofattributes::ExampleProtocol::Method>) ==
TypeTraits<::fidl::WireRequest<
::test_placementofattributes::ExampleProtocol::Method>>::kPrimarySize);
static_assert(
offsetof(::fidl::WireRequest<
::test_placementofattributes::ExampleProtocol::Method>,
arg) == 0);
} // namespace fidl
namespace test_placementofattributes {
#ifdef __Fuchsia__
} // namespace test_placementofattributes
template <>
class [[nodiscard]] ::fidl::WireResult<
::test_placementofattributes::ExampleProtocol::Method>
final : public ::fidl::Status {
public:
WireResult(
::fidl::UnownedClientEnd<::test_placementofattributes::ExampleProtocol>
client,
::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>* request);
explicit WireResult(const ::fidl::Status& result) : ::fidl::Status(result) {}
WireResult(WireResult&&) = delete;
WireResult(const WireResult&) = delete;
WireResult* operator=(WireResult&&) = delete;
WireResult* operator=(const WireResult&) = delete;
~WireResult() = default;
private:
};
template <>
class [[nodiscard]] ::fidl::WireUnownedResult<
::test_placementofattributes::ExampleProtocol::Method>
final : public ::fidl::Status {
public:
explicit WireUnownedResult(
::fidl::UnownedClientEnd<::test_placementofattributes::ExampleProtocol>
client_end,
::fidl::internal::AnyBufferAllocator& allocator,
::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>* request);
explicit WireUnownedResult(const ::fidl::Status& result)
: ::fidl::Status(result) {}
WireUnownedResult(WireUnownedResult&&) = delete;
WireUnownedResult(const WireUnownedResult&) = delete;
WireUnownedResult* operator=(WireUnownedResult&&) = delete;
WireUnownedResult* operator=(const WireUnownedResult&) = delete;
~WireUnownedResult() = default;
};
template <>
class ::fidl::internal::WireEventHandlerInterface<
::test_placementofattributes::ExampleProtocol> {
public:
WireEventHandlerInterface() = default;
virtual ~WireEventHandlerInterface() = default;
};
template <>
class ::fidl::WireAsyncEventHandler<
::test_placementofattributes::ExampleProtocol>
: public ::fidl::internal::WireEventHandlerInterface<
::test_placementofattributes::ExampleProtocol>,
public ::fidl::internal::AsyncEventHandler {
public:
WireAsyncEventHandler() = default;
};
template <>
class ::fidl::WireSyncEventHandler<
::test_placementofattributes::ExampleProtocol>
: public ::fidl::internal::WireEventHandlerInterface<
::test_placementofattributes::ExampleProtocol> {
public:
WireSyncEventHandler() = default;
// Handle all possible events defined in this protocol.
// Blocks to consume exactly one message from the channel, then call the
// corresponding virtual method.
::fidl::Status HandleOneEvent(
::fidl::UnownedClientEnd<::test_placementofattributes::ExampleProtocol>
client_end);
private:
[[maybe_unused]] bool got_transitional_ = false;
};
template <>
class ::fidl::internal::WireEventDispatcher<
::test_placementofattributes::ExampleProtocol>
final : public ::fidl::internal::IncomingEventDispatcher<
::fidl::WireAsyncEventHandler<
::test_placementofattributes::ExampleProtocol>> {
public:
explicit WireEventDispatcher(
::fidl::WireAsyncEventHandler<
::test_placementofattributes::ExampleProtocol>* event_handler)
: IncomingEventDispatcher(event_handler) {}
private:
std::optional<::fidl::UnbindInfo> DispatchEvent(
::fidl::IncomingMessage& msg,
::fidl::internal::IncomingTransportContext transport_context) override;
};
// Methods to make a sync FIDL call directly on an unowned handle or a
// const reference to a
// |fidl::ClientEnd<::test_placementofattributes::ExampleProtocol>|, avoiding
// setting up a client.
template <>
class ::fidl::internal::WireSyncClientImpl<
::test_placementofattributes::ExampleProtocol>
final : public ::fidl::internal::SyncEndpointManagedVeneer<
::fidl::internal::WireSyncClientImpl<
::test_placementofattributes::ExampleProtocol>> {
public:
// Allocates 40 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::WireResult<::test_placementofattributes::ExampleProtocol::Method>
Method(const ::test_exampleusing::wire::Empty& arg) {
::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>
_request{arg};
return ::fidl::WireResult<
::test_placementofattributes::ExampleProtocol::Method>(_client_end(),
&_request);
}
private:
::fidl::UnownedClientEnd<::test_placementofattributes::ExampleProtocol>
_client_end() const {
return ::fidl::UnownedClientEnd<
::test_placementofattributes::ExampleProtocol>(
_transport().get<::fidl::internal::ChannelTransport>());
}
};
template <>
class ::fidl::internal::WireSyncBufferClientImpl<
::test_placementofattributes::ExampleProtocol>
final : public ::fidl::internal::SyncEndpointBufferVeneer<
::fidl::internal::WireSyncBufferClientImpl<
::test_placementofattributes::ExampleProtocol>> {
public:
// Caller provides the backing storage for FIDL message via an argument to
// `.buffer()`.
::fidl::WireUnownedResult<
::test_placementofattributes::ExampleProtocol::Method>
Method(const ::test_exampleusing::wire::Empty& arg) {
::fidl::internal::TransactionalRequest<
::test_placementofattributes::ExampleProtocol::Method>
_request{arg};
return ::fidl::WireUnownedResult<
::test_placementofattributes::ExampleProtocol::Method>(
_client_end(), _allocator(), &_request);
}
private:
::fidl::UnownedClientEnd<::test_placementofattributes::ExampleProtocol>
_client_end() const {
return ::fidl::UnownedClientEnd<
::test_placementofattributes::ExampleProtocol>(
_transport().get<::fidl::internal::ChannelTransport>());
}
};
// 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<::test_placementofattributes::ExampleProtocol>
: public ::fidl::internal::IncomingMessageDispatcher {
public:
WireServer() = default;
virtual ~WireServer() = default;
// The FIDL protocol type that is implemented by this server.
using _EnclosingProtocol = ::test_placementofattributes::ExampleProtocol;
using MethodCompleter = ::fidl::internal::WireCompleter<
::test_placementofattributes::ExampleProtocol::Method>;
using MethodRequestView = ::fidl::internal::WireRequestView<
::test_placementofattributes::ExampleProtocol::Method>;
virtual void Method(MethodRequestView request,
MethodCompleter::Sync& completer) = 0;
private:
void dispatch_message(
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn,
::fidl::internal::IncomingTransportContext transport_context) final;
};
namespace test_placementofattributes {
#endif // __Fuchsia__
} // namespace test_placementofattributes
namespace fidl {
#ifdef __Fuchsia__
} // namespace fidl
template <>
class ::fidl::internal::WireWeakOnewayClientImpl<
::test_placementofattributes::ExampleProtocol>
: public ::fidl::internal::ClientImplBase {
public:
using ClientImplBase::ClientImplBase;
// Allocates 40 bytes of message buffer on the stack. No heap allocation
// necessary.
::fidl::Status Method(const ::test_exampleusing::wire::Empty& arg);
};
template <>
class ::fidl::internal::WireWeakAsyncClientImpl<
::test_placementofattributes::ExampleProtocol>
final : public ::fidl::internal::WireWeakOnewayClientImpl<
::test_placementofattributes::ExampleProtocol> {
public:
using WireWeakOnewayClientImpl::WireWeakOnewayClientImpl;
};
template <>
class ::fidl::internal::WireWeakOnewayBufferClientImpl<
::test_placementofattributes::ExampleProtocol>
: public ::fidl::internal::BufferClientImplBase {
public:
using BufferClientImplBase::BufferClientImplBase;
// Caller provides the backing storage for FIDL message.
::fidl::Status Method(const ::test_exampleusing::wire::Empty& arg);
};
template <>
class ::fidl::internal::WireWeakAsyncBufferClientImpl<
::test_placementofattributes::ExampleProtocol>
final : public ::fidl::internal::WireWeakOnewayBufferClientImpl<
::test_placementofattributes::ExampleProtocol> {
public:
using WireWeakOnewayBufferClientImpl::WireWeakOnewayBufferClientImpl;
};
template <>
class ::fidl::internal::WireWeakSyncClientImpl<
::test_placementofattributes::ExampleProtocol>
final : public ::fidl::internal::WireWeakOnewayClientImpl<
::test_placementofattributes::ExampleProtocol> {
public:
using WireWeakOnewayClientImpl::WireWeakOnewayClientImpl;
};
namespace fidl {
#endif // __Fuchsia__
} // namespace fidl
#ifdef __Fuchsia__
template <>
class ::fidl::internal::WireWeakEventSender<
::test_placementofattributes::ExampleProtocol>
: public ::fidl::internal::WeakEventSenderBase {
public:
using WeakEventSenderBase::WeakEventSenderBase;
};
template <>
class ::fidl::internal::WireWeakBufferEventSender<
::test_placementofattributes::ExampleProtocol>
: public ::fidl::internal::WeakBufferEventSenderBase {
public:
using WeakBufferEventSenderBase::WeakBufferEventSenderBase;
};
template <>
class ::fidl::internal::WireEventSender<
::test_placementofattributes::ExampleProtocol>
: public ::fidl::internal::SyncEndpointManagedVeneer<
::fidl::internal::WireEventSender<
::test_placementofattributes::ExampleProtocol>> {
public:
using SyncEndpointManagedVeneer::SyncEndpointManagedVeneer;
};
template <>
class ::fidl::internal::WireBufferEventSender<
::test_placementofattributes::ExampleProtocol>
: public ::fidl::internal::SyncEndpointBufferVeneer<
::fidl::internal::WireBufferEventSender<
::test_placementofattributes::ExampleProtocol>> {
public:
using SyncEndpointBufferVeneer::SyncEndpointBufferVeneer;
};
#endif // __Fuchsia__