| // WARNING: This file is machine generated by fidlgen_llcpp. |
| |
| #pragma once |
| |
| #include <fidl/test.union/cpp/markers.h> |
| #include <fidl/test.union/cpp/natural_types.h> |
| #include <fidl/test.union/cpp/wire_messaging.h> |
| #include <lib/fidl/cpp/channel.h> |
| #include <lib/fidl/cpp/client.h> |
| #include <lib/fidl/cpp/internal/thenable.h> |
| #include <lib/fidl/cpp/natural_types.h> |
| #include <lib/fidl/cpp/unified_messaging.h> |
| |
| namespace fidl { |
| |
| } // namespace fidl |
| template <> |
| struct ::fidl::internal::NaturalMethodTypes<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> { |
| using Completer = fidl::Completer<::fidl::internal::NaturalCompleterBase<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>>; |
| |
| using ResultCallback = |
| ::fit::callback<void(::fidl::Result<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>&)>; |
| |
| static constexpr bool HasApplicationError = false; |
| static constexpr bool HasTransportError = false; |
| |
| static constexpr bool IsAbsentBody = false; |
| }; |
| |
| template <> |
| struct ::fidl::internal::NaturalMethodTypes<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> { |
| using Completer = fidl::Completer<::fidl::internal::NaturalCompleterBase<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated>>; |
| |
| using ResultCallback = |
| ::fit::callback<void(::fidl::Result<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated>&)>; |
| |
| static constexpr bool HasApplicationError = false; |
| static constexpr bool HasTransportError = false; |
| |
| static constexpr bool IsAbsentBody = false; |
| }; |
| |
| namespace test_union { |
| __LOCAL extern "C" const fidl_type_t test_union_TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponseTable; |
| |
| __LOCAL extern "C" const fidl_type_t test_union_TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponseTable; |
| |
| #ifdef __Fuchsia__ |
| } // namespace test_union |
| |
| template <> |
| class ::fidl::Response<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> final : public ::test_union::TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponse { |
| public: |
| using ::test_union::TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponse::TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponse; |
| Response(::test_union::TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponse v) : TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponse(std::move(v)) {} |
| }; |
| |
| template <> |
| struct ::fidl::internal::MessageTraits<::fidl::Response<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>> final { |
| public: |
| static constexpr bool kHasPayload = true; |
| using Payload = ::test_union::TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponse; |
| }; |
| namespace test_union {} // namespace test_union |
| template <> |
| class ::fidl::Result<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> final : public ::fitx::result<::fidl::Error, ::test_union::TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponse> { |
| public: |
| using ::fitx::result<::fidl::Error, ::test_union::TestProtocolStrictXUnionHenceResponseMayBeStackAllocatedTopResponse>::result; |
| |
| protected: |
| Result() = default; |
| }; |
| |
| template <> |
| class ::fidl::Response<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> final : public ::test_union::TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponse { |
| public: |
| using ::test_union::TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponse::TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponse; |
| Response(::test_union::TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponse v) : TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponse(std::move(v)) {} |
| }; |
| |
| template <> |
| struct ::fidl::internal::MessageTraits<::fidl::Response<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated>> final { |
| public: |
| static constexpr bool kHasPayload = true; |
| using Payload = ::test_union::TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponse; |
| }; |
| template <> |
| class ::fidl::Result<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> final : public ::fitx::result<::fidl::Error, ::test_union::TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponse> { |
| public: |
| using ::fitx::result<::fidl::Error, ::test_union::TestProtocolFlexibleXUnionHenceResponseMustBeHeapAllocatedTopResponse>::result; |
| |
| protected: |
| Result() = default; |
| }; |
| |
| template <> |
| class ::fidl::internal::NaturalClientImpl<::test_union::TestProtocol> final : public ::fidl::internal::NaturalClientBase { |
| public: |
| using NaturalClientBase::NaturalClientBase; |
| ::fidl::internal::NaturalThenable<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> StrictXUnionHenceResponseMayBeStackAllocated() const; |
| |
| ::fidl::internal::NaturalThenable<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> FlexibleXUnionHenceResponseMustBeHeapAllocated() const; |
| }; |
| namespace test_union { |
| #endif // __Fuchsia__ |
| |
| } // namespace test_union |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::NaturalSyncClientImpl<::test_union::TestProtocol> final |
| : public ::fidl::internal::SyncEndpointManagedVeneer<::fidl::internal::NaturalSyncClientImpl<::test_union::TestProtocol>> { |
| public: |
| ::fidl::Result<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> StrictXUnionHenceResponseMayBeStackAllocated(); |
| |
| ::fidl::Result<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> FlexibleXUnionHenceResponseMustBeHeapAllocated(); |
| |
| private: |
| ::fidl::UnownedClientEnd<::test_union::TestProtocol> _client_end() const { |
| return ::fidl::UnownedClientEnd<::test_union::TestProtocol>( |
| _transport().get<::fidl::internal::ChannelTransport>()); |
| } |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::NaturalEventHandlerInterface<::test_union::TestProtocol> : public ::fidl::internal::BaseEventHandlerInterface { |
| public: |
| NaturalEventHandlerInterface() = default; |
| virtual ~NaturalEventHandlerInterface() = default; |
| }; |
| |
| template <> |
| class ::fidl::AsyncEventHandler<::test_union::TestProtocol> |
| : public ::fidl::internal::NaturalEventHandlerInterface<::test_union::TestProtocol>, public ::fidl::internal::AsyncEventHandler { |
| public: |
| AsyncEventHandler() = default; |
| }; |
| |
| template <> |
| class ::fidl::SyncEventHandler<::test_union::TestProtocol> |
| : public ::fidl::internal::NaturalEventHandlerInterface<::test_union::TestProtocol>, public ::fidl::internal::SyncEventHandler { |
| public: |
| SyncEventHandler() = 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_union::TestProtocol> client_end); |
| }; |
| |
| template <> |
| class ::fidl::internal::NaturalEventDispatcher<::test_union::TestProtocol> final : public ::fidl::internal::IncomingEventDispatcher<::fidl::internal::NaturalEventHandlerInterface<::test_union::TestProtocol>> { |
| public: |
| explicit NaturalEventDispatcher(::fidl::internal::NaturalEventHandlerInterface<::test_union::TestProtocol>* event_handler) |
| : IncomingEventDispatcher(event_handler) {} |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| template <> |
| class ::fidl::internal::NaturalWeakEventSender<::test_union::TestProtocol> : public ::fidl::internal::WeakEventSenderBase { |
| public: |
| using WeakEventSenderBase::WeakEventSenderBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::NaturalEventSender<::test_union::TestProtocol> |
| : public ::fidl::internal::SyncEndpointManagedVeneer<::fidl::internal::NaturalEventSender<::test_union::TestProtocol>> { |
| public: |
| using SyncEndpointManagedVeneer::SyncEndpointManagedVeneer; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::Request<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> final { |
| public: |
| }; |
| |
| template <> |
| struct ::fidl::internal::MessageTraits<::fidl::Request<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>> final { |
| public: |
| static constexpr bool kHasPayload = false; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::Request<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> final { |
| public: |
| }; |
| |
| template <> |
| struct ::fidl::internal::MessageTraits<::fidl::Request<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated>> final { |
| public: |
| static constexpr bool kHasPayload = false; |
| }; |
| #endif // __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::NaturalCompleterBase<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated> : public ::fidl::CompleterBase { |
| public: |
| void Reply(::fidl::Response<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>&& response); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::NaturalCompleterBase<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated> : public ::fidl::CompleterBase { |
| public: |
| void Reply(::fidl::Response<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated>&& response); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| template <> |
| class ::fidl::Server<::test_union::TestProtocol> : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| Server() = default; |
| virtual ~Server() = default; |
| |
| // The FIDL protocol type that is implemented by this server. |
| using _EnclosingProtocol = ::test_union::TestProtocol; |
| |
| using StrictXUnionHenceResponseMayBeStackAllocatedRequest = ::fidl::Request<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>; |
| using StrictXUnionHenceResponseMayBeStackAllocatedCompleter = ::fidl::internal::NaturalCompleter<::test_union::TestProtocol::StrictXUnionHenceResponseMayBeStackAllocated>; |
| |
| virtual void StrictXUnionHenceResponseMayBeStackAllocated(StrictXUnionHenceResponseMayBeStackAllocatedRequest& request, StrictXUnionHenceResponseMayBeStackAllocatedCompleter::Sync& completer) = 0; |
| |
| using FlexibleXUnionHenceResponseMustBeHeapAllocatedRequest = ::fidl::Request<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated>; |
| using FlexibleXUnionHenceResponseMustBeHeapAllocatedCompleter = ::fidl::internal::NaturalCompleter<::test_union::TestProtocol::FlexibleXUnionHenceResponseMustBeHeapAllocated>; |
| |
| virtual void FlexibleXUnionHenceResponseMustBeHeapAllocated(FlexibleXUnionHenceResponseMustBeHeapAllocatedRequest& request, FlexibleXUnionHenceResponseMustBeHeapAllocatedCompleter::Sync& completer) = 0; |
| |
| private: |
| void dispatch_message( |
| ::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn, |
| ::fidl::internal::MessageStorageViewBase* storage_view) final; |
| }; |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::NaturalServerDispatcher<::test_union::TestProtocol> final { |
| NaturalServerDispatcher() = delete; |
| static void Dispatch(::fidl::Server<::test_union::TestProtocol>* impl, ::fidl::IncomingMessage&& msg, |
| internal::MessageStorageViewBase* storage_view, |
| ::fidl::Transaction* txn); |
| |
| private: |
| static const ::fidl::internal::MethodEntry entries_[]; |
| static const ::fidl::internal::MethodEntry* entries_end_; |
| }; |
| #endif // __Fuchsia__ |