| // WARNING: This file is machine generated by fidlgen. |
| |
| #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/llcpp/connect_service.h> |
| #include <lib/fidl/llcpp/server.h> |
| #include <lib/fidl/llcpp/service_handler_interface.h> |
| #include <lib/fidl/llcpp/sync_call.h> |
| #include <lib/fidl_driver/cpp/server.h> |
| #include <lib/fidl_driver/cpp/wire_client.h> |
| |
| #endif // __Fuchsia__ |
| |
| namespace test_driverhandle { |
| class HandlesInProtocol; |
| |
| class DriverProtocol; |
| |
| __LOCAL extern "C" const fidl_type_t |
| test_driverhandle_HandlesInProtocolSendHandlesRequestTable; |
| |
| } // namespace test_driverhandle |
| template <> |
| struct ::fidl::internal::WireOrdinal< |
| ::test_driverhandle::HandlesInProtocol::SendHandles> |
| final { |
| static constexpr uint64_t value = 8904504160365833729lu; |
| }; |
| |
| 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::IncomingMessage& msg, |
| internal::IncomingTransportContext transport_context, |
| ::fidl::Transaction* txn); |
| static void Dispatch( |
| ::fdf::WireServer<::test_driverhandle::HandlesInProtocol>* impl, |
| ::fidl::IncomingMessage&& msg, |
| internal::IncomingTransportContext transport_context, |
| ::fidl::Transaction* txn); |
| |
| private: |
| static const ::fidl::internal::MethodEntry entries_[]; |
| static const ::fidl::internal::MethodEntry* entries_end_; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::WireRequest<::test_driverhandle::HandlesInProtocol::SendHandles> |
| final |
| : public ::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest { |
| using T = test_driverhandle::wire::T; |
| |
| explicit WireRequest( |
| ::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest base) |
| : ::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest( |
| std::move(base)) {} |
| explicit WireRequest(::test_driverhandle::wire::T t) |
| : ::test_driverhandle::wire::HandlesInProtocolSendHandlesRequest{ |
| .t = std::move(t)} {} |
| WireRequest() = default; |
| }; |
| |
| template <> |
| struct ::fidl::internal::TransactionalRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles> |
| final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t header; |
| |
| ::fidl::WireRequest<::test_driverhandle::HandlesInProtocol::SendHandles> body; |
| explicit TransactionalRequest(::test_driverhandle::wire::T t) |
| : body(::fidl::WireRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>(t)) { |
| _InitHeader(); |
| } |
| TransactionalRequest() { _InitHeader(); } |
| void _CloseHandles() { body._CloseHandles(); } |
| |
| private: |
| void _InitHeader(); |
| }; |
| #endif // __Fuchsia__ |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::fidl::internal::TransactionalRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlType< |
| ::fidl::WireRequest<::test_driverhandle::HandlesInProtocol::SendHandles>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlTransactionalMessage<::fidl::internal::TransactionalRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlTransactionalMessage< |
| ::fidl::WireRequest<::test_driverhandle::HandlesInProtocol::SendHandles>> |
| : public std::false_type {}; |
| #ifdef __Fuchsia__ |
| template <> |
| struct IsResource<::fidl::internal::TransactionalRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>> |
| : public std::true_type {}; |
| template <> |
| struct IsResource< |
| ::fidl::WireRequest<::test_driverhandle::HandlesInProtocol::SendHandles>> |
| : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::fidl::internal::TransactionalRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>> { |
| static constexpr const fidl_type_t* kType = |
| &::test_driverhandle:: |
| test_driverhandle_HandlesInProtocolSendHandlesRequestTable; |
| static constexpr uint32_t kMaxNumHandles = 2; |
| static constexpr uint32_t kPrimarySize = |
| FIDL_ALIGN(16 + sizeof(fidl_message_header_t)); |
| static constexpr uint32_t kPrimarySizeV1 = |
| FIDL_ALIGN(16 + sizeof(fidl_message_header_t)); |
| static constexpr uint32_t kMaxOutOfLine = 16; |
| static constexpr uint32_t kMaxOutOfLineV1 = 48; |
| 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)); |
| |
| template <> |
| struct TypeTraits< |
| ::fidl::WireRequest<::test_driverhandle::HandlesInProtocol::SendHandles>> { |
| static constexpr const fidl_type_t* kType = |
| &::test_driverhandle:: |
| test_driverhandle_HandlesInProtocolSendHandlesRequestTable; |
| static constexpr uint32_t kMaxNumHandles = 2; |
| static constexpr uint32_t kPrimarySize = 16; |
| static constexpr uint32_t kPrimarySizeV1 = 16; |
| static constexpr uint32_t kMaxOutOfLine = 16; |
| static constexpr uint32_t kMaxOutOfLineV1 = 48; |
| static constexpr bool kHasFlexibleEnvelope = true; |
| static constexpr bool kHasPointer = true; |
| static constexpr ::fidl::internal::TransactionalMessageKind kMessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| }; |
| static_assert( |
| sizeof(::fidl::WireRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>) == |
| TypeTraits<::fidl::WireRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>>::kPrimarySize); |
| static_assert(offsetof(::fidl::WireRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>, |
| t) == 0); |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| } // namespace fidl |
| template <> |
| class [[nodiscard]] ::fdf::WireUnownedResult< |
| ::test_driverhandle::HandlesInProtocol::SendHandles> |
| final : public ::fidl::Status { |
| public: |
| explicit WireUnownedResult( |
| ::fdf::UnownedClientEnd<::test_driverhandle::HandlesInProtocol> |
| client_end, |
| const ::fdf::Arena& arena, |
| ::fidl::internal::TransactionalRequest< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>* request); |
| explicit WireUnownedResult(const ::fidl::Status& result) |
| : ::fidl::Status(result) {} |
| WireUnownedResult(WireUnownedResult&&) = delete; |
| WireUnownedResult(const WireUnownedResult&) = delete; |
| WireUnownedResult* operator=(WireUnownedResult&&) = delete; |
| WireUnownedResult* operator=(const WireUnownedResult&) = delete; |
| ~WireUnownedResult() = default; |
| }; |
| template <> |
| class ::fidl::internal::WireEventHandlerInterface< |
| ::test_driverhandle::HandlesInProtocol> { |
| 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::WireSyncEventHandler<::test_driverhandle::HandlesInProtocol> |
| : public ::fidl::internal::WireEventHandlerInterface< |
| ::test_driverhandle::HandlesInProtocol> { |
| 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( |
| ::fdf::UnownedClientEnd<::test_driverhandle::HandlesInProtocol> |
| client_end); |
| |
| private: |
| [[maybe_unused]] bool got_transitional_ = false; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireEventDispatcher< |
| ::test_driverhandle::HandlesInProtocol> |
| final : public ::fidl::internal::IncomingEventDispatcher< |
| ::fdf::WireAsyncEventHandler< |
| ::test_driverhandle::HandlesInProtocol>> { |
| public: |
| explicit WireEventDispatcher( |
| ::fdf::WireAsyncEventHandler<::test_driverhandle::HandlesInProtocol>* |
| event_handler) |
| : IncomingEventDispatcher(event_handler) {} |
| |
| private: |
| std::optional<::fidl::UnbindInfo> DispatchEvent( |
| ::fidl::IncomingMessage& msg, |
| ::fidl::internal::IncomingTransportContext transport_context) override; |
| }; |
| |
| 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()`. |
| ::fdf::WireUnownedResult<::test_driverhandle::HandlesInProtocol::SendHandles> |
| 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<SomeProtocol>| |
| // and |fdf::ServerEnd<SomeProtocol>|). |
| 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 SendHandlesCompleter = ::fidl::internal::WireCompleter< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>; |
| using SendHandlesRequestView = ::fidl::internal::WireRequestView< |
| ::test_driverhandle::HandlesInProtocol::SendHandles>; |
| |
| virtual void SendHandles(SendHandlesRequestView request, fdf::Arena& arena, |
| SendHandlesCompleter::Sync& completer) = 0; |
| |
| private: |
| void dispatch_message( |
| ::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn, |
| ::fidl::internal::IncomingTransportContext transport_context) final; |
| }; |
| namespace fidl { |
| #endif // __Fuchsia__ |
| |
| } // namespace fidl |
| namespace test_driverhandle {} // 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::IncomingMessage& msg, |
| internal::IncomingTransportContext transport_context, |
| ::fidl::Transaction* txn); |
| static void Dispatch( |
| ::fdf::WireServer<::test_driverhandle::DriverProtocol>* impl, |
| ::fidl::IncomingMessage&& msg, |
| internal::IncomingTransportContext transport_context, |
| ::fidl::Transaction* txn); |
| |
| private: |
| static const ::fidl::internal::MethodEntry entries_[]; |
| static const ::fidl::internal::MethodEntry* entries_end_; |
| }; |
| #endif // __Fuchsia__ |
| |
| namespace fidl { |
| |
| #ifdef __Fuchsia__ |
| } // namespace fidl |
| template <> |
| class ::fidl::internal::WireEventHandlerInterface< |
| ::test_driverhandle::DriverProtocol> { |
| 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::WireSyncEventHandler<::test_driverhandle::DriverProtocol> |
| : public ::fidl::internal::WireEventHandlerInterface< |
| ::test_driverhandle::DriverProtocol> { |
| 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( |
| ::fdf::UnownedClientEnd<::test_driverhandle::DriverProtocol> client_end); |
| |
| private: |
| [[maybe_unused]] bool got_transitional_ = false; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireEventDispatcher<::test_driverhandle::DriverProtocol> |
| final |
| : public ::fidl::internal::IncomingEventDispatcher< |
| ::fdf::WireAsyncEventHandler<::test_driverhandle::DriverProtocol>> { |
| public: |
| explicit WireEventDispatcher( |
| ::fdf::WireAsyncEventHandler<::test_driverhandle::DriverProtocol>* |
| event_handler) |
| : IncomingEventDispatcher(event_handler) {} |
| |
| private: |
| std::optional<::fidl::UnbindInfo> DispatchEvent( |
| ::fidl::IncomingMessage& msg, |
| ::fidl::internal::IncomingTransportContext transport_context) override; |
| }; |
| |
| 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<SomeProtocol>| |
| // and |fdf::ServerEnd<SomeProtocol>|). |
| 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; |
| |
| private: |
| void dispatch_message( |
| ::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn, |
| ::fidl::internal::IncomingTransportContext transport_context) final; |
| }; |
| namespace fidl { |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| } // namespace fidl |
| |
| 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::Status 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::Status 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; |
| }; |
| 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 |