| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <lib/fidl/internal.h> |
| #include <lib/fidl/llcpp/array.h> |
| #include <lib/fidl/llcpp/buffer_allocator.h> |
| #include <lib/fidl/llcpp/buffer_then_heap_allocator.h> |
| #include <lib/fidl/llcpp/coding.h> |
| #include <lib/fidl/llcpp/envelope.h> |
| #include <lib/fidl/llcpp/errors.h> |
| #include <lib/fidl/llcpp/linearized_and_encoded.h> |
| #include <lib/fidl/llcpp/memory.h> |
| #include <lib/fidl/llcpp/string_view.h> |
| #include <lib/fidl/llcpp/tracking_ptr.h> |
| #include <lib/fidl/llcpp/traits.h> |
| #include <lib/fidl/llcpp/vector_view.h> |
| #include <lib/fit/function.h> |
| #include <lib/fit/optional.h> |
| |
| #include <variant> |
| #ifdef __Fuchsia__ |
| #include <lib/fidl/llcpp/client.h> |
| #include <lib/fidl/llcpp/connect_service.h> |
| #include <lib/fidl/llcpp/message.h> |
| #include <lib/fidl/llcpp/result.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/llcpp/transaction.h> |
| #include <lib/fidl/txn_header.h> |
| #include <lib/zx/channel.h> |
| #endif // __Fuchsia__ |
| #include <zircon/fidl.h> |
| |
| namespace llcpp { |
| |
| namespace fidl { |
| namespace test { |
| namespace json { |
| |
| struct Example_foo_Response; |
| class Example_foo_Result; |
| class Example; |
| |
| extern "C" const fidl_type_t fidl_test_json_Example_foo_ResultTable; |
| |
| class Example_foo_Result { |
| public: |
| Example_foo_Result() : ordinal_(Ordinal::Invalid), envelope_{} {} |
| |
| Example_foo_Result(Example_foo_Result&&) = default; |
| Example_foo_Result& operator=(Example_foo_Result&&) = default; |
| |
| ~Example_foo_Result() { reset_ptr(nullptr); } |
| |
| enum class Tag : fidl_xunion_tag_t { |
| kResponse = 1, // 0x1 |
| kErr = 2, // 0x2 |
| }; |
| |
| bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; } |
| |
| bool is_response() const { return ordinal_ == Ordinal::kResponse; } |
| |
| static Example_foo_Result WithResponse( |
| ::fidl::tracking_ptr<::llcpp::fidl::test::json::Example_foo_Response>&& |
| val) { |
| Example_foo_Result result; |
| result.set_response(std::move(val)); |
| return result; |
| } |
| |
| void set_response( |
| ::fidl::tracking_ptr<::llcpp::fidl::test::json::Example_foo_Response>&& |
| elem) { |
| ordinal_ = Ordinal::kResponse; |
| reset_ptr(static_cast<::fidl::tracking_ptr<void>>(std::move(elem))); |
| } |
| |
| ::llcpp::fidl::test::json::Example_foo_Response& mutable_response() { |
| ZX_ASSERT(ordinal_ == Ordinal::kResponse); |
| return *static_cast<::llcpp::fidl::test::json::Example_foo_Response*>( |
| envelope_.data.get()); |
| } |
| const ::llcpp::fidl::test::json::Example_foo_Response& response() const { |
| ZX_ASSERT(ordinal_ == Ordinal::kResponse); |
| return *static_cast<::llcpp::fidl::test::json::Example_foo_Response*>( |
| envelope_.data.get()); |
| } |
| |
| bool is_err() const { return ordinal_ == Ordinal::kErr; } |
| |
| static Example_foo_Result WithErr(::fidl::tracking_ptr<uint32_t>&& val) { |
| Example_foo_Result result; |
| result.set_err(std::move(val)); |
| return result; |
| } |
| |
| void set_err(::fidl::tracking_ptr<uint32_t>&& elem) { |
| ordinal_ = Ordinal::kErr; |
| reset_ptr(static_cast<::fidl::tracking_ptr<void>>(std::move(elem))); |
| } |
| |
| uint32_t& mutable_err() { |
| ZX_ASSERT(ordinal_ == Ordinal::kErr); |
| return *static_cast<uint32_t*>(envelope_.data.get()); |
| } |
| const uint32_t& err() const { |
| ZX_ASSERT(ordinal_ == Ordinal::kErr); |
| return *static_cast<uint32_t*>(envelope_.data.get()); |
| } |
| Tag which() const { |
| ZX_ASSERT(!has_invalid_tag()); |
| return static_cast<Tag>(ordinal_); |
| } |
| |
| static constexpr const fidl_type_t* Type = |
| &fidl_test_json_Example_foo_ResultTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 24; |
| [[maybe_unused]] static constexpr uint32_t MaxOutOfLine = 8; |
| static constexpr bool HasPointer = true; |
| static constexpr bool IsResource = false; |
| |
| void _CloseHandles(); |
| |
| private: |
| enum class Ordinal : fidl_xunion_tag_t { |
| Invalid = 0, |
| kResponse = 1, // 0x1 |
| kErr = 2, // 0x2 |
| }; |
| |
| void reset_ptr(::fidl::tracking_ptr<void>&& new_ptr) { |
| // To clear the existing value, std::move it and let it go out of scope. |
| switch (static_cast<fidl_xunion_tag_t>(ordinal_)) { |
| case 1: { |
| ::fidl::tracking_ptr<::llcpp::fidl::test::json::Example_foo_Response> |
| to_destroy = static_cast<::fidl::tracking_ptr< |
| ::llcpp::fidl::test::json::Example_foo_Response>>( |
| std::move(envelope_.data)); |
| break; |
| } |
| case 2: { |
| ::fidl::tracking_ptr<uint32_t> to_destroy = |
| static_cast<::fidl::tracking_ptr<uint32_t>>( |
| std::move(envelope_.data)); |
| break; |
| } |
| } |
| |
| envelope_.data = std::move(new_ptr); |
| } |
| |
| static void SizeAndOffsetAssertionHelper(); |
| Ordinal ordinal_; |
| FIDL_ALIGNDECL |
| ::fidl::Envelope<void> envelope_; |
| }; |
| |
| extern "C" const fidl_type_t fidl_test_json_Example_foo_ResponseTable; |
| |
| struct Example_foo_Response { |
| static constexpr const fidl_type_t* Type = |
| &fidl_test_json_Example_foo_ResponseTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 8; |
| [[maybe_unused]] static constexpr uint32_t MaxOutOfLine = 0; |
| static constexpr bool HasPointer = false; |
| static constexpr bool IsResource = false; |
| |
| int64_t y = {}; |
| void _CloseHandles(); |
| }; |
| |
| extern "C" const fidl_type_t fidl_test_json_ExamplefooRequestTable; |
| extern "C" const fidl_type_t fidl_test_json_ExamplefooResponseTable; |
| |
| class Example final { |
| Example() = delete; |
| |
| public: |
| struct fooResponse final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::llcpp::fidl::test::json::Example_foo_Result result; |
| explicit fooResponse(::llcpp::fidl::test::json::Example_foo_Result& result) |
| : result(std::move(result)) { |
| _InitHeader(); |
| } |
| fooResponse() { _InitHeader(); } |
| |
| static constexpr const fidl_type_t* Type = |
| &fidl_test_json_ExamplefooResponseTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 40; |
| static constexpr uint32_t MaxOutOfLine = 8; |
| static constexpr bool HasFlexibleEnvelope = false; |
| static constexpr bool HasPointer = true; |
| static constexpr bool IsResource = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kResponse; |
| |
| private: |
| void _InitHeader(); |
| }; |
| struct fooRequest final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::StringView s; |
| explicit fooRequest(zx_txid_t _txid, const ::fidl::StringView& s) |
| : s(::fidl::unowned_ptr_t<const char>(s.data()), s.size()) { |
| _InitHeader(_txid); |
| } |
| explicit fooRequest(zx_txid_t _txid) { _InitHeader(_txid); } |
| |
| static constexpr const fidl_type_t* Type = |
| &fidl_test_json_ExamplefooRequestTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 32; |
| static constexpr uint32_t MaxOutOfLine = 4294967295; |
| static constexpr uint32_t AltPrimarySize = 32; |
| static constexpr uint32_t AltMaxOutOfLine = 4294967295; |
| static constexpr bool HasFlexibleEnvelope = false; |
| static constexpr bool HasPointer = true; |
| static constexpr bool IsResource = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| using ResponseType = fooResponse; |
| |
| private: |
| void _InitHeader(zx_txid_t _txid); |
| }; |
| |
| // Collection of return types of FIDL calls in this protocol. |
| class ResultOf final { |
| ResultOf() = delete; |
| |
| public: |
| class foo final : public ::fidl::Result { |
| public: |
| explicit foo(zx_handle_t _client, const ::fidl::StringView& s); |
| foo(zx_handle_t _client, const ::fidl::StringView& s, |
| zx_time_t _deadline); |
| explicit foo(const ::fidl::Result& result) : ::fidl::Result(result) {} |
| foo(foo&&) = delete; |
| foo(const foo&) = delete; |
| foo* operator=(foo&&) = delete; |
| foo* operator=(const foo&) = delete; |
| ~foo() = default; |
| |
| fooResponse* Unwrap() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<fooResponse*>(bytes_); |
| } |
| const fooResponse* Unwrap() const { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<const fooResponse*>(bytes_); |
| } |
| |
| fooResponse& value() { return *Unwrap(); } |
| const fooResponse& value() const { return *Unwrap(); } |
| |
| fooResponse* operator->() { return &value(); } |
| const fooResponse* operator->() const { return &value(); } |
| |
| fooResponse& operator*() { return value(); } |
| const fooResponse& operator*() const { return value(); } |
| |
| private: |
| FIDL_ALIGNDECL |
| uint8_t bytes_[fooResponse::PrimarySize + fooResponse::MaxOutOfLine]; |
| }; |
| }; |
| |
| // Collection of return types of FIDL calls in this protocol, |
| // when the caller-allocate flavor or in-place call is used. |
| class UnownedResultOf final { |
| UnownedResultOf() = delete; |
| |
| public: |
| class foo final : public ::fidl::Result { |
| public: |
| explicit foo(zx_handle_t _client, uint8_t* _request_bytes, |
| uint32_t _request_byte_capacity, const ::fidl::StringView& s, |
| uint8_t* _response_bytes, uint32_t _response_byte_capacity); |
| explicit foo(const ::fidl::Result& result) : ::fidl::Result(result) {} |
| foo(foo&&) = delete; |
| foo(const foo&) = delete; |
| foo* operator=(foo&&) = delete; |
| foo* operator=(const foo&) = delete; |
| ~foo() = default; |
| |
| fooResponse* Unwrap() { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<fooResponse*>(bytes_); |
| } |
| const fooResponse* Unwrap() const { |
| ZX_DEBUG_ASSERT(ok()); |
| return reinterpret_cast<const fooResponse*>(bytes_); |
| } |
| |
| fooResponse& value() { return *Unwrap(); } |
| const fooResponse& value() const { return *Unwrap(); } |
| |
| fooResponse* operator->() { return &value(); } |
| const fooResponse* operator->() const { return &value(); } |
| |
| fooResponse& operator*() { return value(); } |
| const fooResponse& operator*() const { return value(); } |
| |
| private: |
| uint8_t* bytes_; |
| }; |
| }; |
| |
| class fooUnownedResponse final { |
| public: |
| fooUnownedResponse(uint8_t* _bytes, uint32_t _byte_size, |
| ::llcpp::fidl::test::json::Example_foo_Result& result) |
| : message_(_bytes, _byte_size, sizeof(fooResponse), nullptr, 0, 0) { |
| FIDL_ALIGNDECL fooResponse _response(result); |
| message_.LinearizeAndEncode(fooResponse::Type, &_response); |
| } |
| |
| zx_status_t status() const { return message_.status(); } |
| bool ok() const { return message_.status() == ZX_OK; } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::FidlMessage& GetFidlMessage() { return message_; } |
| |
| void Write(zx_handle_t client) { message_.Write(client); } |
| |
| private: |
| fooResponse& Message() { |
| return *reinterpret_cast<fooResponse*>(message_.bytes()); |
| } |
| ::fidl::FidlMessage message_; |
| }; |
| |
| class fooOwnedResponse final { |
| public: |
| explicit fooOwnedResponse( |
| ::llcpp::fidl::test::json::Example_foo_Result& result) |
| : message_(bytes_, sizeof(bytes_), result) {} |
| |
| zx_status_t status() const { return message_.status(); } |
| bool ok() const { return message_.ok(); } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::FidlMessage& GetFidlMessage() { return message_.GetFidlMessage(); } |
| |
| void Write(zx_handle_t client) { message_.Write(client); } |
| |
| private: |
| FIDL_ALIGNDECL |
| uint8_t bytes_[fooResponse::PrimarySize + fooResponse::MaxOutOfLine]; |
| fooUnownedResponse message_; |
| }; |
| |
| class fooUnownedRequest final { |
| public: |
| fooUnownedRequest(uint8_t* _bytes, uint32_t _byte_size, zx_txid_t _txid, |
| const ::fidl::StringView& s) |
| : message_(_bytes, _byte_size, sizeof(fooRequest), nullptr, 0, 0) { |
| FIDL_ALIGNDECL fooRequest _request(_txid, s); |
| message_.LinearizeAndEncode(fooRequest::Type, &_request); |
| } |
| |
| zx_status_t status() const { return message_.status(); } |
| bool ok() const { return message_.status() == ZX_OK; } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::FidlMessage& GetFidlMessage() { return message_; } |
| |
| void Write(zx_handle_t client) { message_.Write(client); } |
| |
| private: |
| fooRequest& Message() { |
| return *reinterpret_cast<fooRequest*>(message_.bytes()); |
| } |
| ::fidl::FidlMessage message_; |
| }; |
| |
| class fooOwnedRequest final { |
| public: |
| explicit fooOwnedRequest(zx_txid_t _txid, const ::fidl::StringView& s) |
| : bytes_(std::make_unique< |
| ::fidl::internal::AlignedBuffer<ZX_CHANNEL_MAX_MSG_BYTES>>()), |
| message_(bytes_->data(), ZX_CHANNEL_MAX_MSG_BYTES, _txid, s) {} |
| |
| zx_status_t status() const { return message_.status(); } |
| bool ok() const { return message_.ok(); } |
| const char* error() const { return message_.error(); } |
| |
| ::fidl::FidlMessage& GetFidlMessage() { return message_.GetFidlMessage(); } |
| |
| void Write(zx_handle_t client) { message_.Write(client); } |
| |
| private: |
| std::unique_ptr<::fidl::internal::AlignedBuffer<ZX_CHANNEL_MAX_MSG_BYTES>> |
| bytes_; |
| fooUnownedRequest message_; |
| }; |
| |
| // Methods to make a sync FIDL call directly on an unowned channel, avoiding |
| // setting up a client. |
| class Call final { |
| Call() = delete; |
| |
| public: |
| // Allocates 48 bytes of response buffer on the stack. Request is |
| // heap-allocated. |
| static ResultOf::foo foo(::zx::unowned_channel _client_end, |
| ::fidl::StringView s) { |
| return ResultOf::foo(_client_end->get(), s); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| static UnownedResultOf::foo foo(::zx::unowned_channel _client_end, |
| ::fidl::BytePart _request_buffer, |
| ::fidl::StringView s, |
| ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::foo(_client_end->get(), _request_buffer.data(), |
| _request_buffer.capacity(), s, |
| _response_buffer.data(), |
| _response_buffer.capacity()); |
| } |
| }; |
| |
| class SyncClient final { |
| public: |
| SyncClient() = default; |
| explicit SyncClient(::zx::channel channel) : channel_(std::move(channel)) {} |
| ~SyncClient() = default; |
| SyncClient(SyncClient&&) = default; |
| SyncClient& operator=(SyncClient&&) = default; |
| |
| const ::zx::channel& channel() const { return channel_; } |
| |
| ::zx::channel* mutable_channel() { return &channel_; } |
| |
| // Allocates 48 bytes of response buffer on the stack. Request is |
| // heap-allocated. |
| ResultOf::foo foo(::fidl::StringView s) { |
| return ResultOf::foo(this->channel().get(), s); |
| } |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| UnownedResultOf::foo foo(::fidl::BytePart _request_buffer, |
| ::fidl::StringView s, |
| ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::foo(this->channel().get(), _request_buffer.data(), |
| _request_buffer.capacity(), s, |
| _response_buffer.data(), |
| _response_buffer.capacity()); |
| } |
| |
| private: |
| ::zx::channel channel_; |
| }; |
| |
| struct AsyncEventHandlers; |
| class fooResponseContext; |
| class ClientImpl; |
| |
| // Pure-virtual interface to be implemented by a server. |
| class Interface { |
| public: |
| Interface() = default; |
| virtual ~Interface() = default; |
| |
| // The marker protocol type within which this |Interface| class is defined. |
| using _EnclosingProtocol = Example; |
| |
| class fooCompleterBase : 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( |
| ::llcpp::fidl::test::json::Example_foo_Result result); |
| ::fidl::Result ReplySuccess(int64_t y); |
| ::fidl::Result ReplyError(uint32_t error); |
| ::fidl::Result Reply( |
| ::fidl::BytePart _buffer, |
| ::llcpp::fidl::test::json::Example_foo_Result result); |
| ::fidl::Result ReplySuccess(::fidl::BytePart _buffer, int64_t y); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| using fooCompleter = ::fidl::Completer<fooCompleterBase>; |
| |
| virtual void foo(::fidl::StringView s, fooCompleter::Sync& _completer) = 0; |
| }; |
| |
| // Attempts to dispatch the incoming message to a handler function in the |
| // server implementation. If there is no matching handler, it returns false, |
| // leaving the message and transaction intact. In all other cases, it consumes |
| // the message and returns true. It is possible to chain multiple TryDispatch |
| // functions in this manner. |
| static ::fidl::DispatchResult TryDispatch(Interface* impl, fidl_msg_t* msg, |
| ::fidl::Transaction* txn); |
| |
| // Dispatches the incoming message to one of the handlers functions in the |
| // protocol. If there is no matching handler, it closes all the handles in |
| // |msg| and closes the channel with a |ZX_ERR_NOT_SUPPORTED| epitaph, before |
| // returning false. The message should then be discarded. |
| static ::fidl::DispatchResult Dispatch(Interface* impl, fidl_msg_t* msg, |
| ::fidl::Transaction* txn); |
| |
| // Same as |Dispatch|, but takes a |void*| instead of |Interface*|. |
| // Only used with |fidl::BindServer| to reduce template expansion. |
| // Do not call this method manually. Use |Dispatch| instead. |
| static ::fidl::DispatchResult TypeErasedDispatch(void* impl, fidl_msg_t* msg, |
| ::fidl::Transaction* txn) { |
| return Dispatch(static_cast<Interface*>(impl), msg, txn); |
| } |
| |
| class EventSender; |
| }; |
| |
| } // namespace json |
| } // namespace test |
| } // namespace fidl |
| } // namespace llcpp |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::llcpp::fidl::test::json::Example_foo_Response> |
| : public std::true_type {}; |
| template <> |
| struct IsStruct<::llcpp::fidl::test::json::Example_foo_Response> |
| : public std::true_type {}; |
| static_assert( |
| std::is_standard_layout_v<::llcpp::fidl::test::json::Example_foo_Response>); |
| static_assert(offsetof(::llcpp::fidl::test::json::Example_foo_Response, y) == |
| 0); |
| static_assert(sizeof(::llcpp::fidl::test::json::Example_foo_Response) == |
| ::llcpp::fidl::test::json::Example_foo_Response::PrimarySize); |
| |
| template <> |
| struct IsFidlType<::llcpp::fidl::test::json::Example_foo_Result> |
| : public std::true_type {}; |
| template <> |
| struct IsUnion<::llcpp::fidl::test::json::Example_foo_Result> |
| : public std::true_type {}; |
| static_assert( |
| std::is_standard_layout_v<::llcpp::fidl::test::json::Example_foo_Result>); |
| |
| template <> |
| struct IsFidlType<::llcpp::fidl::test::json::Example::fooRequest> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fidl::test::json::Example::fooRequest> |
| : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fidl::test::json::Example::fooRequest) == |
| ::llcpp::fidl::test::json::Example::fooRequest::PrimarySize); |
| static_assert(offsetof(::llcpp::fidl::test::json::Example::fooRequest, s) == |
| 16); |
| |
| template <> |
| struct IsFidlType<::llcpp::fidl::test::json::Example::fooResponse> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fidl::test::json::Example::fooResponse> |
| : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fidl::test::json::Example::fooResponse) == |
| ::llcpp::fidl::test::json::Example::fooResponse::PrimarySize); |
| static_assert(offsetof(::llcpp::fidl::test::json::Example::fooResponse, |
| result) == 16); |
| |
| } // namespace fidl |
| |
| namespace llcpp { |
| |
| namespace fidl { |
| namespace test { |
| namespace json { |
| |
| struct Example::AsyncEventHandlers {}; |
| |
| class Example::fooResponseContext : public ::fidl::internal::ResponseContext { |
| public: |
| fooResponseContext(); |
| |
| virtual void OnReply(Example::fooResponse* message) = 0; |
| |
| private: |
| void OnReply(uint8_t* reply) override; |
| }; |
| |
| class Example::ClientImpl final : private ::fidl::internal::ClientBase { |
| public: |
| // Asynchronous variant of |Example.foo()|. The request and callback are |
| // allocated on the heap. |
| ::fidl::Result foo(::fidl::StringView s, |
| ::fit::callback<void( |
| ::llcpp::fidl::test::json::Example_foo_Result result)> |
| _cb); |
| // Asynchronous variant of |Example.foo()|. 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. |
| ::fidl::Result foo(::fidl::BytePart _request_buffer, ::fidl::StringView s, |
| fooResponseContext* _context); |
| // Synchronous variant of |Example.foo()|. Allocates 48 bytes of response |
| // buffer on the stack. Request is heap-allocated. |
| ResultOf::foo foo_Sync(::fidl::StringView s); |
| |
| // Synchronous variant of |Example.foo()|. Caller provides the backing storage |
| // for FIDL message via request and response buffers. |
| UnownedResultOf::foo foo_Sync(::fidl::BytePart _request_buffer, |
| ::fidl::StringView s, |
| ::fidl::BytePart _response_buffer); |
| |
| private: |
| friend class ::fidl::Client<Example>; |
| |
| explicit ClientImpl(AsyncEventHandlers handlers) |
| : handlers_(std::move(handlers)) {} |
| |
| std::optional<::fidl::UnbindInfo> DispatchEvent(fidl_msg_t* msg) override; |
| |
| AsyncEventHandlers handlers_; |
| }; |
| |
| class Example::EventSender { |
| public: |
| private: |
| friend class ::fidl::ServerBindingRef<Example>; |
| |
| explicit EventSender( |
| std::weak_ptr<::fidl::internal::AsyncServerBinding> binding) |
| : binding_(std::move(binding)) {} |
| |
| std::weak_ptr<::fidl::internal::AsyncServerBinding> binding_; |
| }; |
| |
| } // namespace json |
| } // namespace test |
| } // namespace fidl |
| } // namespace llcpp |