| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #pragma once |
| |
| #include <fidl/test.handles/cpp/markers.h> |
| #include <fidl/test.handles/cpp/wire_types.h> |
| #include <lib/fidl/cpp/wire/wire_messaging.h> |
| |
| #ifdef __Fuchsia__ |
| |
| #include <lib/fidl/cpp/wire/client.h> |
| #include <lib/fidl/cpp/wire/connect_service.h> |
| #include <lib/fidl/cpp/wire/server.h> |
| #include <lib/fidl/cpp/wire/service_handler.h> |
| #include <lib/fidl/cpp/wire/sync_call.h> |
| #include <lib/fidl/cpp/wire/unknown_interaction_handler.h> |
| |
| #endif // __Fuchsia__ |
| |
| #include <fidl/fdf/cpp/wire_messaging.h> |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace test_handles { |
| |
| class SomeProtocol; |
| |
| } // namespace test_handles |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::ProtocolDetails<::test_handles::SomeProtocol> { |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::WireServerDispatcher<::test_handles::SomeProtocol> final { |
| WireServerDispatcher() = delete; |
| static ::fidl::DispatchResult TryDispatch(::fidl::WireServer<::test_handles::SomeProtocol>* impl, ::fidl::IncomingHeaderAndMessage& msg, |
| internal::MessageStorageViewBase* storage_view, |
| ::fidl::Transaction* txn); |
| static void Dispatch(::fidl::WireServer<::test_handles::SomeProtocol>* impl, ::fidl::IncomingHeaderAndMessage&& msg, |
| internal::MessageStorageViewBase* storage_view, |
| ::fidl::Transaction* txn); |
| |
| private: |
| static const ::fidl::internal::MethodEntry entries_[]; |
| static const ::fidl::internal::MethodEntry* entries_end_; |
| static constexpr const ::fidl::internal::UnknownMethodHandlerEntry& unknown_method_handler_entry_ = |
| ::fidl::internal::UnknownMethodHandlerEntry::kClosedProtocolHandlerEntry; |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| namespace fidl { |
| |
| #ifdef __Fuchsia__ |
| } // namespace fidl |
| |
| template <> |
| struct ::fidl::internal::IncomingEventsHandleStorage<::test_handles::SomeProtocol> final : public ::fidl::internal::ChannelHandleStorageBase<::fidl::internal::IncomingEventsHandleStorage<::test_handles::SomeProtocol>> { |
| public: |
| static constexpr uint32_t kNumHandles = 0; |
| |
| ::std::array<zx_handle_t, kNumHandles> handles_; |
| ::std::array<fidl_channel_handle_metadata_t, kNumHandles> handle_metadata_; |
| }; |
| |
| template <> |
| struct ::fidl::internal::IncomingEventsStorage<::test_handles::SomeProtocol> final : public ::fidl::internal::ChannelMessageStorageBase<::fidl::internal::IncomingEventsStorage<::test_handles::SomeProtocol>> { |
| public: |
| ::fidl::internal::InlineMessageBuffer<24> bytes_; |
| ::fidl::internal::IncomingEventsHandleStorage<::test_handles::SomeProtocol> handles_storage_; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireEventHandlerInterface<::test_handles::SomeProtocol> : public ::fidl::internal::BaseEventHandlerInterface { |
| public: |
| WireEventHandlerInterface() = default; |
| virtual ~WireEventHandlerInterface() = default; |
| }; |
| |
| template <> |
| class ::fidl::WireAsyncEventHandler<::test_handles::SomeProtocol> |
| : public ::fidl::internal::WireEventHandlerInterface<::test_handles::SomeProtocol>, public ::fidl::internal::AsyncEventHandler { |
| public: |
| WireAsyncEventHandler() = default; |
| }; |
| |
| template <> |
| class ::fidl::WireSyncEventHandler<::test_handles::SomeProtocol> |
| : public ::fidl::internal::WireEventHandlerInterface<::test_handles::SomeProtocol>, public ::fidl::internal::SyncEventHandler { |
| 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_handles::SomeProtocol> client_end); |
| }; |
| |
| template <> |
| class ::fidl::internal::WireEventDispatcher<::test_handles::SomeProtocol> final : public ::fidl::internal::IncomingEventDispatcher<::fidl::internal::WireEventHandlerInterface<::test_handles::SomeProtocol>> { |
| public: |
| explicit WireEventDispatcher(::fidl::internal::WireEventHandlerInterface<::test_handles::SomeProtocol>* event_handler) |
| : IncomingEventDispatcher(event_handler) {} |
| }; |
| |
| // Methods to make a sync FIDL call directly on an unowned handle or a |
| // const reference to a |::fidl::ClientEnd<::test_handles::SomeProtocol>|, |
| // avoiding setting up a client. |
| template <> |
| class ::fidl::internal::WireSyncClientImpl<::test_handles::SomeProtocol> final : public ::fidl::internal::SyncEndpointManagedVeneer<::fidl::internal::WireSyncClientImpl<::test_handles::SomeProtocol>> { |
| public: |
| private: |
| ::fidl::UnownedClientEnd<::test_handles::SomeProtocol> _client_end() const { |
| return ::fidl::UnownedClientEnd<::test_handles::SomeProtocol>( |
| _transport().get<::fidl::internal::ChannelTransport>()); |
| } |
| }; |
| |
| template <> |
| class ::fidl::internal::WireSyncBufferClientImpl<::test_handles::SomeProtocol> final : public ::fidl::internal::SyncEndpointBufferVeneer<::fidl::internal::WireSyncBufferClientImpl<::test_handles::SomeProtocol>> { |
| public: |
| private: |
| ::fidl::UnownedClientEnd<::test_handles::SomeProtocol> _client_end() const { |
| return ::fidl::UnownedClientEnd<::test_handles::SomeProtocol>( |
| _transport().get<::fidl::internal::ChannelTransport>()); |
| } |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| // This interface uses typed channels (i.e. |::fidl::ClientEnd<::test_handles::SomeProtocol>| |
| // and |::fidl::ServerEnd<::test_handles::SomeProtocol>|). |
| template <> |
| class ::fidl::WireServer<::test_handles::SomeProtocol> : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| WireServer() = default; |
| virtual ~WireServer() = default; |
| |
| // The FIDL protocol type that is implemented by this server. |
| using _EnclosingProtocol = ::test_handles::SomeProtocol; |
| |
| using Handler = fidl::ProtocolHandler<::test_handles::SomeProtocol>; |
| |
| // |bind_handler| returns a handler that binds incoming connections to this |
| // server implementation. |
| // |
| // The returned handler borrows the server instance. |
| // The server must outlive the provided |dispatcher|. Only after |
| // the dispatcher is shutdown will it be safe to destroy the servers. |
| // The server should not be moved. |
| Handler bind_handler(async_dispatcher_t* dispatcher) { |
| return [impl = this, dispatcher = dispatcher](::fidl::ServerEnd<::test_handles::SomeProtocol> request) { |
| (void)::fidl::BindServer(dispatcher, std::move(request), impl); |
| }; |
| } |
| |
| private: |
| void dispatch_message( |
| ::fidl::IncomingHeaderAndMessage&& msg, ::fidl::Transaction* txn, |
| ::fidl::internal::MessageStorageViewBase* storage_view) final; |
| }; |
| namespace fidl { |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| } // namespace fidl |
| |
| template <> |
| class ::fidl::internal::WireWeakOnewayClientImpl<::test_handles::SomeProtocol> : public ::fidl::internal::ClientImplBase { |
| public: |
| using ClientImplBase::ClientImplBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakAsyncClientImpl<::test_handles::SomeProtocol> final : public ::fidl::internal::WireWeakOnewayClientImpl<::test_handles::SomeProtocol> { |
| public: |
| using WireWeakOnewayClientImpl::WireWeakOnewayClientImpl; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakOnewayBufferClientImpl<::test_handles::SomeProtocol> : public ::fidl::internal::BufferClientImplBase { |
| public: |
| using BufferClientImplBase::BufferClientImplBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakAsyncBufferClientImpl<::test_handles::SomeProtocol> final : public ::fidl::internal::WireWeakOnewayBufferClientImpl<::test_handles::SomeProtocol> { |
| public: |
| using WireWeakOnewayBufferClientImpl::WireWeakOnewayBufferClientImpl; |
| }; |
| template <> |
| class ::fidl::internal::WireWeakSyncClientImpl<::test_handles::SomeProtocol> final : public ::fidl::internal::WireWeakOnewayClientImpl<::test_handles::SomeProtocol> { |
| public: |
| using WireWeakOnewayClientImpl::WireWeakOnewayClientImpl; |
| }; |
| namespace fidl { |
| |
| #endif // __Fuchsia__ |
| |
| } // namespace fidl |
| |
| #ifdef __Fuchsia__ |
| template <> |
| class ::fidl::internal::WireWeakEventSender<::test_handles::SomeProtocol> : public ::fidl::internal::WeakEventSenderBase { |
| public: |
| using WeakEventSenderBase::WeakEventSenderBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakBufferEventSender<::test_handles::SomeProtocol> : public ::fidl::internal::WeakBufferEventSenderBase { |
| public: |
| using WeakBufferEventSenderBase::WeakBufferEventSenderBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireEventSender<::test_handles::SomeProtocol> |
| : public ::fidl::internal::SyncEndpointManagedVeneer<::fidl::internal::WireEventSender<::test_handles::SomeProtocol>> { |
| public: |
| using SyncEndpointManagedVeneer::SyncEndpointManagedVeneer; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireBufferEventSender<::test_handles::SomeProtocol> |
| : public ::fidl::internal::SyncEndpointBufferVeneer<::fidl::internal::WireBufferEventSender<::test_handles::SomeProtocol>> { |
| public: |
| using SyncEndpointBufferVeneer::SyncEndpointBufferVeneer; |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #pragma clang diagnostic pop |