| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <fidl/test.driverhandle/cpp/common_types.h> |
| #include <fidl/test.driverhandle/cpp/markers.h> |
| #include <lib/fidl/cpp/natural_coding_traits.h> |
| #include <lib/fidl/cpp/natural_types.h> |
| |
| #include <cinttypes> |
| #include <string> |
| |
| #ifdef __Fuchsia__ |
| |
| #include <lib/fidl_driver/cpp/natural_types.h> |
| #include <lib/zx/channel.h> |
| #include <lib/zx/event.h> |
| |
| #endif // __Fuchsia__ |
| |
| namespace test_driverhandle { |
| class HandlesInProtocolSendHandlesRequest; |
| |
| class ServerEndWrapper; |
| |
| class ClientEndWrapper; |
| |
| class T; |
| |
| #ifdef __Fuchsia__ |
| |
| extern "C" const fidl_type_t test_driverhandle_TTable; |
| |
| class T { |
| private: |
| struct Storage_; |
| |
| public: |
| T(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| T() noexcept = default; |
| T(T&&) noexcept = default; |
| T& operator=(T&&) noexcept = default; |
| |
| bool IsEmpty() const { |
| return !(storage_.zircon_handle.has_value() || |
| storage_.fdf_handle.has_value()); |
| } |
| |
| const std::optional<::zx::event>& zircon_handle() const { |
| return storage_.zircon_handle; |
| } |
| ::std::optional<::zx::event>& zircon_handle() { |
| return storage_.zircon_handle; |
| } |
| |
| const std::optional<::fdf::ClientEnd<::test_driverhandle::DriverProtocol>>& |
| fdf_handle() const { |
| return storage_.fdf_handle; |
| } |
| ::std::optional<::fdf::ClientEnd<::test_driverhandle::DriverProtocol>>& |
| fdf_handle() { |
| return storage_.fdf_handle; |
| } |
| |
| T(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) |
| : T(Storage_{}) {} |
| |
| private: |
| struct Storage_ final { |
| ::std::optional<::zx::event> zircon_handle{}; |
| ::std::optional<::fdf::ClientEnd<::test_driverhandle::DriverProtocol>> |
| fdf_handle{}; |
| }; |
| |
| // TODO(https://fxbug.dev/91252): Box the storage. |
| Storage_ storage_; |
| friend struct ::fidl::internal::NaturalTableCodingTraits< |
| ::test_driverhandle::T>; |
| friend struct ::fidl::internal::MemberVisitor<::test_driverhandle::T>; |
| static constexpr auto kMembers = std::make_tuple( |
| ::fidl::internal::NaturalTableMember< |
| Storage_, ::zx::event, |
| fidl::internal::NaturalCodingConstraintHandle<ZX_OBJ_TYPE_EVENT, |
| 0x80000000, false>>{ |
| 1, &Storage_::zircon_handle}, |
| ::fidl::internal::NaturalTableMember< |
| Storage_, ::fdf::ClientEnd<::test_driverhandle::DriverProtocol>, |
| fidl::internal::NaturalCodingConstraintHandle< |
| ZX_OBJ_TYPE_CHANNEL, ZX_DEFAULT_CHANNEL_RIGHTS, false>>{ |
| 2, &Storage_::fdf_handle}); |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| extern "C" const fidl_type_t |
| test_driverhandle_HandlesInProtocolSendHandlesRequestTable; |
| |
| class HandlesInProtocolSendHandlesRequest { |
| private: |
| struct Storage_; |
| |
| public: |
| HandlesInProtocolSendHandlesRequest(Storage_ storage) noexcept |
| : storage_(std::move(storage)) {} |
| HandlesInProtocolSendHandlesRequest(::test_driverhandle::T t) noexcept |
| : storage_({.t = std::move(t)}) {} |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wdefaulted-function-deleted" |
| // Default constructs a |HandlesInProtocolSendHandlesRequest| only if all of |
| // its members are default constructible. |
| HandlesInProtocolSendHandlesRequest() = default; |
| #pragma clang diagnostic pop |
| |
| HandlesInProtocolSendHandlesRequest( |
| HandlesInProtocolSendHandlesRequest&&) noexcept = default; |
| HandlesInProtocolSendHandlesRequest& operator=( |
| HandlesInProtocolSendHandlesRequest&&) noexcept = default; |
| |
| const ::test_driverhandle::T& t() const { return storage_.t; } |
| |
| ::test_driverhandle::T& t() { return storage_.t; } |
| |
| HandlesInProtocolSendHandlesRequest( |
| ::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) |
| : HandlesInProtocolSendHandlesRequest(Storage_{ |
| .t = ::fidl::internal::DefaultConstructPossiblyInvalidObjectTag{}, |
| }) {} |
| |
| private: |
| struct Storage_ final { |
| ::test_driverhandle::T t; |
| }; |
| |
| Storage_ storage_; |
| |
| friend struct ::fidl::internal::NaturalStructCodingTraits< |
| ::test_driverhandle::HandlesInProtocolSendHandlesRequest, 16>; |
| friend struct ::fidl::internal::MemberVisitor< |
| ::test_driverhandle::HandlesInProtocolSendHandlesRequest>; |
| static constexpr auto kMembers = std::make_tuple( |
| ::fidl::internal::NaturalStructMember< |
| Storage_, ::test_driverhandle::T, |
| fidl::internal::NaturalCodingConstraintEmpty>{&Storage_::t, 0}); |
| static constexpr auto kPadding = std::make_tuple(); |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| extern "C" const fidl_type_t test_driverhandle_ServerEndWrapperTable; |
| |
| class ServerEndWrapper { |
| private: |
| struct Storage_; |
| |
| public: |
| ServerEndWrapper(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| ServerEndWrapper( |
| ::fdf::ServerEnd<::test_driverhandle::DriverProtocol> value) noexcept |
| : storage_({.value = std::move(value)}) {} |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wdefaulted-function-deleted" |
| // Default constructs a |ServerEndWrapper| only if all of its members are |
| // default constructible. |
| ServerEndWrapper() = default; |
| #pragma clang diagnostic pop |
| |
| ServerEndWrapper(ServerEndWrapper&&) noexcept = default; |
| ServerEndWrapper& operator=(ServerEndWrapper&&) noexcept = default; |
| |
| const ::fdf::ServerEnd<::test_driverhandle::DriverProtocol>& value() const { |
| return storage_.value; |
| } |
| |
| ::fdf::ServerEnd<::test_driverhandle::DriverProtocol>& value() { |
| return storage_.value; |
| } |
| |
| ServerEndWrapper(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) |
| : ServerEndWrapper(Storage_{ |
| .value = {}, |
| }) {} |
| |
| private: |
| struct Storage_ final { |
| ::fdf::ServerEnd<::test_driverhandle::DriverProtocol> value; |
| }; |
| |
| Storage_ storage_; |
| |
| friend struct ::fidl::internal::NaturalStructCodingTraits< |
| ::test_driverhandle::ServerEndWrapper, 4>; |
| friend struct ::fidl::internal::MemberVisitor< |
| ::test_driverhandle::ServerEndWrapper>; |
| static constexpr auto kMembers = std::make_tuple( |
| ::fidl::internal::NaturalStructMember< |
| Storage_, ::fdf::ServerEnd<::test_driverhandle::DriverProtocol>, |
| fidl::internal::NaturalCodingConstraintHandle< |
| ZX_OBJ_TYPE_CHANNEL, ZX_DEFAULT_CHANNEL_RIGHTS, false>>{ |
| &Storage_::value, 0}); |
| static constexpr auto kPadding = std::make_tuple(); |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| extern "C" const fidl_type_t test_driverhandle_ClientEndWrapperTable; |
| |
| class ClientEndWrapper { |
| private: |
| struct Storage_; |
| |
| public: |
| ClientEndWrapper(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| ClientEndWrapper( |
| ::fdf::ClientEnd<::test_driverhandle::DriverProtocol> value) noexcept |
| : storage_({.value = std::move(value)}) {} |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wdefaulted-function-deleted" |
| // Default constructs a |ClientEndWrapper| only if all of its members are |
| // default constructible. |
| ClientEndWrapper() = default; |
| #pragma clang diagnostic pop |
| |
| ClientEndWrapper(ClientEndWrapper&&) noexcept = default; |
| ClientEndWrapper& operator=(ClientEndWrapper&&) noexcept = default; |
| |
| const ::fdf::ClientEnd<::test_driverhandle::DriverProtocol>& value() const { |
| return storage_.value; |
| } |
| |
| ::fdf::ClientEnd<::test_driverhandle::DriverProtocol>& value() { |
| return storage_.value; |
| } |
| |
| ClientEndWrapper(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) |
| : ClientEndWrapper(Storage_{ |
| .value = {}, |
| }) {} |
| |
| private: |
| struct Storage_ final { |
| ::fdf::ClientEnd<::test_driverhandle::DriverProtocol> value; |
| }; |
| |
| Storage_ storage_; |
| |
| friend struct ::fidl::internal::NaturalStructCodingTraits< |
| ::test_driverhandle::ClientEndWrapper, 4>; |
| friend struct ::fidl::internal::MemberVisitor< |
| ::test_driverhandle::ClientEndWrapper>; |
| static constexpr auto kMembers = std::make_tuple( |
| ::fidl::internal::NaturalStructMember< |
| Storage_, ::fdf::ClientEnd<::test_driverhandle::DriverProtocol>, |
| fidl::internal::NaturalCodingConstraintHandle< |
| ZX_OBJ_TYPE_CHANNEL, ZX_DEFAULT_CHANNEL_RIGHTS, false>>{ |
| &Storage_::value, 0}); |
| static constexpr auto kPadding = std::make_tuple(); |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| } // namespace test_driverhandle |
| namespace fidl { |
| |
| #ifdef __Fuchsia__ |
| |
| extern "C" const fidl_type_t |
| test_driverhandle_HandlesInProtocolSendHandlesRequestTable; |
| |
| template <> |
| struct IsResource<::test_driverhandle::HandlesInProtocolSendHandlesRequest> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlType<::test_driverhandle::HandlesInProtocolSendHandlesRequest> |
| : public std::true_type {}; |
| |
| template <> |
| struct ::fidl::internal::TypeTraits< |
| ::test_driverhandle::HandlesInProtocolSendHandlesRequest> |
| final { |
| public: |
| static constexpr const fidl_type_t* kCodingTable = |
| &test_driverhandle_HandlesInProtocolSendHandlesRequestTable; |
| }; |
| |
| template <> |
| struct internal::NaturalCodingTraits< |
| ::test_driverhandle::HandlesInProtocolSendHandlesRequest, |
| ::fidl::internal::NaturalCodingConstraintEmpty> |
| final : public ::fidl::internal::NaturalStructCodingTraits< |
| ::test_driverhandle::HandlesInProtocolSendHandlesRequest, 16> { |
| }; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| extern "C" const fidl_type_t test_driverhandle_ServerEndWrapperTable; |
| |
| template <> |
| struct IsResource<::test_driverhandle::ServerEndWrapper> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlType<::test_driverhandle::ServerEndWrapper> |
| : public std::true_type {}; |
| |
| template <> |
| struct ::fidl::internal::TypeTraits<::test_driverhandle::ServerEndWrapper> |
| final { |
| public: |
| static constexpr const fidl_type_t* kCodingTable = |
| &test_driverhandle_ServerEndWrapperTable; |
| }; |
| |
| template <> |
| struct internal::NaturalCodingTraits< |
| ::test_driverhandle::ServerEndWrapper, |
| ::fidl::internal::NaturalCodingConstraintEmpty> |
| final : public ::fidl::internal::NaturalStructCodingTraits< |
| ::test_driverhandle::ServerEndWrapper, 4> {}; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| extern "C" const fidl_type_t test_driverhandle_ClientEndWrapperTable; |
| |
| template <> |
| struct IsResource<::test_driverhandle::ClientEndWrapper> |
| : public std::true_type {}; |
| template <> |
| struct IsFidlType<::test_driverhandle::ClientEndWrapper> |
| : public std::true_type {}; |
| |
| template <> |
| struct ::fidl::internal::TypeTraits<::test_driverhandle::ClientEndWrapper> |
| final { |
| public: |
| static constexpr const fidl_type_t* kCodingTable = |
| &test_driverhandle_ClientEndWrapperTable; |
| }; |
| |
| template <> |
| struct internal::NaturalCodingTraits< |
| ::test_driverhandle::ClientEndWrapper, |
| ::fidl::internal::NaturalCodingConstraintEmpty> |
| final : public ::fidl::internal::NaturalStructCodingTraits< |
| ::test_driverhandle::ClientEndWrapper, 4> {}; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| extern "C" const fidl_type_t test_driverhandle_TTable; |
| |
| template <> |
| struct IsResource<::test_driverhandle::T> : public std::true_type {}; |
| template <> |
| struct IsFidlType<::test_driverhandle::T> : public std::true_type {}; |
| |
| template <> |
| struct ::fidl::internal::TypeTraits<::test_driverhandle::T> final { |
| public: |
| static constexpr const fidl_type_t* kCodingTable = &test_driverhandle_TTable; |
| }; |
| |
| template <> |
| struct internal::NaturalCodingTraits< |
| ::test_driverhandle::T, ::fidl::internal::NaturalCodingConstraintEmpty> |
| : public ::fidl::internal::NaturalTableCodingTraits< |
| ::test_driverhandle::T> {}; |
| |
| #endif // __Fuchsia__ |
| |
| } // namespace fidl |