| // 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/coding.h> |
| #include <lib/fidl/llcpp/connect_service.h> |
| #include <lib/fidl/llcpp/envelope.h> |
| #include <lib/fidl/llcpp/memory.h> |
| #include <lib/fidl/llcpp/service_handler_interface.h> |
| #include <lib/fidl/llcpp/string_view.h> |
| #include <lib/fidl/llcpp/sync_call.h> |
| #include <lib/fidl/llcpp/tracking_ptr.h> |
| #include <lib/fidl/llcpp/traits.h> |
| #include <lib/fidl/llcpp/transaction.h> |
| #include <lib/fidl/llcpp/vector_view.h> |
| #include <lib/fidl/txn_header.h> |
| #include <lib/fit/function.h> |
| #include <lib/zx/channel.h> |
| #include <zircon/fidl.h> |
| |
| namespace llcpp { |
| |
| namespace fidl { |
| namespace test { |
| namespace json { |
| |
| class StrictFoo; |
| class FlexibleFoo; |
| class Protocol; |
| |
| extern "C" const fidl_type_t v1_fidl_test_json_StrictFooTable; |
| |
| class StrictFoo { |
| public: |
| StrictFoo() : ordinal_(Ordinal::Invalid), envelope_{} {} |
| |
| StrictFoo(StrictFoo&&) = default; |
| StrictFoo& operator=(StrictFoo&&) = default; |
| |
| ~StrictFoo() { reset_ptr(nullptr); } |
| |
| enum class Tag : fidl_xunion_tag_t { |
| kS = 1, // 0x1 |
| kI = 2, // 0x2 |
| }; |
| |
| bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; } |
| |
| bool is_s() const { return ordinal_ == Ordinal::kS; } |
| |
| static StrictFoo WithS(::fidl::tracking_ptr<::fidl::StringView>&& val) { |
| StrictFoo result; |
| result.set_s(std::move(val)); |
| return result; |
| } |
| |
| void set_s(::fidl::tracking_ptr<::fidl::StringView>&& elem) { |
| ordinal_ = Ordinal::kS; |
| reset_ptr(static_cast<::fidl::tracking_ptr<void>>(std::move(elem))); |
| } |
| |
| ::fidl::StringView& mutable_s() { |
| ZX_ASSERT(ordinal_ == Ordinal::kS); |
| return *static_cast<::fidl::StringView*>(envelope_.data.get()); |
| } |
| const ::fidl::StringView& s() const { |
| ZX_ASSERT(ordinal_ == Ordinal::kS); |
| return *static_cast<::fidl::StringView*>(envelope_.data.get()); |
| } |
| |
| bool is_i() const { return ordinal_ == Ordinal::kI; } |
| |
| static StrictFoo WithI(::fidl::tracking_ptr<int32_t>&& val) { |
| StrictFoo result; |
| result.set_i(std::move(val)); |
| return result; |
| } |
| |
| void set_i(::fidl::tracking_ptr<int32_t>&& elem) { |
| ordinal_ = Ordinal::kI; |
| reset_ptr(static_cast<::fidl::tracking_ptr<void>>(std::move(elem))); |
| } |
| |
| int32_t& mutable_i() { |
| ZX_ASSERT(ordinal_ == Ordinal::kI); |
| return *static_cast<int32_t*>(envelope_.data.get()); |
| } |
| const int32_t& i() const { |
| ZX_ASSERT(ordinal_ == Ordinal::kI); |
| return *static_cast<int32_t*>(envelope_.data.get()); |
| } |
| Tag which() const { |
| ZX_ASSERT(!has_invalid_tag()); |
| return static_cast<Tag>(ordinal_); |
| } |
| |
| static constexpr const fidl_type_t* Type = &v1_fidl_test_json_StrictFooTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 24; |
| [[maybe_unused]] static constexpr uint32_t MaxOutOfLine = 4294967295; |
| static constexpr bool HasPointer = true; |
| |
| private: |
| enum class Ordinal : fidl_xunion_tag_t { |
| Invalid = 0, |
| kS = 1, // 0x1 |
| kI = 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<::fidl::StringView> to_destroy = |
| static_cast<::fidl::tracking_ptr<::fidl::StringView>>( |
| std::move(envelope_.data)); |
| break; |
| } |
| case 2: { |
| ::fidl::tracking_ptr<int32_t> to_destroy = |
| static_cast<::fidl::tracking_ptr<int32_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 v1_fidl_test_json_FlexibleFooTable; |
| |
| class FlexibleFoo { |
| public: |
| FlexibleFoo() : ordinal_(Ordinal::Invalid), envelope_{} {} |
| |
| FlexibleFoo(FlexibleFoo&&) = default; |
| FlexibleFoo& operator=(FlexibleFoo&&) = default; |
| |
| ~FlexibleFoo() { reset_ptr(nullptr); } |
| |
| enum class Tag : fidl_xunion_tag_t { |
| kS = 1, // 0x1 |
| kI = 2, // 0x2 |
| kUnknown = ::std::numeric_limits<::fidl_union_tag_t>::max(), |
| }; |
| |
| bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; } |
| |
| bool is_s() const { return ordinal_ == Ordinal::kS; } |
| |
| static FlexibleFoo WithS(::fidl::tracking_ptr<::fidl::StringView>&& val) { |
| FlexibleFoo result; |
| result.set_s(std::move(val)); |
| return result; |
| } |
| |
| void set_s(::fidl::tracking_ptr<::fidl::StringView>&& elem) { |
| ordinal_ = Ordinal::kS; |
| reset_ptr(static_cast<::fidl::tracking_ptr<void>>(std::move(elem))); |
| } |
| |
| ::fidl::StringView& mutable_s() { |
| ZX_ASSERT(ordinal_ == Ordinal::kS); |
| return *static_cast<::fidl::StringView*>(envelope_.data.get()); |
| } |
| const ::fidl::StringView& s() const { |
| ZX_ASSERT(ordinal_ == Ordinal::kS); |
| return *static_cast<::fidl::StringView*>(envelope_.data.get()); |
| } |
| |
| bool is_i() const { return ordinal_ == Ordinal::kI; } |
| |
| static FlexibleFoo WithI(::fidl::tracking_ptr<int32_t>&& val) { |
| FlexibleFoo result; |
| result.set_i(std::move(val)); |
| return result; |
| } |
| |
| void set_i(::fidl::tracking_ptr<int32_t>&& elem) { |
| ordinal_ = Ordinal::kI; |
| reset_ptr(static_cast<::fidl::tracking_ptr<void>>(std::move(elem))); |
| } |
| |
| int32_t& mutable_i() { |
| ZX_ASSERT(ordinal_ == Ordinal::kI); |
| return *static_cast<int32_t*>(envelope_.data.get()); |
| } |
| const int32_t& i() const { |
| ZX_ASSERT(ordinal_ == Ordinal::kI); |
| return *static_cast<int32_t*>(envelope_.data.get()); |
| } |
| void* unknownData() const { |
| ZX_ASSERT(which() == Tag::kUnknown); |
| return envelope_.data.get(); |
| } |
| Tag which() const; |
| |
| static constexpr const fidl_type_t* Type = |
| &v1_fidl_test_json_FlexibleFooTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 24; |
| [[maybe_unused]] static constexpr uint32_t MaxOutOfLine = 4294967295; |
| static constexpr bool HasPointer = true; |
| |
| private: |
| enum class Ordinal : fidl_xunion_tag_t { |
| Invalid = 0, |
| kS = 1, // 0x1 |
| kI = 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<::fidl::StringView> to_destroy = |
| static_cast<::fidl::tracking_ptr<::fidl::StringView>>( |
| std::move(envelope_.data)); |
| break; |
| } |
| case 2: { |
| ::fidl::tracking_ptr<int32_t> to_destroy = |
| static_cast<::fidl::tracking_ptr<int32_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 |
| v1_fidl_test_json_ProtocolRequestStrictResponseFlexibleRequestTable; |
| extern "C" const fidl_type_t |
| v1_fidl_test_json_ProtocolRequestStrictResponseFlexibleResponseTable; |
| extern "C" const fidl_type_t |
| v1_fidl_test_json_ProtocolRequestFlexibleResponseStrictRequestTable; |
| extern "C" const fidl_type_t |
| v1_fidl_test_json_ProtocolRequestFlexibleResponseStrictResponseTable; |
| |
| class Protocol final { |
| Protocol() = delete; |
| |
| public: |
| struct RequestStrictResponseFlexibleResponse final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::llcpp::fidl::test::json::FlexibleFoo f; |
| |
| static constexpr const fidl_type_t* Type = |
| &v1_fidl_test_json_ProtocolRequestStrictResponseFlexibleResponseTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 40; |
| static constexpr uint32_t MaxOutOfLine = 4294967295; |
| static constexpr bool HasFlexibleEnvelope = true; |
| static constexpr bool HasPointer = true; |
| static constexpr bool ContainsUnion = true; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kResponse; |
| }; |
| struct RequestStrictResponseFlexibleRequest final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::llcpp::fidl::test::json::StrictFoo s; |
| |
| static constexpr const fidl_type_t* Type = |
| &v1_fidl_test_json_ProtocolRequestStrictResponseFlexibleRequestTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 40; |
| static constexpr uint32_t MaxOutOfLine = 4294967295; |
| static constexpr uint32_t AltPrimarySize = 40; |
| static constexpr uint32_t AltMaxOutOfLine = 4294967295; |
| static constexpr bool HasFlexibleEnvelope = false; |
| static constexpr bool HasPointer = true; |
| static constexpr bool ContainsUnion = true; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| using ResponseType = RequestStrictResponseFlexibleResponse; |
| }; |
| |
| struct RequestFlexibleResponseStrictResponse final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::llcpp::fidl::test::json::StrictFoo f; |
| |
| static constexpr const fidl_type_t* Type = |
| &v1_fidl_test_json_ProtocolRequestFlexibleResponseStrictResponseTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 40; |
| static constexpr uint32_t MaxOutOfLine = 4294967295; |
| static constexpr bool HasFlexibleEnvelope = false; |
| static constexpr bool HasPointer = true; |
| static constexpr bool ContainsUnion = true; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kResponse; |
| }; |
| struct RequestFlexibleResponseStrictRequest final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::llcpp::fidl::test::json::FlexibleFoo s; |
| |
| static constexpr const fidl_type_t* Type = |
| &v1_fidl_test_json_ProtocolRequestFlexibleResponseStrictRequestTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 40; |
| static constexpr uint32_t MaxOutOfLine = 4294967295; |
| static constexpr uint32_t AltPrimarySize = 40; |
| static constexpr uint32_t AltMaxOutOfLine = 4294967295; |
| static constexpr bool HasFlexibleEnvelope = true; |
| static constexpr bool HasPointer = true; |
| static constexpr bool ContainsUnion = true; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| using ResponseType = RequestFlexibleResponseStrictResponse; |
| }; |
| |
| // Collection of return types of FIDL calls in this protocol. |
| class ResultOf final { |
| ResultOf() = delete; |
| |
| private: |
| template <typename ResponseType> |
| class RequestStrictResponseFlexible_Impl final |
| : private ::fidl::internal::OwnedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>; |
| |
| public: |
| RequestStrictResponseFlexible_Impl( |
| ::zx::unowned_channel _client_end, |
| ::llcpp::fidl::test::json::StrictFoo s); |
| ~RequestStrictResponseFlexible_Impl() = default; |
| RequestStrictResponseFlexible_Impl( |
| RequestStrictResponseFlexible_Impl&& other) = default; |
| RequestStrictResponseFlexible_Impl& operator=( |
| RequestStrictResponseFlexible_Impl&& other) = default; |
| using Super::error; |
| using Super::ok; |
| using Super::status; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| template <typename ResponseType> |
| class RequestFlexibleResponseStrict_Impl final |
| : private ::fidl::internal::OwnedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>; |
| |
| public: |
| RequestFlexibleResponseStrict_Impl( |
| ::zx::unowned_channel _client_end, |
| ::llcpp::fidl::test::json::FlexibleFoo s); |
| ~RequestFlexibleResponseStrict_Impl() = default; |
| RequestFlexibleResponseStrict_Impl( |
| RequestFlexibleResponseStrict_Impl&& other) = default; |
| RequestFlexibleResponseStrict_Impl& operator=( |
| RequestFlexibleResponseStrict_Impl&& other) = default; |
| using Super::error; |
| using Super::ok; |
| using Super::status; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| |
| public: |
| using RequestStrictResponseFlexible = RequestStrictResponseFlexible_Impl< |
| RequestStrictResponseFlexibleResponse>; |
| using RequestFlexibleResponseStrict = RequestFlexibleResponseStrict_Impl< |
| RequestFlexibleResponseStrictResponse>; |
| }; |
| |
| // 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; |
| |
| private: |
| template <typename ResponseType> |
| class RequestStrictResponseFlexible_Impl final |
| : private ::fidl::internal::UnownedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>; |
| |
| public: |
| RequestStrictResponseFlexible_Impl(::zx::unowned_channel _client_end, |
| ::fidl::BytePart _request_buffer, |
| ::llcpp::fidl::test::json::StrictFoo s, |
| ::fidl::BytePart _response_buffer); |
| ~RequestStrictResponseFlexible_Impl() = default; |
| RequestStrictResponseFlexible_Impl( |
| RequestStrictResponseFlexible_Impl&& other) = default; |
| RequestStrictResponseFlexible_Impl& operator=( |
| RequestStrictResponseFlexible_Impl&& other) = default; |
| using Super::error; |
| using Super::ok; |
| using Super::status; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| template <typename ResponseType> |
| class RequestFlexibleResponseStrict_Impl final |
| : private ::fidl::internal::UnownedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>; |
| |
| public: |
| RequestFlexibleResponseStrict_Impl( |
| ::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, |
| ::llcpp::fidl::test::json::FlexibleFoo s, |
| ::fidl::BytePart _response_buffer); |
| ~RequestFlexibleResponseStrict_Impl() = default; |
| RequestFlexibleResponseStrict_Impl( |
| RequestFlexibleResponseStrict_Impl&& other) = default; |
| RequestFlexibleResponseStrict_Impl& operator=( |
| RequestFlexibleResponseStrict_Impl&& other) = default; |
| using Super::error; |
| using Super::ok; |
| using Super::status; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| |
| public: |
| using RequestStrictResponseFlexible = RequestStrictResponseFlexible_Impl< |
| RequestStrictResponseFlexibleResponse>; |
| using RequestFlexibleResponseStrict = RequestFlexibleResponseStrict_Impl< |
| RequestFlexibleResponseStrictResponse>; |
| }; |
| |
| 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_; } |
| |
| // Request is heap-allocated. Response is heap-allocated. |
| ResultOf::RequestStrictResponseFlexible RequestStrictResponseFlexible( |
| ::llcpp::fidl::test::json::StrictFoo s); |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| UnownedResultOf::RequestStrictResponseFlexible |
| RequestStrictResponseFlexible(::fidl::BytePart _request_buffer, |
| ::llcpp::fidl::test::json::StrictFoo s, |
| ::fidl::BytePart _response_buffer); |
| |
| // Request is heap-allocated. Response is heap-allocated. |
| ResultOf::RequestFlexibleResponseStrict RequestFlexibleResponseStrict( |
| ::llcpp::fidl::test::json::FlexibleFoo s); |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| UnownedResultOf::RequestFlexibleResponseStrict |
| RequestFlexibleResponseStrict(::fidl::BytePart _request_buffer, |
| ::llcpp::fidl::test::json::FlexibleFoo s, |
| ::fidl::BytePart _response_buffer); |
| |
| private: |
| ::zx::channel channel_; |
| }; |
| |
| // Methods to make a sync FIDL call directly on an unowned channel, avoiding |
| // setting up a client. |
| class Call final { |
| Call() = delete; |
| |
| public: |
| // Request is heap-allocated. Response is heap-allocated. |
| static ResultOf::RequestStrictResponseFlexible |
| RequestStrictResponseFlexible(::zx::unowned_channel _client_end, |
| ::llcpp::fidl::test::json::StrictFoo s); |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| static UnownedResultOf::RequestStrictResponseFlexible |
| RequestStrictResponseFlexible(::zx::unowned_channel _client_end, |
| ::fidl::BytePart _request_buffer, |
| ::llcpp::fidl::test::json::StrictFoo s, |
| ::fidl::BytePart _response_buffer); |
| |
| // Request is heap-allocated. Response is heap-allocated. |
| static ResultOf::RequestFlexibleResponseStrict |
| RequestFlexibleResponseStrict(::zx::unowned_channel _client_end, |
| ::llcpp::fidl::test::json::FlexibleFoo s); |
| |
| // Caller provides the backing storage for FIDL message via request and |
| // response buffers. |
| static UnownedResultOf::RequestFlexibleResponseStrict |
| RequestFlexibleResponseStrict(::zx::unowned_channel _client_end, |
| ::fidl::BytePart _request_buffer, |
| ::llcpp::fidl::test::json::FlexibleFoo s, |
| ::fidl::BytePart _response_buffer); |
| }; |
| |
| // Messages are encoded and decoded in-place when these methods are used. |
| // Additionally, requests must be already laid-out according to the FIDL |
| // wire-format. |
| class InPlace final { |
| InPlace() = delete; |
| |
| public: |
| static ::fidl::DecodeResult<RequestStrictResponseFlexibleResponse> |
| RequestStrictResponseFlexible( |
| ::zx::unowned_channel _client_end, |
| ::fidl::DecodedMessage<RequestStrictResponseFlexibleRequest> params, |
| ::fidl::BytePart response_buffer); |
| |
| static ::fidl::DecodeResult<RequestFlexibleResponseStrictResponse> |
| RequestFlexibleResponseStrict( |
| ::zx::unowned_channel _client_end, |
| ::fidl::DecodedMessage<RequestFlexibleResponseStrictRequest> params, |
| ::fidl::BytePart response_buffer); |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| class Interface { |
| public: |
| Interface() = default; |
| virtual ~Interface() = default; |
| using _Outer = Protocol; |
| using _Base = ::fidl::CompleterBase; |
| |
| class RequestStrictResponseFlexibleCompleterBase : public _Base { |
| public: |
| void Reply(::llcpp::fidl::test::json::FlexibleFoo f); |
| void Reply(::fidl::BytePart _buffer, |
| ::llcpp::fidl::test::json::FlexibleFoo f); |
| void Reply( |
| ::fidl::DecodedMessage<RequestStrictResponseFlexibleResponse> params); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| using RequestStrictResponseFlexibleCompleter = |
| ::fidl::Completer<RequestStrictResponseFlexibleCompleterBase>; |
| |
| virtual void RequestStrictResponseFlexible( |
| ::llcpp::fidl::test::json::StrictFoo s, |
| RequestStrictResponseFlexibleCompleter::Sync _completer) = 0; |
| |
| class RequestFlexibleResponseStrictCompleterBase : public _Base { |
| public: |
| void Reply(::llcpp::fidl::test::json::StrictFoo f); |
| void Reply(::fidl::BytePart _buffer, |
| ::llcpp::fidl::test::json::StrictFoo f); |
| void Reply( |
| ::fidl::DecodedMessage<RequestFlexibleResponseStrictResponse> params); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| using RequestFlexibleResponseStrictCompleter = |
| ::fidl::Completer<RequestFlexibleResponseStrictCompleterBase>; |
| |
| virtual void RequestFlexibleResponseStrict( |
| ::llcpp::fidl::test::json::FlexibleFoo s, |
| RequestFlexibleResponseStrictCompleter::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 bool 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 bool Dispatch(Interface* impl, fidl_msg_t* msg, |
| ::fidl::Transaction* txn); |
| |
| // Same as |Dispatch|, but takes a |void*| instead of |Interface*|. Only used |
| // with |fidl::Bind| to reduce template expansion. Do not call this method |
| // manually. Use |Dispatch| instead. |
| static bool TypeErasedDispatch(void* impl, fidl_msg_t* msg, |
| ::fidl::Transaction* txn) { |
| return Dispatch(static_cast<Interface*>(impl), msg, txn); |
| } |
| |
| // Helper functions to fill in the transaction header in a |
| // |DecodedMessage<TransactionalMessage>|. |
| class SetTransactionHeaderFor final { |
| SetTransactionHeaderFor() = delete; |
| |
| public: |
| static void RequestStrictResponseFlexibleRequest( |
| const ::fidl::DecodedMessage< |
| Protocol::RequestStrictResponseFlexibleRequest>& _msg); |
| static void RequestStrictResponseFlexibleResponse( |
| const ::fidl::DecodedMessage< |
| Protocol::RequestStrictResponseFlexibleResponse>& _msg); |
| static void RequestFlexibleResponseStrictRequest( |
| const ::fidl::DecodedMessage< |
| Protocol::RequestFlexibleResponseStrictRequest>& _msg); |
| static void RequestFlexibleResponseStrictResponse( |
| const ::fidl::DecodedMessage< |
| Protocol::RequestFlexibleResponseStrictResponse>& _msg); |
| }; |
| }; |
| |
| } // namespace json |
| } // namespace test |
| } // namespace fidl |
| } // namespace llcpp |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::llcpp::fidl::test::json::StrictFoo> |
| : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::llcpp::fidl::test::json::StrictFoo>); |
| |
| template <> |
| struct IsFidlType<::llcpp::fidl::test::json::FlexibleFoo> |
| : public std::true_type {}; |
| static_assert( |
| std::is_standard_layout_v<::llcpp::fidl::test::json::FlexibleFoo>); |
| |
| template <> |
| struct IsFidlType< |
| ::llcpp::fidl::test::json::Protocol::RequestStrictResponseFlexibleRequest> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::llcpp::fidl::test::json::Protocol::RequestStrictResponseFlexibleRequest> |
| : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fidl::test::json::Protocol:: |
| RequestStrictResponseFlexibleRequest) == |
| ::llcpp::fidl::test::json::Protocol:: |
| RequestStrictResponseFlexibleRequest::PrimarySize); |
| static_assert(offsetof(::llcpp::fidl::test::json::Protocol:: |
| RequestStrictResponseFlexibleRequest, |
| s) == 16); |
| |
| template <> |
| struct IsFidlType< |
| ::llcpp::fidl::test::json::Protocol::RequestStrictResponseFlexibleResponse> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::llcpp::fidl::test::json::Protocol::RequestStrictResponseFlexibleResponse> |
| : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fidl::test::json::Protocol:: |
| RequestStrictResponseFlexibleResponse) == |
| ::llcpp::fidl::test::json::Protocol:: |
| RequestStrictResponseFlexibleResponse::PrimarySize); |
| static_assert(offsetof(::llcpp::fidl::test::json::Protocol:: |
| RequestStrictResponseFlexibleResponse, |
| f) == 16); |
| |
| template <> |
| struct IsFidlType< |
| ::llcpp::fidl::test::json::Protocol::RequestFlexibleResponseStrictRequest> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::llcpp::fidl::test::json::Protocol::RequestFlexibleResponseStrictRequest> |
| : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fidl::test::json::Protocol:: |
| RequestFlexibleResponseStrictRequest) == |
| ::llcpp::fidl::test::json::Protocol:: |
| RequestFlexibleResponseStrictRequest::PrimarySize); |
| static_assert(offsetof(::llcpp::fidl::test::json::Protocol:: |
| RequestFlexibleResponseStrictRequest, |
| s) == 16); |
| |
| template <> |
| struct IsFidlType< |
| ::llcpp::fidl::test::json::Protocol::RequestFlexibleResponseStrictResponse> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlMessage< |
| ::llcpp::fidl::test::json::Protocol::RequestFlexibleResponseStrictResponse> |
| : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fidl::test::json::Protocol:: |
| RequestFlexibleResponseStrictResponse) == |
| ::llcpp::fidl::test::json::Protocol:: |
| RequestFlexibleResponseStrictResponse::PrimarySize); |
| static_assert(offsetof(::llcpp::fidl::test::json::Protocol:: |
| RequestFlexibleResponseStrictResponse, |
| f) == 16); |
| |
| } // namespace fidl |