| // 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> |
| |
| namespace llcpp { |
| |
| namespace fidl { |
| namespace test { |
| namespace llcpp { |
| namespace controlflow { |
| |
| class ControlFlow; |
| |
| extern "C" const fidl_type_t v1_fidl_test_llcpp_controlflow_ControlFlowShutdownRequestTable; |
| extern "C" const fidl_type_t v1_fidl_test_llcpp_controlflow_ControlFlowShutdownResponseTable; |
| extern "C" const fidl_type_t v1_fidl_test_llcpp_controlflow_ControlFlowNoReplyMustSendAccessDeniedEpitaphRequestTable; |
| extern "C" const fidl_type_t v1_fidl_test_llcpp_controlflow_ControlFlowNoReplyMustSendAccessDeniedEpitaphResponseTable; |
| extern "C" const fidl_type_t v1_fidl_test_llcpp_controlflow_ControlFlowMustSendAccessDeniedEpitaphRequestTable; |
| extern "C" const fidl_type_t v1_fidl_test_llcpp_controlflow_ControlFlowMustSendAccessDeniedEpitaphResponseTable; |
| |
| // Interface for testing shutdown/epitaphs etc. |
| class ControlFlow final { |
| ControlFlow() = delete; |
| public: |
| |
| using ShutdownRequest = ::fidl::AnyZeroArgMessage; |
| |
| using NoReplyMustSendAccessDeniedEpitaphRequest = ::fidl::AnyZeroArgMessage; |
| |
| struct MustSendAccessDeniedEpitaphResponse final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| int32_t reply; |
| |
| static constexpr const fidl_type_t* Type = &v1_fidl_test_llcpp_controlflow_ControlFlowMustSendAccessDeniedEpitaphResponseTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 24; |
| static constexpr uint32_t MaxOutOfLine = 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::kResponse; |
| }; |
| using MustSendAccessDeniedEpitaphRequest = ::fidl::AnyZeroArgMessage; |
| |
| |
| // Collection of return types of FIDL calls in this interface. |
| class ResultOf final { |
| ResultOf() = delete; |
| private: |
| class Shutdown_Impl final : private ::fidl::internal::StatusAndError { |
| using Super = ::fidl::internal::StatusAndError; |
| public: |
| Shutdown_Impl(::zx::unowned_channel _client_end); |
| ~Shutdown_Impl() = default; |
| Shutdown_Impl(Shutdown_Impl&& other) = default; |
| Shutdown_Impl& operator=(Shutdown_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| }; |
| class NoReplyMustSendAccessDeniedEpitaph_Impl final : private ::fidl::internal::StatusAndError { |
| using Super = ::fidl::internal::StatusAndError; |
| public: |
| NoReplyMustSendAccessDeniedEpitaph_Impl(::zx::unowned_channel _client_end); |
| ~NoReplyMustSendAccessDeniedEpitaph_Impl() = default; |
| NoReplyMustSendAccessDeniedEpitaph_Impl(NoReplyMustSendAccessDeniedEpitaph_Impl&& other) = default; |
| NoReplyMustSendAccessDeniedEpitaph_Impl& operator=(NoReplyMustSendAccessDeniedEpitaph_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| }; |
| template <typename ResponseType> |
| class MustSendAccessDeniedEpitaph_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>; |
| public: |
| MustSendAccessDeniedEpitaph_Impl(::zx::unowned_channel _client_end); |
| ~MustSendAccessDeniedEpitaph_Impl() = default; |
| MustSendAccessDeniedEpitaph_Impl(MustSendAccessDeniedEpitaph_Impl&& other) = default; |
| MustSendAccessDeniedEpitaph_Impl& operator=(MustSendAccessDeniedEpitaph_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| |
| public: |
| using Shutdown = Shutdown_Impl; |
| using NoReplyMustSendAccessDeniedEpitaph = NoReplyMustSendAccessDeniedEpitaph_Impl; |
| using MustSendAccessDeniedEpitaph = MustSendAccessDeniedEpitaph_Impl<MustSendAccessDeniedEpitaphResponse>; |
| }; |
| |
| // 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 Shutdown_Impl final : private ::fidl::internal::StatusAndError { |
| using Super = ::fidl::internal::StatusAndError; |
| public: |
| Shutdown_Impl(::zx::unowned_channel _client_end); |
| ~Shutdown_Impl() = default; |
| Shutdown_Impl(Shutdown_Impl&& other) = default; |
| Shutdown_Impl& operator=(Shutdown_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| }; |
| class NoReplyMustSendAccessDeniedEpitaph_Impl final : private ::fidl::internal::StatusAndError { |
| using Super = ::fidl::internal::StatusAndError; |
| public: |
| NoReplyMustSendAccessDeniedEpitaph_Impl(::zx::unowned_channel _client_end); |
| ~NoReplyMustSendAccessDeniedEpitaph_Impl() = default; |
| NoReplyMustSendAccessDeniedEpitaph_Impl(NoReplyMustSendAccessDeniedEpitaph_Impl&& other) = default; |
| NoReplyMustSendAccessDeniedEpitaph_Impl& operator=(NoReplyMustSendAccessDeniedEpitaph_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| }; |
| template <typename ResponseType> |
| class MustSendAccessDeniedEpitaph_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>; |
| public: |
| MustSendAccessDeniedEpitaph_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer); |
| ~MustSendAccessDeniedEpitaph_Impl() = default; |
| MustSendAccessDeniedEpitaph_Impl(MustSendAccessDeniedEpitaph_Impl&& other) = default; |
| MustSendAccessDeniedEpitaph_Impl& operator=(MustSendAccessDeniedEpitaph_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| |
| public: |
| using Shutdown = Shutdown_Impl; |
| using NoReplyMustSendAccessDeniedEpitaph = NoReplyMustSendAccessDeniedEpitaph_Impl; |
| using MustSendAccessDeniedEpitaph = MustSendAccessDeniedEpitaph_Impl<MustSendAccessDeniedEpitaphResponse>; |
| }; |
| |
| 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_; } |
| |
| // Shutdown the server without a reply. |
| // The server should unbind the channel from the dispatch loop, closing it. |
| // Allocates 16 bytes of message buffer on the stack. No heap allocation necessary. |
| ResultOf::Shutdown Shutdown(); |
| |
| |
| // Calling this method generates no reply and a epitaph with error set to |
| // `ZX_ERR_ACCESS_DENIED`. The channel will then be closed. |
| // This tests sending an epitaph from the one-way method call handler. |
| // Allocates 16 bytes of message buffer on the stack. No heap allocation necessary. |
| ResultOf::NoReplyMustSendAccessDeniedEpitaph NoReplyMustSendAccessDeniedEpitaph(); |
| |
| |
| // Despite the fact that a reply was defined in the method signature, |
| // Calling this method generates no reply and a epitaph with error set to |
| // `ZX_ERR_ACCESS_DENIED`. The channel will then be closed. |
| // This tests sending an epitaph from a normal (two-way) method call handler. |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation necessary. |
| ResultOf::MustSendAccessDeniedEpitaph MustSendAccessDeniedEpitaph(); |
| |
| // Despite the fact that a reply was defined in the method signature, |
| // Calling this method generates no reply and a epitaph with error set to |
| // `ZX_ERR_ACCESS_DENIED`. The channel will then be closed. |
| // This tests sending an epitaph from a normal (two-way) method call handler. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| UnownedResultOf::MustSendAccessDeniedEpitaph MustSendAccessDeniedEpitaph(::fidl::BytePart _response_buffer); |
| |
| 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: |
| |
| // Shutdown the server without a reply. |
| // The server should unbind the channel from the dispatch loop, closing it. |
| // Allocates 16 bytes of message buffer on the stack. No heap allocation necessary. |
| static ResultOf::Shutdown Shutdown(::zx::unowned_channel _client_end); |
| |
| |
| // Calling this method generates no reply and a epitaph with error set to |
| // `ZX_ERR_ACCESS_DENIED`. The channel will then be closed. |
| // This tests sending an epitaph from the one-way method call handler. |
| // Allocates 16 bytes of message buffer on the stack. No heap allocation necessary. |
| static ResultOf::NoReplyMustSendAccessDeniedEpitaph NoReplyMustSendAccessDeniedEpitaph(::zx::unowned_channel _client_end); |
| |
| |
| // Despite the fact that a reply was defined in the method signature, |
| // Calling this method generates no reply and a epitaph with error set to |
| // `ZX_ERR_ACCESS_DENIED`. The channel will then be closed. |
| // This tests sending an epitaph from a normal (two-way) method call handler. |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation necessary. |
| static ResultOf::MustSendAccessDeniedEpitaph MustSendAccessDeniedEpitaph(::zx::unowned_channel _client_end); |
| |
| // Despite the fact that a reply was defined in the method signature, |
| // Calling this method generates no reply and a epitaph with error set to |
| // `ZX_ERR_ACCESS_DENIED`. The channel will then be closed. |
| // This tests sending an epitaph from a normal (two-way) method call handler. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| static UnownedResultOf::MustSendAccessDeniedEpitaph MustSendAccessDeniedEpitaph(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer); |
| |
| }; |
| |
| // 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: |
| |
| // Shutdown the server without a reply. |
| // The server should unbind the channel from the dispatch loop, closing it. |
| static ::fidl::internal::StatusAndError Shutdown(::zx::unowned_channel _client_end); |
| |
| // Calling this method generates no reply and a epitaph with error set to |
| // `ZX_ERR_ACCESS_DENIED`. The channel will then be closed. |
| // This tests sending an epitaph from the one-way method call handler. |
| static ::fidl::internal::StatusAndError NoReplyMustSendAccessDeniedEpitaph(::zx::unowned_channel _client_end); |
| |
| // Despite the fact that a reply was defined in the method signature, |
| // Calling this method generates no reply and a epitaph with error set to |
| // `ZX_ERR_ACCESS_DENIED`. The channel will then be closed. |
| // This tests sending an epitaph from a normal (two-way) method call handler. |
| static ::fidl::DecodeResult<MustSendAccessDeniedEpitaphResponse> MustSendAccessDeniedEpitaph(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer); |
| |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| class Interface { |
| public: |
| Interface() = default; |
| virtual ~Interface() = default; |
| using _Outer = ControlFlow; |
| using _Base = ::fidl::CompleterBase; |
| |
| using ShutdownCompleter = ::fidl::Completer<>; |
| |
| virtual void Shutdown(ShutdownCompleter::Sync _completer) = 0; |
| |
| using NoReplyMustSendAccessDeniedEpitaphCompleter = ::fidl::Completer<>; |
| |
| virtual void NoReplyMustSendAccessDeniedEpitaph(NoReplyMustSendAccessDeniedEpitaphCompleter::Sync _completer) = 0; |
| |
| class MustSendAccessDeniedEpitaphCompleterBase : public _Base { |
| public: |
| void Reply(int32_t reply); |
| void Reply(::fidl::BytePart _buffer, int32_t reply); |
| void Reply(::fidl::DecodedMessage<MustSendAccessDeniedEpitaphResponse> params); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| using MustSendAccessDeniedEpitaphCompleter = ::fidl::Completer<MustSendAccessDeniedEpitaphCompleterBase>; |
| |
| virtual void MustSendAccessDeniedEpitaph(MustSendAccessDeniedEpitaphCompleter::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 ShutdownRequest(const ::fidl::DecodedMessage<ControlFlow::ShutdownRequest>& _msg); |
| static void NoReplyMustSendAccessDeniedEpitaphRequest(const ::fidl::DecodedMessage<ControlFlow::NoReplyMustSendAccessDeniedEpitaphRequest>& _msg); |
| static void MustSendAccessDeniedEpitaphRequest(const ::fidl::DecodedMessage<ControlFlow::MustSendAccessDeniedEpitaphRequest>& _msg); |
| static void MustSendAccessDeniedEpitaphResponse(const ::fidl::DecodedMessage<ControlFlow::MustSendAccessDeniedEpitaphResponse>& _msg); |
| }; |
| }; |
| |
| } // namespace controlflow |
| } // namespace llcpp |
| } // namespace test |
| } // namespace fidl |
| } // namespace llcpp |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::llcpp::fidl::test::llcpp::controlflow::ControlFlow::MustSendAccessDeniedEpitaphResponse> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fidl::test::llcpp::controlflow::ControlFlow::MustSendAccessDeniedEpitaphResponse> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fidl::test::llcpp::controlflow::ControlFlow::MustSendAccessDeniedEpitaphResponse) |
| == ::llcpp::fidl::test::llcpp::controlflow::ControlFlow::MustSendAccessDeniedEpitaphResponse::PrimarySize); |
| static_assert(offsetof(::llcpp::fidl::test::llcpp::controlflow::ControlFlow::MustSendAccessDeniedEpitaphResponse, reply) == 16); |
| |
| } // namespace fidl |