| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <lib/fidl/internal.h> |
| #include <lib/fidl/txn_header.h> |
| #include <lib/fidl/llcpp/array.h> |
| #include <lib/fidl/llcpp/coding.h> |
| #include <lib/fidl/llcpp/connect_service.h> |
| #include <lib/fidl/llcpp/service_handler_interface.h> |
| #include <lib/fidl/llcpp/string_view.h> |
| #include <lib/fidl/llcpp/sync_call.h> |
| #include <lib/fidl/llcpp/traits.h> |
| #include <lib/fidl/llcpp/transaction.h> |
| #include <lib/fidl/llcpp/vector_view.h> |
| #include <lib/fit/function.h> |
| #include <lib/zx/channel.h> |
| #include <zircon/fidl.h> |
| |
| #include <fuchsia/hardware/pty/llcpp/fidl.h> |
| |
| namespace llcpp { |
| |
| namespace fuchsia { |
| namespace hardware { |
| namespace virtioconsole { |
| |
| class Device; |
| |
| extern "C" const fidl_type_t v1_fuchsia_hardware_virtioconsole_DeviceGetChannelRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_virtioconsole_DeviceGetChannelResponseTable; |
| |
| class Device final { |
| Device() = delete; |
| public: |
| |
| struct GetChannelRequest final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::zx::channel req; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_hardware_virtioconsole_DeviceGetChannelRequestTable; |
| 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 bool ContainsUnion = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| }; |
| |
| |
| // Collection of return types of FIDL calls in this interface. |
| class ResultOf final { |
| ResultOf() = delete; |
| private: |
| class GetChannel_Impl final : private ::fidl::internal::StatusAndError { |
| using Super = ::fidl::internal::StatusAndError; |
| public: |
| GetChannel_Impl(::zx::unowned_channel _client_end, ::zx::channel req); |
| ~GetChannel_Impl() = default; |
| GetChannel_Impl(GetChannel_Impl&& other) = default; |
| GetChannel_Impl& operator=(GetChannel_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| }; |
| |
| public: |
| using GetChannel = GetChannel_Impl; |
| }; |
| |
| // Collection of return types of FIDL calls in this interface, |
| // when the caller-allocate flavor or in-place call is used. |
| class UnownedResultOf final { |
| UnownedResultOf() = delete; |
| private: |
| class GetChannel_Impl final : private ::fidl::internal::StatusAndError { |
| using Super = ::fidl::internal::StatusAndError; |
| public: |
| GetChannel_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::channel req); |
| ~GetChannel_Impl() = default; |
| GetChannel_Impl(GetChannel_Impl&& other) = default; |
| GetChannel_Impl& operator=(GetChannel_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| }; |
| |
| public: |
| using GetChannel = GetChannel_Impl; |
| }; |
| |
| class SyncClient final { |
| public: |
| explicit SyncClient(::zx::channel channel) : channel_(std::move(channel)) {} |
| ~SyncClient() = default; |
| SyncClient(SyncClient&&) = default; |
| SyncClient& operator=(SyncClient&&) = default; |
| |
| const ::zx::channel& channel() const { return channel_; } |
| |
| ::zx::channel* mutable_channel() { return &channel_; } |
| |
| // This API is temporary. It exists because devhost multiplexes |
| // fuchsia.io.File on top of the device connections, and |
| // fuchsia.hardware.pty.Device composes with that interface. Once |
| // the devhost stops the behavior, we can remove this interface and |
| // have virtio-console just serve fuchsia.hardware.pty.Device directly. |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation necessary. |
| ResultOf::GetChannel GetChannel(::zx::channel req); |
| |
| // This API is temporary. It exists because devhost multiplexes |
| // fuchsia.io.File on top of the device connections, and |
| // fuchsia.hardware.pty.Device composes with that interface. Once |
| // the devhost stops the behavior, we can remove this interface and |
| // have virtio-console just serve fuchsia.hardware.pty.Device directly. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| UnownedResultOf::GetChannel GetChannel(::fidl::BytePart _request_buffer, ::zx::channel req); |
| |
| private: |
| ::zx::channel channel_; |
| }; |
| |
| // Methods to make a sync FIDL call directly on an unowned channel, avoiding setting up a client. |
| class Call final { |
| Call() = delete; |
| public: |
| |
| // This API is temporary. It exists because devhost multiplexes |
| // fuchsia.io.File on top of the device connections, and |
| // fuchsia.hardware.pty.Device composes with that interface. Once |
| // the devhost stops the behavior, we can remove this interface and |
| // have virtio-console just serve fuchsia.hardware.pty.Device directly. |
| // Allocates 24 bytes of message buffer on the stack. No heap allocation necessary. |
| static ResultOf::GetChannel GetChannel(::zx::unowned_channel _client_end, ::zx::channel req); |
| |
| // This API is temporary. It exists because devhost multiplexes |
| // fuchsia.io.File on top of the device connections, and |
| // fuchsia.hardware.pty.Device composes with that interface. Once |
| // the devhost stops the behavior, we can remove this interface and |
| // have virtio-console just serve fuchsia.hardware.pty.Device directly. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| static UnownedResultOf::GetChannel GetChannel(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::channel req); |
| |
| }; |
| |
| // Messages are encoded and decoded in-place when these methods are used. |
| // Additionally, requests must be already laid-out according to the FIDL wire-format. |
| class InPlace final { |
| InPlace() = delete; |
| public: |
| |
| // This API is temporary. It exists because devhost multiplexes |
| // fuchsia.io.File on top of the device connections, and |
| // fuchsia.hardware.pty.Device composes with that interface. Once |
| // the devhost stops the behavior, we can remove this interface and |
| // have virtio-console just serve fuchsia.hardware.pty.Device directly. |
| static ::fidl::internal::StatusAndError GetChannel(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<GetChannelRequest> params); |
| |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| class Interface { |
| public: |
| Interface() = default; |
| virtual ~Interface() = default; |
| using _Outer = Device; |
| using _Base = ::fidl::CompleterBase; |
| |
| using GetChannelCompleter = ::fidl::Completer<>; |
| |
| virtual void GetChannel(::zx::channel req, GetChannelCompleter::Sync _completer) = 0; |
| |
| }; |
| |
| // 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 bool TryDispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn); |
| |
| // Dispatches the incoming message to one of the handlers functions in the interface. |
| // 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 bool Dispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn); |
| |
| // Same as |Dispatch|, but takes a |void*| instead of |Interface*|. Only used with |fidl::Bind| |
| // to reduce template expansion. |
| // Do not call this method manually. Use |Dispatch| instead. |
| static bool TypeErasedDispatch(void* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) { |
| return Dispatch(static_cast<Interface*>(impl), msg, txn); |
| } |
| |
| |
| // Helper functions to fill in the transaction header in a |DecodedMessage<TransactionalMessage>|. |
| class SetTransactionHeaderFor final { |
| SetTransactionHeaderFor() = delete; |
| public: |
| static void GetChannelRequest(const ::fidl::DecodedMessage<Device::GetChannelRequest>& _msg); |
| }; |
| }; |
| |
| } // namespace virtioconsole |
| } // namespace hardware |
| } // namespace fuchsia |
| } // namespace llcpp |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::hardware::virtioconsole::Device::GetChannelRequest> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fuchsia::hardware::virtioconsole::Device::GetChannelRequest> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fuchsia::hardware::virtioconsole::Device::GetChannelRequest) |
| == ::llcpp::fuchsia::hardware::virtioconsole::Device::GetChannelRequest::PrimarySize); |
| static_assert(offsetof(::llcpp::fuchsia::hardware::virtioconsole::Device::GetChannelRequest, req) == 16); |
| |
| } // namespace fidl |