| // WARNING: This file is machine generated by fidlgen_llcpp. |
| |
| #pragma once |
| |
| #include <fidl/test.anonymous/cpp/markers.h> |
| #include <fidl/test.anonymous/cpp/natural_types.h> |
| #include <fidl/test.anonymous/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_anonymous::SomeProtocol::SomeMethod> { |
| using Completer = fidl::Completer<::fidl::internal::NaturalCompleterBase<::test_anonymous::SomeProtocol::SomeMethod>>; |
| |
| using ResultCallback = |
| ::fit::callback<void(::fidl::Result<::test_anonymous::SomeProtocol::SomeMethod>&)>; |
| |
| static constexpr bool HasApplicationError = true; |
| static constexpr bool HasTransportError = false; |
| |
| static constexpr bool IsEmptyStructPayload = false; |
| |
| static constexpr bool IsAbsentBody = false; |
| }; |
| namespace test_anonymous { |
| __LOCAL extern "C" const fidl_type_t test_anonymous_SomeProtocolSomeMethodRequestTable; |
| __LOCAL extern "C" const fidl_type_t test_anonymous_SomeProtocolSomeMethodTopResponseTable; |
| |
| #ifdef __Fuchsia__ |
| } // namespace test_anonymous |
| |
| template <> |
| class ::fidl::Response<::test_anonymous::SomeProtocol::SomeMethod> final : public ::fitx::result<::test_anonymous::SomeProtocolSomeMethodError, ::test_anonymous::SomeProtocolSomeMethodResponse> { |
| public: |
| using ::fitx::result<::test_anonymous::SomeProtocolSomeMethodError, ::test_anonymous::SomeProtocolSomeMethodResponse>::result; |
| Response(::fitx::result<::test_anonymous::SomeProtocolSomeMethodError, ::test_anonymous::SomeProtocolSomeMethodResponse> v) : result(std::move(v)) {} |
| Response() = delete; |
| }; |
| |
| template <> |
| struct ::fidl::internal::MessageTraits<::fidl::Response<::test_anonymous::SomeProtocol::SomeMethod>> final { |
| public: |
| static constexpr bool kHasPayload = true; |
| using Payload = ::test_anonymous::SomeProtocolSomeMethodTopResponse; |
| }; |
| template <> |
| class ::fidl::internal::NaturalMessageConverter<::fidl::Response<::test_anonymous::SomeProtocol::SomeMethod>> { |
| using DomainObject = ::test_anonymous::SomeProtocolSomeMethodTopResponse; |
| |
| public: |
| static ::fidl::Response<::test_anonymous::SomeProtocol::SomeMethod> FromDomainObject(DomainObject o) { |
| if (o.result().err().has_value()) { |
| return ::fitx::error(std::move(o.result().err().value())); |
| } else { |
| ZX_DEBUG_ASSERT(o.result().response().has_value()); |
| return ::fitx::ok(std::move(o.result().response().value())); |
| } |
| } |
| |
| static DomainObject IntoDomainObject(::fidl::Response<::test_anonymous::SomeProtocol::SomeMethod>&& m) { |
| if (m.is_error()) { |
| return DomainObject{{.result = ::test_anonymous::SomeProtocolSomeMethodResult::WithErr(m.error_value())}}; |
| } else { |
| return DomainObject{{.result = ::test_anonymous::SomeProtocolSomeMethodResult::WithResponse(std::move(m.value()))}}; |
| } |
| } |
| }; |
| namespace test_anonymous {} // namespace test_anonymous |
| template <> |
| class ::fidl::Result<::test_anonymous::SomeProtocol::SomeMethod> final : public ::fitx::result<::fidl::AnyErrorIn<::test_anonymous::SomeProtocol::SomeMethod>, ::test_anonymous::SomeProtocolSomeMethodResponse> { |
| public: |
| using ::fitx::result<::fidl::AnyErrorIn<::test_anonymous::SomeProtocol::SomeMethod>, ::test_anonymous::SomeProtocolSomeMethodResponse>::result; |
| |
| protected: |
| Result() = default; |
| }; |
| |
| template <> |
| class ::fidl::internal::NaturalClientImpl<::test_anonymous::SomeProtocol> final : public ::fidl::internal::NaturalClientBase { |
| public: |
| using NaturalClientBase::NaturalClientBase; |
| ::fidl::internal::NaturalThenable<::test_anonymous::SomeProtocol::SomeMethod> SomeMethod(::fidl::Request<::test_anonymous::SomeProtocol::SomeMethod> request) const; |
| }; |
| namespace test_anonymous { |
| #endif // __Fuchsia__ |
| |
| } // namespace test_anonymous |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::NaturalSyncClientImpl<::test_anonymous::SomeProtocol> final |
| : public ::fidl::internal::SyncEndpointManagedVeneer<::fidl::internal::NaturalSyncClientImpl<::test_anonymous::SomeProtocol>> { |
| public: |
| ::fidl::Result<::test_anonymous::SomeProtocol::SomeMethod> SomeMethod(::fidl::Request<::test_anonymous::SomeProtocol::SomeMethod> request); |
| |
| private: |
| ::fidl::UnownedClientEnd<::test_anonymous::SomeProtocol> _client_end() const { |
| return ::fidl::UnownedClientEnd<::test_anonymous::SomeProtocol>( |
| _transport().get<::fidl::internal::ChannelTransport>()); |
| } |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::NaturalEventHandlerInterface<::test_anonymous::SomeProtocol> : public ::fidl::internal::BaseEventHandlerInterface { |
| public: |
| NaturalEventHandlerInterface() = default; |
| virtual ~NaturalEventHandlerInterface() = default; |
| }; |
| |
| template <> |
| class ::fidl::AsyncEventHandler<::test_anonymous::SomeProtocol> |
| : public ::fidl::internal::NaturalEventHandlerInterface<::test_anonymous::SomeProtocol>, public ::fidl::internal::AsyncEventHandler { |
| public: |
| AsyncEventHandler() = default; |
| }; |
| |
| template <> |
| class ::fidl::SyncEventHandler<::test_anonymous::SomeProtocol> |
| : public ::fidl::internal::NaturalEventHandlerInterface<::test_anonymous::SomeProtocol>, 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_anonymous::SomeProtocol> client_end); |
| }; |
| |
| template <> |
| class ::fidl::internal::NaturalEventDispatcher<::test_anonymous::SomeProtocol> final : public ::fidl::internal::IncomingEventDispatcher<::fidl::internal::NaturalEventHandlerInterface<::test_anonymous::SomeProtocol>> { |
| public: |
| explicit NaturalEventDispatcher(::fidl::internal::NaturalEventHandlerInterface<::test_anonymous::SomeProtocol>* event_handler) |
| : IncomingEventDispatcher(event_handler) {} |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| template <> |
| class ::fidl::internal::NaturalWeakEventSender<::test_anonymous::SomeProtocol> : public ::fidl::internal::WeakEventSenderBase { |
| public: |
| using WeakEventSenderBase::WeakEventSenderBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::NaturalEventSender<::test_anonymous::SomeProtocol> |
| : public ::fidl::internal::SyncEndpointManagedVeneer<::fidl::internal::NaturalEventSender<::test_anonymous::SomeProtocol>> { |
| public: |
| using SyncEndpointManagedVeneer::SyncEndpointManagedVeneer; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::Request<::test_anonymous::SomeProtocol::SomeMethod> final : public ::test_anonymous::SomeProtocolSomeMethodRequest { |
| public: |
| using ::test_anonymous::SomeProtocolSomeMethodRequest::SomeProtocolSomeMethodRequest; |
| Request(::test_anonymous::SomeProtocolSomeMethodRequest v) : ::test_anonymous::SomeProtocolSomeMethodRequest(std::move(v)) {} |
| }; |
| |
| template <> |
| struct ::fidl::internal::MessageTraits<::fidl::Request<::test_anonymous::SomeProtocol::SomeMethod>> final { |
| public: |
| static constexpr bool kHasPayload = true; |
| using Payload = ::test_anonymous::SomeProtocolSomeMethodRequest; |
| }; |
| #endif // __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::NaturalCompleterBase<::test_anonymous::SomeProtocol::SomeMethod> : public ::fidl::CompleterBase { |
| public: |
| void Reply(::fidl::Response<::test_anonymous::SomeProtocol::SomeMethod>&& response); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| template <> |
| class ::fidl::Server<::test_anonymous::SomeProtocol> : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| Server() = default; |
| virtual ~Server() = default; |
| |
| // The FIDL protocol type that is implemented by this server. |
| using _EnclosingProtocol = ::test_anonymous::SomeProtocol; |
| |
| using SomeMethodRequest = ::fidl::Request<::test_anonymous::SomeProtocol::SomeMethod>; |
| using SomeMethodCompleter = ::fidl::internal::NaturalCompleter<::test_anonymous::SomeProtocol::SomeMethod>; |
| |
| virtual void SomeMethod(SomeMethodRequest& request, SomeMethodCompleter::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_anonymous::SomeProtocol> final { |
| NaturalServerDispatcher() = delete; |
| static void Dispatch(::fidl::Server<::test_anonymous::SomeProtocol>* 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__ |