| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #pragma once |
| |
| #include <fidl/test.driverhandle/cpp/markers.h> |
| #include <fidl/test.driverhandle/cpp/wire_types.h> |
| #include <lib/fidl_driver/cpp/wire_messaging.h> |
| |
| #ifdef __Fuchsia__ |
| |
| #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_driver/cpp/server.h> |
| #include <lib/fidl_driver/cpp/wire_client.h> |
| |
| #endif // __Fuchsia__ |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace test_driverhandle { |
| |
| class DriverProtocol; |
| |
| class HandlesInProtocol; |
| |
| } // namespace test_driverhandle |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::ProtocolDetails<::test_driverhandle::DriverProtocol> { |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::WireServerDispatcher<::test_driverhandle::DriverProtocol> final { |
| WireServerDispatcher() = delete; |
| static ::fidl::DispatchResult TryDispatch(::fdf::WireServer<::test_driverhandle::DriverProtocol>* impl, ::fidl::IncomingHeaderAndMessage& msg, |
| internal::MessageStorageViewBase* storage_view, |
| ::fidl::Transaction* txn); |
| static void Dispatch(::fdf::WireServer<::test_driverhandle::DriverProtocol>* 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 <> |
| class ::fidl::internal::WireEventHandlerInterface<::test_driverhandle::DriverProtocol> : public ::fidl::internal::BaseEventHandlerInterface { |
| public: |
| WireEventHandlerInterface() = default; |
| virtual ~WireEventHandlerInterface() = default; |
| }; |
| |
| template <> |
| class ::fdf::WireAsyncEventHandler<::test_driverhandle::DriverProtocol> |
| : public ::fidl::internal::WireEventHandlerInterface<::test_driverhandle::DriverProtocol>, public ::fidl::internal::AsyncEventHandler { |
| public: |
| WireAsyncEventHandler() = default; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireEventDispatcher<::test_driverhandle::DriverProtocol> final : public ::fidl::internal::IncomingEventDispatcher<::fidl::internal::WireEventHandlerInterface<::test_driverhandle::DriverProtocol>> { |
| public: |
| explicit WireEventDispatcher(::fidl::internal::WireEventHandlerInterface<::test_driverhandle::DriverProtocol>* event_handler) |
| : IncomingEventDispatcher(event_handler) {} |
| }; |
| |
| template <> |
| class ::fidl::internal::WireSyncBufferClientImpl<::test_driverhandle::DriverProtocol> final : public ::fdf::internal::SyncEndpointBufferVeneer<::fidl::internal::WireSyncBufferClientImpl<::test_driverhandle::DriverProtocol>> { |
| public: |
| private: |
| ::fdf::UnownedClientEnd<::test_driverhandle::DriverProtocol> _client_end() const { |
| return ::fdf::UnownedClientEnd<::test_driverhandle::DriverProtocol>( |
| _transport().get<::fidl::internal::DriverTransport>()); |
| } |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| // This interface uses typed channels (i.e. |::fdf::ClientEnd<::test_driverhandle::DriverProtocol>| |
| // and |::fdf::ServerEnd<::test_driverhandle::DriverProtocol>|). |
| template <> |
| class ::fdf::WireServer<::test_driverhandle::DriverProtocol> : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| WireServer() = default; |
| virtual ~WireServer() = default; |
| |
| // The FIDL protocol type that is implemented by this server. |
| using _EnclosingProtocol = ::test_driverhandle::DriverProtocol; |
| |
| using Handler = fidl::ProtocolHandler<::test_driverhandle::DriverProtocol>; |
| |
| // |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(fdf_dispatcher_t* dispatcher) { |
| return [impl = this, dispatcher = dispatcher](::fdf::ServerEnd<::test_driverhandle::DriverProtocol> request) { |
| (void)::fdf::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__ |
| |
| } // namespace fidl |
| |
| template <> |
| struct ::fidl::internal::WireOrdinal<::test_driverhandle::HandlesInProtocol::SendHandles> final { |
| static constexpr uint64_t value = 8904504160365833729lu; |
| }; |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::WireMethodTypes<::test_driverhandle::HandlesInProtocol::SendHandles> { |
| static constexpr bool HasRequestPayload = true; |
| using Request = ::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest; |
| |
| using Completer = fidl::Completer<>; |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| namespace test_driverhandle { |
| |
| } // namespace test_driverhandle |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::ProtocolDetails<::test_driverhandle::HandlesInProtocol> { |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::WireServerDispatcher<::test_driverhandle::HandlesInProtocol> final { |
| WireServerDispatcher() = delete; |
| static ::fidl::DispatchResult TryDispatch(::fdf::WireServer<::test_driverhandle::HandlesInProtocol>* impl, ::fidl::IncomingHeaderAndMessage& msg, |
| internal::MessageStorageViewBase* storage_view, |
| ::fidl::Transaction* txn); |
| static void Dispatch(::fdf::WireServer<::test_driverhandle::HandlesInProtocol>* 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__ |
| |
| #ifdef __Fuchsia__ |
| template <> |
| struct ::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles> final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t header; |
| |
| ::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest body; |
| explicit TransactionalRequest(::test_driverhandle::wire::T t) |
| : body(::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest{t}) { |
| _InitHeader(); |
| } |
| TransactionalRequest() { |
| _InitHeader(); |
| } |
| void _CloseHandles() { |
| body._CloseHandles(); |
| } |
| |
| private: |
| void _InitHeader(); |
| }; |
| |
| template <bool IsRecursive> |
| struct ::fidl::internal::WireCodingTraits<::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive> |
| : public WireStructCodingTraitsBase<::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>, ::fidl::internal::WireCodingConstraintEmpty, IsRecursive> { |
| static constexpr size_t kInlineSize = 16 + sizeof(fidl_message_header_t); |
| |
| static void Encode(internal::WireEncoder* encoder, ::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>* value, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) { |
| *position.As<fidl_message_header_t>() = value->header; |
| WireCodingTraits<::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest, WireCodingConstraintEmpty, IsRecursive>::Encode( |
| encoder, &value->body, position + sizeof(fidl_message_header_t), recursion_depth); |
| } |
| static void Decode( |
| internal::WireDecoder* decoder, ::fidl::internal::WirePosition position, RecursionDepth<IsRecursive> recursion_depth) { |
| WireCodingTraits<::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest, WireCodingConstraintEmpty, IsRecursive>::Decode( |
| decoder, position + sizeof(fidl_message_header_t), recursion_depth); |
| } |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| namespace fidl { |
| |
| #ifdef __Fuchsia__ |
| template <> |
| struct IsFidlType<::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>> : public std::true_type {}; |
| template <> |
| struct IsFidlTransactionalMessage<::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>> : public std::true_type {}; |
| template <> |
| struct IsResource<::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>> { |
| static constexpr uint32_t kMaxNumHandles = 2; |
| static constexpr uint32_t kMaxDepth = 2; |
| static constexpr uint32_t kPrimarySize = FIDL_ALIGN(16 + sizeof(fidl_message_header_t)); |
| static constexpr uint32_t kMaxOutOfLine = 16; |
| static constexpr bool kHasFlexibleEnvelope = true; |
| static constexpr bool kHasPointer = true; |
| static constexpr ::fidl::internal::TransactionalMessageKind kMessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| }; |
| |
| static_assert(sizeof(::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>) == TypeTraits<::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>>::kPrimarySize); |
| static_assert(offsetof(::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>, header) == 0); |
| static_assert(offsetof(::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>, body) == sizeof(fidl_message_header_t)); |
| static_assert(sizeof(::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest) == TypeTraits<::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest>::kPrimarySize); |
| static_assert(offsetof(::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest, t) == 0); |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| } // namespace fidl |
| |
| template <> |
| class [[nodiscard]] ::fdf::WireUnownedResult<::test_driverhandle::HandlesInProtocol::SendHandles> final : public ::fidl::BaseWireResult<::test_driverhandle::HandlesInProtocol::SendHandles> { |
| public: |
| explicit WireUnownedResult(::fdf::UnownedClientEnd<::test_driverhandle::HandlesInProtocol> client_end, const ::fdf::Arena& arena, ::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles>* request); |
| explicit WireUnownedResult( |
| ::fit::result<::fidl::Error>&& decoded, |
| ::fidl::internal::MessageStorageViewBase* storage_view) : ::fidl::BaseWireResult<::test_driverhandle::HandlesInProtocol::SendHandles>(::fidl::internal::StatusFromResult(decoded)) {} |
| |
| explicit WireUnownedResult(const ::fidl::Status& result) : ::fidl::BaseWireResult<::test_driverhandle::HandlesInProtocol::SendHandles>(result) {} |
| WireUnownedResult(WireUnownedResult&&) = default; |
| WireUnownedResult(const WireUnownedResult&) = delete; |
| WireUnownedResult& operator=(WireUnownedResult&&) = default; |
| WireUnownedResult* operator=(const WireUnownedResult&) = delete; |
| ~WireUnownedResult() = default; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireEventHandlerInterface<::test_driverhandle::HandlesInProtocol> : public ::fidl::internal::BaseEventHandlerInterface { |
| public: |
| WireEventHandlerInterface() = default; |
| virtual ~WireEventHandlerInterface() = default; |
| }; |
| |
| template <> |
| class ::fdf::WireAsyncEventHandler<::test_driverhandle::HandlesInProtocol> |
| : public ::fidl::internal::WireEventHandlerInterface<::test_driverhandle::HandlesInProtocol>, public ::fidl::internal::AsyncEventHandler { |
| public: |
| WireAsyncEventHandler() = default; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireEventDispatcher<::test_driverhandle::HandlesInProtocol> final : public ::fidl::internal::IncomingEventDispatcher<::fidl::internal::WireEventHandlerInterface<::test_driverhandle::HandlesInProtocol>> { |
| public: |
| explicit WireEventDispatcher(::fidl::internal::WireEventHandlerInterface<::test_driverhandle::HandlesInProtocol>* event_handler) |
| : IncomingEventDispatcher(event_handler) {} |
| }; |
| |
| template <> |
| class ::fidl::internal::WireSyncBufferClientImpl<::test_driverhandle::HandlesInProtocol> final : public ::fdf::internal::SyncEndpointBufferVeneer<::fidl::internal::WireSyncBufferClientImpl<::test_driverhandle::HandlesInProtocol>> { |
| public: |
| // Caller provides the backing storage for FIDL message via an argument to `.buffer()`. |
| ::fidl::OneWayStatus |
| SendHandles(::test_driverhandle::wire::T t) { |
| ::fidl::internal::TransactionalRequest<::test_driverhandle::HandlesInProtocol::SendHandles> _request{t}; |
| return ::fdf::WireUnownedResult<::test_driverhandle::HandlesInProtocol::SendHandles>(_client_end(), _arena(), &_request); |
| } |
| |
| private: |
| ::fdf::UnownedClientEnd<::test_driverhandle::HandlesInProtocol> _client_end() const { |
| return ::fdf::UnownedClientEnd<::test_driverhandle::HandlesInProtocol>( |
| _transport().get<::fidl::internal::DriverTransport>()); |
| } |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| // This interface uses typed channels (i.e. |::fdf::ClientEnd<::test_driverhandle::HandlesInProtocol>| |
| // and |::fdf::ServerEnd<::test_driverhandle::HandlesInProtocol>|). |
| template <> |
| class ::fdf::WireServer<::test_driverhandle::HandlesInProtocol> : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| WireServer() = default; |
| virtual ~WireServer() = default; |
| |
| // The FIDL protocol type that is implemented by this server. |
| using _EnclosingProtocol = ::test_driverhandle::HandlesInProtocol; |
| |
| using Handler = fidl::ProtocolHandler<::test_driverhandle::HandlesInProtocol>; |
| |
| using SendHandlesCompleter = ::fidl::internal::WireCompleter<::test_driverhandle::HandlesInProtocol::SendHandles>; |
| using SendHandlesRequestView = ::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest*; |
| |
| virtual void SendHandles( |
| ::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest* request, |
| fdf::Arena& arena, |
| SendHandlesCompleter::Sync& completer) = 0; |
| |
| // |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(fdf_dispatcher_t* dispatcher) { |
| return [impl = this, dispatcher = dispatcher](::fdf::ServerEnd<::test_driverhandle::HandlesInProtocol> request) { |
| (void)::fdf::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::WireWeakOnewayBufferClientImpl<::test_driverhandle::DriverProtocol> : public ::fdf::internal::BufferClientImplBase { |
| public: |
| using BufferClientImplBase::BufferClientImplBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakAsyncBufferClientImpl<::test_driverhandle::DriverProtocol> final : public ::fidl::internal::WireWeakOnewayBufferClientImpl<::test_driverhandle::DriverProtocol> { |
| public: |
| using WireWeakOnewayBufferClientImpl::WireWeakOnewayBufferClientImpl; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakOnewayClientImpl<::test_driverhandle::DriverProtocol> : public ::fidl::internal::ClientImplBase { |
| public: |
| WireWeakOnewayClientImpl(fidl::internal::ClientBase* client_base, const fdf::Arena& arena) |
| : ClientImplBase(client_base), arena_(arena) {} |
| |
| protected: |
| const ::fdf::Arena& arena_; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakSyncClientImpl<::test_driverhandle::DriverProtocol> final : public ::fidl::internal::WireWeakOnewayClientImpl<::test_driverhandle::DriverProtocol> { |
| public: |
| using WireWeakOnewayClientImpl::WireWeakOnewayClientImpl; |
| }; |
| namespace fidl { |
| |
| #endif // __Fuchsia__ |
| |
| } // namespace fidl |
| |
| #ifdef __Fuchsia__ |
| template <> |
| class ::fidl::internal::WireWeakBufferEventSender<::test_driverhandle::DriverProtocol> : public ::fdf::internal::WeakBufferEventSenderBase { |
| public: |
| using WeakBufferEventSenderBase::WeakBufferEventSenderBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireBufferEventSender<::test_driverhandle::DriverProtocol> |
| : public ::fdf::internal::SyncEndpointBufferVeneer<::fidl::internal::WireBufferEventSender<::test_driverhandle::DriverProtocol>> { |
| public: |
| using SyncEndpointBufferVeneer::SyncEndpointBufferVeneer; |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::WireWeakOnewayBufferClientImpl<::test_driverhandle::HandlesInProtocol> : public ::fdf::internal::BufferClientImplBase { |
| public: |
| using BufferClientImplBase::BufferClientImplBase; |
| |
| // Caller provides the backing storage for FIDL message. |
| ::fidl::OneWayStatus SendHandles(::test_driverhandle::wire::T t); |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakAsyncBufferClientImpl<::test_driverhandle::HandlesInProtocol> final : public ::fidl::internal::WireWeakOnewayBufferClientImpl<::test_driverhandle::HandlesInProtocol> { |
| public: |
| using WireWeakOnewayBufferClientImpl::WireWeakOnewayBufferClientImpl; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakOnewayClientImpl<::test_driverhandle::HandlesInProtocol> : public ::fidl::internal::ClientImplBase { |
| public: |
| WireWeakOnewayClientImpl(fidl::internal::ClientBase* client_base, const fdf::Arena& arena) |
| : ClientImplBase(client_base), arena_(arena) {} |
| |
| // Allocates 64 bytes of message buffer on the stack. No heap allocation necessary. |
| ::fidl::OneWayStatus SendHandles(::test_driverhandle::wire::T t); |
| |
| protected: |
| const ::fdf::Arena& arena_; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakSyncClientImpl<::test_driverhandle::HandlesInProtocol> final : public ::fidl::internal::WireWeakOnewayClientImpl<::test_driverhandle::HandlesInProtocol> { |
| public: |
| using WireWeakOnewayClientImpl::WireWeakOnewayClientImpl; |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| template <> |
| class ::fidl::internal::WireWeakBufferEventSender<::test_driverhandle::HandlesInProtocol> : public ::fdf::internal::WeakBufferEventSenderBase { |
| public: |
| using WeakBufferEventSenderBase::WeakBufferEventSenderBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireBufferEventSender<::test_driverhandle::HandlesInProtocol> |
| : public ::fdf::internal::SyncEndpointBufferVeneer<::fidl::internal::WireBufferEventSender<::test_driverhandle::HandlesInProtocol>> { |
| public: |
| using SyncEndpointBufferVeneer::SyncEndpointBufferVeneer; |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #pragma clang diagnostic pop |