| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <fidl/fidl.test.anonymous/cpp/markers.h> |
| #include <fidl/fidl.test.anonymous/cpp/wire_types.h> |
| #include <lib/fidl/llcpp/wire_messaging.h> |
| |
| #ifdef __Fuchsia__ |
| |
| #include <lib/fidl/llcpp/client.h> |
| #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> |
| |
| #endif // __Fuchsia__ |
| |
| namespace fidl_test_anonymous { |
| class SomeProtocol; |
| |
| __LOCAL extern "C" const fidl_type_t |
| fidl_test_anonymous_SomeProtocolSomeMethodRequestMessageTable; |
| |
| __LOCAL extern "C" const fidl_type_t |
| fidl_test_anonymous_SomeProtocolSomeMethodResponseMessageTable; |
| |
| } // namespace fidl_test_anonymous |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::ProtocolDetails<::fidl_test_anonymous::SomeProtocol> { |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct ::fidl::internal::WireServerDispatcher< |
| ::fidl_test_anonymous::SomeProtocol> |
| final { |
| WireServerDispatcher() = delete; |
| static ::fidl::DispatchResult TryDispatch( |
| ::fidl::WireServer<::fidl_test_anonymous::SomeProtocol>* impl, |
| ::fidl::IncomingMessage& msg, ::fidl::Transaction* txn); |
| static void Dispatch( |
| ::fidl::WireServer<::fidl_test_anonymous::SomeProtocol>* impl, |
| ::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn); |
| |
| private: |
| static const ::fidl::internal::MethodEntry entries_[]; |
| static const ::fidl::internal::MethodEntry* entries_end_; |
| }; |
| #endif // __Fuchsia__ |
| |
| template <> |
| struct ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| final { |
| using UnionMember = fidl_test_anonymous::wire::UnionMember; |
| using TableMember = fidl_test_anonymous::wire::TableMember; |
| |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl_test_anonymous::wire::UnionMember union_member; |
| ::fidl_test_anonymous::wire::TableMember table_member; |
| |
| explicit WireRequest(::fidl_test_anonymous::wire::UnionMember union_member, |
| ::fidl_test_anonymous::wire::TableMember table_member) |
| : union_member(union_member), table_member(table_member) { |
| _InitHeader(); |
| } |
| WireRequest() { _InitHeader(); } |
| |
| static constexpr const fidl_type_t* Type = |
| &::fidl_test_anonymous:: |
| fidl_test_anonymous_SomeProtocolSomeMethodRequestMessageTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 48; |
| static constexpr uint32_t PrimarySizeV1 = 56; |
| static constexpr uint32_t MaxOutOfLine = 48; |
| static constexpr uint32_t MaxOutOfLineV1 = 72; |
| static constexpr bool HasFlexibleEnvelope = true; |
| static constexpr bool HasPointer = true; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| using ResponseType = |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>; |
| |
| class UnownedEncodedMessage; |
| class OwnedEncodedMessage; |
| |
| public: |
| class DecodedMessage; |
| |
| private: |
| void _InitHeader(); |
| }; |
| template <> |
| struct ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| final { |
| using Result = fidl_test_anonymous::wire::SomeProtocolSomeMethodResult; |
| |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl_test_anonymous::wire::SomeProtocolSomeMethodResult result; |
| |
| explicit WireResponse( |
| ::fidl_test_anonymous::wire::SomeProtocolSomeMethodResult result) |
| : result(result) { |
| _InitHeader(); |
| } |
| WireResponse() { _InitHeader(); } |
| |
| static constexpr const fidl_type_t* Type = |
| &::fidl_test_anonymous:: |
| fidl_test_anonymous_SomeProtocolSomeMethodResponseMessageTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 32; |
| static constexpr uint32_t PrimarySizeV1 = 40; |
| static constexpr uint32_t MaxOutOfLine = 0; |
| static constexpr uint32_t MaxOutOfLineV1 = 8; |
| static constexpr bool HasFlexibleEnvelope = false; |
| static constexpr bool HasPointer = true; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kResponse; |
| |
| class UnownedEncodedMessage; |
| class OwnedEncodedMessage; |
| |
| public: |
| class DecodedMessage; |
| |
| private: |
| void _InitHeader(); |
| }; |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::WireResult<::fidl_test_anonymous::SomeProtocol::SomeMethod> final |
| : public ::fidl::Result { |
| public: |
| WireResult( |
| ::fidl::UnownedClientEnd<::fidl_test_anonymous::SomeProtocol> client, |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| request); |
| WireResult( |
| ::fidl::UnownedClientEnd<::fidl_test_anonymous::SomeProtocol> client, |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| request, |
| zx_time_t _deadline); |
| explicit WireResult(const ::fidl::Result& result) : ::fidl::Result(result) {} |
| WireResult(WireResult&&) = delete; |
| WireResult(const WireResult&) = delete; |
| WireResult* operator=(WireResult&&) = delete; |
| WireResult* operator=(const WireResult&) = delete; |
| ~WireResult() = default; |
| |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| Unwrap() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast< |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>*>( |
| bytes_.data()); |
| } |
| const ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| Unwrap() const { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<const ::fidl::WireResponse< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>*>(bytes_.data()); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>& |
| value() { |
| return *Unwrap(); |
| } |
| const ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>& |
| value() const { |
| return *Unwrap(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| operator->() { |
| return &value(); |
| } |
| const ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| operator->() const { |
| return &value(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>& |
| operator*() { |
| return value(); |
| } |
| const ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>& |
| operator*() const { |
| return value(); |
| } |
| |
| private: |
| ::fidl::internal::InlineMessageBuffer<48> bytes_; |
| }; |
| template <> |
| class ::fidl::WireUnownedResult<::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| final : public ::fidl::Result { |
| public: |
| explicit WireUnownedResult( |
| ::fidl::UnownedClientEnd<::fidl_test_anonymous::SomeProtocol> client_end, |
| ::fidl::internal::AnyBufferAllocator& allocator, |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| request); |
| explicit WireUnownedResult( |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| response) |
| : bytes_(reinterpret_cast<uint8_t*>(response)) {} |
| explicit WireUnownedResult(const ::fidl::Result& result) |
| : ::fidl::Result(result) {} |
| explicit WireUnownedResult( |
| ::fidl::DecodedMessage<::fidl::WireResponse< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>>&& decoded) |
| : ::fidl::Result(decoded) { |
| if (decoded.ok()) { |
| bytes_ = reinterpret_cast<uint8_t*>(decoded.PrimaryObject()); |
| } else { |
| bytes_ = nullptr; |
| } |
| decoded.ReleasePrimaryObject(); |
| } |
| WireUnownedResult(WireUnownedResult&&) = delete; |
| WireUnownedResult(const WireUnownedResult&) = delete; |
| WireUnownedResult* operator=(WireUnownedResult&&) = delete; |
| WireUnownedResult* operator=(const WireUnownedResult&) = delete; |
| ~WireUnownedResult() = default; |
| |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| Unwrap() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast< |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>*>( |
| bytes_); |
| } |
| const ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| Unwrap() const { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<const ::fidl::WireResponse< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>*>(bytes_); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>& |
| value() { |
| return *Unwrap(); |
| } |
| const ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>& |
| value() const { |
| return *Unwrap(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| operator->() { |
| return &value(); |
| } |
| const ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| operator->() const { |
| return &value(); |
| } |
| |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>& |
| operator*() { |
| return value(); |
| } |
| const ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>& |
| operator*() const { |
| return value(); |
| } |
| |
| private: |
| uint8_t* bytes_; |
| }; |
| |
| // Methods to make a sync FIDL call directly on an unowned channel or a |
| // const reference to a |fidl::ClientEnd<::fidl_test_anonymous::SomeProtocol>|, |
| // avoiding setting up a client. |
| template <> |
| class ::fidl::internal::WireSyncClientImpl<::fidl_test_anonymous::SomeProtocol> |
| final : public ::fidl::internal::SyncEndpointManagedVeneer< |
| ::fidl::internal::WireSyncClientImpl< |
| ::fidl_test_anonymous::SomeProtocol>> { |
| public: |
| // Allocates 128 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| SomeMethod(::fidl_test_anonymous::wire::UnionMember union_member, |
| ::fidl_test_anonymous::wire::TableMember table_member) { |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| _request{union_member, table_member}; |
| return ::fidl::WireResult<::fidl_test_anonymous::SomeProtocol::SomeMethod>( |
| _client_end(), &_request); |
| } |
| |
| private: |
| ::fidl::UnownedClientEnd<::fidl_test_anonymous::SomeProtocol> _client_end() |
| const { |
| return ::fidl::UnownedClientEnd<::fidl_test_anonymous::SomeProtocol>( |
| _channel()); |
| } |
| }; |
| |
| template <> |
| class ::fidl::internal::WireSyncBufferClientImpl< |
| ::fidl_test_anonymous::SomeProtocol> |
| final : public ::fidl::internal::SyncEndpointBufferVeneer< |
| ::fidl::internal::WireSyncBufferClientImpl< |
| ::fidl_test_anonymous::SomeProtocol>> { |
| public: |
| // Caller provides the backing storage for FIDL message via an argument to |
| // `.buffer()`. |
| ::fidl::WireUnownedResult<::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| SomeMethod(::fidl_test_anonymous::wire::UnionMember union_member, |
| ::fidl_test_anonymous::wire::TableMember table_member) { |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| _request{union_member, table_member}; |
| return ::fidl::WireUnownedResult< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>( |
| _client_end(), _allocator(), &_request); |
| } |
| |
| private: |
| ::fidl::UnownedClientEnd<::fidl_test_anonymous::SomeProtocol> _client_end() |
| const { |
| return ::fidl::UnownedClientEnd<::fidl_test_anonymous::SomeProtocol>( |
| _channel()); |
| } |
| }; |
| template <> |
| class ::fidl::internal::WireEventHandlerInterface< |
| ::fidl_test_anonymous::SomeProtocol> { |
| public: |
| WireEventHandlerInterface() = default; |
| virtual ~WireEventHandlerInterface() = default; |
| }; |
| |
| template <> |
| class ::fidl::WireAsyncEventHandler<::fidl_test_anonymous::SomeProtocol> |
| : public ::fidl::internal::WireEventHandlerInterface< |
| ::fidl_test_anonymous::SomeProtocol>, |
| public ::fidl::internal::AsyncEventHandler { |
| public: |
| WireAsyncEventHandler() = default; |
| }; |
| |
| template <> |
| class ::fidl::WireSyncEventHandler<::fidl_test_anonymous::SomeProtocol> |
| : public ::fidl::internal::WireEventHandlerInterface< |
| ::fidl_test_anonymous::SomeProtocol> { |
| public: |
| WireSyncEventHandler() = default; |
| |
| // Method called when an unknown event is found. This methods gives the status |
| // which, in this case, is returned by HandleOneEvent. |
| virtual zx_status_t Unknown() = 0; |
| |
| // Handle all possible events defined in this protocol. |
| // Blocks to consume exactly one message from the channel, then call the |
| // corresponding virtual method. |
| ::fidl::Result HandleOneEvent( |
| ::fidl::UnownedClientEnd<::fidl_test_anonymous::SomeProtocol> client_end); |
| }; |
| template <> |
| class ::fidl::WireSyncClient<::fidl_test_anonymous::SomeProtocol> final |
| : public ::fidl::internal::WireSyncClientBase< |
| ::fidl_test_anonymous::SomeProtocol> { |
| public: |
| using ::fidl::internal::WireSyncClientBase< |
| ::fidl_test_anonymous::SomeProtocol>::WireSyncClientBase; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireCompleterBase< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| : public ::fidl::CompleterBase { |
| public: |
| // In the following methods, the return value indicates internal errors during |
| // the reply, such as encoding or writing to the transport. |
| // Note that any error will automatically lead to the destruction of the |
| // binding, after which the |on_unbound| callback will be triggered with a |
| // detailed reason. |
| // |
| // See //zircon/system/ulib/fidl/include/lib/fidl/llcpp/server.h. |
| // |
| // Because the reply status is identical to the unbinding status, it can be |
| // safely ignored. |
| ::fidl::Result Reply( |
| ::fidl_test_anonymous::wire::SomeProtocolSomeMethodResult result); |
| ::fidl::Result ReplySuccess( |
| ::fidl_test_anonymous::wire::BitsMember bits_member); |
| ::fidl::Result ReplyError( |
| ::fidl_test_anonymous::wire::SomeProtocolSomeMethodError error); |
| ::fidl::Result Reply( |
| ::fidl::BufferSpan _buffer, |
| ::fidl_test_anonymous::wire::SomeProtocolSomeMethodResult result); |
| ::fidl::Result ReplySuccess( |
| ::fidl::BufferSpan _buffer, |
| ::fidl_test_anonymous::wire::BitsMember bits_member); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| template <> |
| struct ::fidl::internal::WireMethodTypes< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod> { |
| using Completer = fidl::Completer<::fidl::internal::WireCompleterBase< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>>; |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| // This interface uses typed channels (i.e. |fidl::ClientEnd<SomeProtocol>| |
| // and |fidl::ServerEnd<SomeProtocol>|). |
| template <> |
| class ::fidl::WireServer<::fidl_test_anonymous::SomeProtocol> |
| : public ::fidl::internal::IncomingMessageDispatcher { |
| public: |
| WireServer() = default; |
| virtual ~WireServer() = default; |
| |
| // The FIDL protocol type that is implemented by this server. |
| using _EnclosingProtocol = ::fidl_test_anonymous::SomeProtocol; |
| using _Transport = ::fidl::internal::ChannelTransport; |
| |
| using SomeMethodCompleter = ::fidl::internal::WireCompleter< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>; |
| using SomeMethodRequestView = ::fidl::internal::WireRequestView< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>; |
| |
| virtual void SomeMethod(SomeMethodRequestView request, |
| SomeMethodCompleter::Sync& _completer) = 0; |
| |
| private: |
| void dispatch_message( |
| ::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn, |
| const internal::IncomingTransportContext* transport_context) final; |
| }; |
| #endif // __Fuchsia__ |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType< |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod>> |
| : public std::true_type {}; |
| static_assert( |
| sizeof( |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod>) == |
| ::fidl::WireRequest< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>::PrimarySize); |
| static_assert( |
| offsetof( |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod>, |
| union_member) == 16); |
| static_assert( |
| offsetof( |
| ::fidl::WireRequest<::fidl_test_anonymous::SomeProtocol::SomeMethod>, |
| table_member) == 32); |
| |
| template <> |
| struct IsFidlType< |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>> |
| : public std::true_type {}; |
| static_assert( |
| sizeof(::fidl::WireResponse< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>) == |
| ::fidl::WireResponse< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>::PrimarySize); |
| static_assert( |
| offsetof( |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>, |
| result) == 16); |
| } // namespace fidl |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::WireResponseContext< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| : public ::fidl::internal::ResponseContext { |
| public: |
| WireResponseContext(); |
| |
| virtual void OnResult( |
| ::fidl::WireUnownedResult< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>& result) = 0; |
| |
| private: |
| ::cpp17::optional<::fidl::UnbindInfo> OnRawResult( |
| ::fidl::IncomingMessage&& msg, |
| const internal::IncomingTransportContext* transport_context) override; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| class ::fidl::internal::WireClientImpl<::fidl_test_anonymous::SomeProtocol> |
| final : public ::fidl::internal::ClientBase { |
| public: |
| // Asynchronous variant of |SomeProtocol.SomeMethod()|. |
| // Allocates 96 bytes of request buffer on the stack. The callback is stored |
| // on the heap. |
| void SomeMethod(::fidl_test_anonymous::wire::UnionMember union_member, |
| ::fidl_test_anonymous::wire::TableMember table_member, |
| ::fidl::WireClientCallback< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| _cb); |
| |
| void SomeMethod( |
| ::fidl_test_anonymous::wire::UnionMember union_member, |
| ::fidl_test_anonymous::wire::TableMember table_member, |
| ::fit::callback<void( |
| ::fidl::WireResponse<::fidl_test_anonymous::SomeProtocol::SomeMethod>* |
| response)> |
| _cb); |
| |
| // Asynchronous variant of |SomeProtocol.SomeMethod()|. |
| // Caller provides the backing storage for FIDL message via request buffer. |
| // Ownership of |_context| is given unsafely to the binding until |OnError| |
| // or |OnReply| are called on it. |
| void SomeMethod( |
| ::fidl::BufferSpan _request_buffer, |
| ::fidl_test_anonymous::wire::UnionMember union_member, |
| ::fidl_test_anonymous::wire::TableMember table_member, |
| ::fidl::WireResponseContext< |
| ::fidl_test_anonymous::SomeProtocol::SomeMethod>* _context); |
| |
| // Synchronous variant of |SomeMethod.SomeMethod()|. |
| // Allocates 128 bytes of message buffer on the stack. No heap allocation |
| // necessary. |
| ::fidl::WireResult<::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| SomeMethod_Sync(::fidl_test_anonymous::wire::UnionMember union_member, |
| ::fidl_test_anonymous::wire::TableMember table_member); |
| |
| // Synchronous variant of |SomeMethod.SomeMethod()|. |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| ::fidl::WireUnownedResult<::fidl_test_anonymous::SomeProtocol::SomeMethod> |
| SomeMethod_Sync(::fidl::BufferSpan _buffer_span, |
| ::fidl_test_anonymous::wire::UnionMember union_member, |
| ::fidl_test_anonymous::wire::TableMember table_member); |
| WireClientImpl() = default; |
| |
| private: |
| std::optional<::fidl::UnbindInfo> DispatchEvent( |
| ::fidl::IncomingMessage& msg, |
| ::fidl::internal::AsyncEventHandler* maybe_event_handler, |
| const internal::IncomingTransportContext* transport_context) override; |
| }; |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| // |EventSender| owns a server endpoint of a channel speaking |
| // the SomeProtocol protocol, and can send events in that protocol. |
| template <> |
| class ::fidl::WireEventSender<::fidl_test_anonymous::SomeProtocol> { |
| public: |
| // Constructs an event sender with an invalid channel. |
| WireEventSender() = default; |
| |
| explicit WireEventSender( |
| ::fidl::ServerEnd<::fidl_test_anonymous::SomeProtocol> server_end) |
| : server_end_(std::move(server_end)) {} |
| |
| // The underlying server channel endpoint, which may be replaced at run-time. |
| const ::fidl::ServerEnd<::fidl_test_anonymous::SomeProtocol>& server_end() |
| const { |
| return server_end_; |
| } |
| ::fidl::ServerEnd<::fidl_test_anonymous::SomeProtocol>& server_end() { |
| return server_end_; |
| } |
| |
| const ::zx::channel& channel() const { return server_end_.channel(); } |
| ::zx::channel& channel() { return server_end_.channel(); } |
| |
| // Whether the underlying channel is valid. |
| bool is_valid() const { return server_end_.is_valid(); } |
| |
| private: |
| ::fidl::ServerEnd<::fidl_test_anonymous::SomeProtocol> server_end_; |
| }; |
| |
| template <> |
| class ::fidl::internal::WireWeakEventSender< |
| ::fidl_test_anonymous::SomeProtocol> { |
| public: |
| WireWeakEventSender( |
| std::weak_ptr<::fidl::internal::AsyncServerBinding>&& binding) |
| : inner_(std::move(binding)) {} |
| |
| private: |
| friend ServerBindingRef<::fidl_test_anonymous::SomeProtocol, |
| ::fidl::internal::ChannelTransport>; |
| |
| ::fidl::internal::WeakEventSenderInner inner_; |
| }; |
| #endif // __Fuchsia__ |