| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <lib/fidl/internal.h> |
| #include <lib/fidl/cpp/vector_view.h> |
| #include <lib/fidl/cpp/string_view.h> |
| #include <lib/fidl/llcpp/array_wrapper.h> |
| #include <lib/fidl/llcpp/coding.h> |
| #include <lib/fidl/llcpp/traits.h> |
| #include <lib/zx/channel.h> |
| #include <lib/zx/eventpair.h> |
| #include <zircon/fidl.h> |
| |
| namespace fidl { |
| namespace test { |
| namespace llcpp { |
| namespace dirent { |
| |
| struct DirEnt; |
| class DirEntTestInterface; |
| |
| constexpr uint32_t SMALL_DIR_VECTOR_SIZE = 3; |
| |
| constexpr uint32_t TEST_MAX_PATH = 10; |
| |
| extern "C" const fidl_type_t fidl_test_llcpp_dirent_DirEntTable; |
| |
| // Fake dirent structure to exercise linearization codepaths. |
| struct DirEnt { |
| static constexpr const fidl_type_t* Type = &fidl_test_llcpp_dirent_DirEntTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 32; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 16; |
| |
| bool is_dir{}; |
| |
| ::fidl::StringView name{}; |
| |
| int32_t some_flags{}; |
| }; |
| |
| extern "C" const fidl_type_t fidl_test_llcpp_dirent_DirEntTestInterfaceCountNumDirectoriesRequestTable; |
| extern "C" const fidl_type_t fidl_test_llcpp_dirent_DirEntTestInterfaceReadDirResponseTable; |
| extern "C" const fidl_type_t fidl_test_llcpp_dirent_DirEntTestInterfaceConsumeDirectoriesRequestTable; |
| extern "C" const fidl_type_t fidl_test_llcpp_dirent_DirEntTestInterfaceOnDirentsEventTable; |
| extern "C" const fidl_type_t fidl_test_llcpp_dirent_DirEntTestInterfaceOneWayDirentsRequestTable; |
| |
| // Test interface implemented by LLCPP, with a manually written server, |
| // since types with more than one level of indirections are not handled by the C binding. |
| class DirEntTestInterface final { |
| public: |
| |
| struct CountNumDirectoriesResponse { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| int64_t num_dir; |
| |
| static constexpr const fidl_type_t* Type = nullptr; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 24; |
| static constexpr uint32_t MaxOutOfLine = 0; |
| }; |
| struct CountNumDirectoriesRequest { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::VectorView<DirEnt> dirents; |
| |
| static constexpr const fidl_type_t* Type = &fidl_test_llcpp_dirent_DirEntTestInterfaceCountNumDirectoriesRequestTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 32; |
| static constexpr uint32_t MaxOutOfLine = 48000; |
| using ResponseType = CountNumDirectoriesResponse; |
| }; |
| |
| struct ReadDirResponse { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::VectorView<DirEnt> dirents; |
| |
| static constexpr const fidl_type_t* Type = &fidl_test_llcpp_dirent_DirEntTestInterfaceReadDirResponseTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 32; |
| static constexpr uint32_t MaxOutOfLine = 144; |
| }; |
| using ReadDirRequest = ::fidl::AnyZeroArgMessage; |
| |
| using ConsumeDirectoriesResponse = ::fidl::AnyZeroArgMessage; |
| struct ConsumeDirectoriesRequest { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::VectorView<DirEnt> dirents; |
| |
| static constexpr const fidl_type_t* Type = &fidl_test_llcpp_dirent_DirEntTestInterfaceConsumeDirectoriesRequestTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 32; |
| static constexpr uint32_t MaxOutOfLine = 144; |
| }; |
| |
| struct OnDirentsResponse { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::VectorView<DirEnt> dirents; |
| |
| static constexpr const fidl_type_t* Type = &fidl_test_llcpp_dirent_DirEntTestInterfaceOnDirentsEventTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 32; |
| static constexpr uint32_t MaxOutOfLine = 48000; |
| }; |
| struct OneWayDirentsRequest { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::fidl::VectorView<DirEnt> dirents; |
| ::zx::eventpair ep; |
| |
| static constexpr const fidl_type_t* Type = &fidl_test_llcpp_dirent_DirEntTestInterfaceOneWayDirentsRequestTable; |
| static constexpr uint32_t MaxNumHandles = 1; |
| static constexpr uint32_t PrimarySize = 40; |
| static constexpr uint32_t MaxOutOfLine = 48000; |
| }; |
| |
| |
| class SyncClient final { |
| public: |
| SyncClient(::zx::channel channel) : channel_(std::move(channel)) {} |
| |
| ~SyncClient() {} |
| |
| // Iterate over the dirents and return the number of directories within them. |
| zx_status_t CountNumDirectories(::fidl::VectorView<DirEnt> dirents, int64_t* out_num_dir); |
| |
| // Iterate over the dirents and return the number of directories within them. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| zx_status_t CountNumDirectories(::fidl::BytePart _request_buffer, ::fidl::VectorView<DirEnt> dirents, ::fidl::BytePart _response_buffer, int64_t* out_num_dir); |
| |
| // Iterate over the dirents and return the number of directories within them. |
| // Messages are encoded and decoded in-place. |
| ::fidl::DecodeResult<CountNumDirectoriesResponse> CountNumDirectories(::fidl::DecodedMessage<CountNumDirectoriesRequest> params, ::fidl::BytePart response_buffer); |
| |
| |
| // Return a vector of dirents. Empty request. Response may stack-allocate. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| zx_status_t ReadDir(::fidl::BytePart _response_buffer, ::fidl::VectorView<DirEnt>* out_dirents); |
| |
| // Return a vector of dirents. Empty request. Response may stack-allocate. |
| // Messages are encoded and decoded in-place. |
| ::fidl::DecodeResult<ReadDirResponse> ReadDir(::fidl::BytePart response_buffer); |
| |
| // Consume dirents. Empty response. Request may stack-allocate. |
| zx_status_t ConsumeDirectories(::fidl::VectorView<DirEnt> dirents); |
| |
| // Consume dirents. Empty response. Request may stack-allocate. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| zx_status_t ConsumeDirectories(::fidl::BytePart _request_buffer, ::fidl::VectorView<DirEnt> dirents); |
| |
| // Consume dirents. Empty response. Request may stack-allocate. |
| // Messages are encoded and decoded in-place. |
| zx_status_t ConsumeDirectories(::fidl::DecodedMessage<ConsumeDirectoriesRequest> params); |
| |
| // Binding will not wait for response. |
| // But here we send an eventpair which the server will signal upon receipt of message. |
| zx_status_t OneWayDirents(::fidl::VectorView<DirEnt> dirents, ::zx::eventpair ep); |
| |
| // Binding will not wait for response. |
| // But here we send an eventpair which the server will signal upon receipt of message. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| zx_status_t OneWayDirents(::fidl::BytePart _request_buffer, ::fidl::VectorView<DirEnt> dirents, ::zx::eventpair ep); |
| |
| // Binding will not wait for response. |
| // But here we send an eventpair which the server will signal upon receipt of message. |
| // Messages are encoded and decoded in-place. |
| zx_status_t OneWayDirents(::fidl::DecodedMessage<OneWayDirentsRequest> params); |
| |
| private: |
| ::zx::channel channel_; |
| }; |
| |
| }; |
| |
| } // namespace dirent |
| } // namespace llcpp |
| } // namespace test |
| } // namespace fidl |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::fidl::test::llcpp::dirent::DirEnt> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::fidl::test::llcpp::dirent::DirEnt>); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEnt, is_dir) == 0); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEnt, name) == 8); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEnt, some_flags) == 24); |
| static_assert(sizeof(::fidl::test::llcpp::dirent::DirEnt) == ::fidl::test::llcpp::dirent::DirEnt::PrimarySize); |
| |
| template <> |
| struct IsFidlType<::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesRequest> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesRequest> : public std::true_type {}; |
| static_assert(sizeof(::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesRequest) |
| == ::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesRequest::PrimarySize); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesRequest, dirents) == 16); |
| |
| template <> |
| struct IsFidlType<::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesResponse> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesResponse> : public std::true_type {}; |
| static_assert(sizeof(::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesResponse) |
| == ::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesResponse::PrimarySize); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEntTestInterface::CountNumDirectoriesResponse, num_dir) == 16); |
| |
| template <> |
| struct IsFidlType<::fidl::test::llcpp::dirent::DirEntTestInterface::ReadDirResponse> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::fidl::test::llcpp::dirent::DirEntTestInterface::ReadDirResponse> : public std::true_type {}; |
| static_assert(sizeof(::fidl::test::llcpp::dirent::DirEntTestInterface::ReadDirResponse) |
| == ::fidl::test::llcpp::dirent::DirEntTestInterface::ReadDirResponse::PrimarySize); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEntTestInterface::ReadDirResponse, dirents) == 16); |
| |
| template <> |
| struct IsFidlType<::fidl::test::llcpp::dirent::DirEntTestInterface::ConsumeDirectoriesRequest> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::fidl::test::llcpp::dirent::DirEntTestInterface::ConsumeDirectoriesRequest> : public std::true_type {}; |
| static_assert(sizeof(::fidl::test::llcpp::dirent::DirEntTestInterface::ConsumeDirectoriesRequest) |
| == ::fidl::test::llcpp::dirent::DirEntTestInterface::ConsumeDirectoriesRequest::PrimarySize); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEntTestInterface::ConsumeDirectoriesRequest, dirents) == 16); |
| |
| template <> |
| struct IsFidlType<::fidl::test::llcpp::dirent::DirEntTestInterface::OnDirentsResponse> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::fidl::test::llcpp::dirent::DirEntTestInterface::OnDirentsResponse> : public std::true_type {}; |
| static_assert(sizeof(::fidl::test::llcpp::dirent::DirEntTestInterface::OnDirentsResponse) |
| == ::fidl::test::llcpp::dirent::DirEntTestInterface::OnDirentsResponse::PrimarySize); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEntTestInterface::OnDirentsResponse, dirents) == 16); |
| |
| template <> |
| struct IsFidlType<::fidl::test::llcpp::dirent::DirEntTestInterface::OneWayDirentsRequest> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::fidl::test::llcpp::dirent::DirEntTestInterface::OneWayDirentsRequest> : public std::true_type {}; |
| static_assert(sizeof(::fidl::test::llcpp::dirent::DirEntTestInterface::OneWayDirentsRequest) |
| == ::fidl::test::llcpp::dirent::DirEntTestInterface::OneWayDirentsRequest::PrimarySize); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEntTestInterface::OneWayDirentsRequest, dirents) == 16); |
| static_assert(offsetof(::fidl::test::llcpp::dirent::DirEntTestInterface::OneWayDirentsRequest, ep) == 32); |
| |
| } // namespace fidl |