| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #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__ |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace test_driverhandle { |
| |
| class ClientEndWrapper; |
| |
| class ServerEndWrapper; |
| |
| class HandlesInProtocolSendHandlesRequest; |
| |
| class T; |
| |
| #ifdef __Fuchsia__ |
| |
| class ClientEndWrapper { |
| private: |
| struct Storage_; |
| |
| public: |
| ClientEndWrapper(Storage_ storage) noexcept; |
| ClientEndWrapper(::fdf::ClientEnd<::test_driverhandle::DriverProtocol> value) noexcept; |
| |
| #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; |
| } |
| |
| // Setter for value. |
| // |
| |
| ClientEndWrapper& value(::fdf::ClientEnd<::test_driverhandle::DriverProtocol> value); |
| |
| ClientEndWrapper(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag); |
| |
| 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__ |
| |
| #ifdef __Fuchsia__ |
| |
| class ServerEndWrapper { |
| private: |
| struct Storage_; |
| |
| public: |
| ServerEndWrapper(Storage_ storage) noexcept; |
| ServerEndWrapper(::fdf::ServerEnd<::test_driverhandle::DriverProtocol> value) noexcept; |
| |
| #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; |
| } |
| |
| // Setter for value. |
| // |
| |
| ServerEndWrapper& value(::fdf::ServerEnd<::test_driverhandle::DriverProtocol> value); |
| |
| ServerEndWrapper(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag); |
| |
| 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__ |
| |
| class T { |
| private: |
| struct Storage_; |
| |
| public: |
| T(Storage_ storage) noexcept; |
| 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; } |
| |
| // Setter for zircon_handle. |
| // |
| |
| T& zircon_handle(std::optional<::zx::event> value); |
| |
| 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; } |
| |
| // Setter for fdf_handle. |
| // |
| |
| T& fdf_handle(std::optional<::fdf::ClientEnd<::test_driverhandle::DriverProtocol>> value); |
| |
| T(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag); |
| |
| private: |
| struct Storage_ final { |
| ::std::optional<::zx::event> zircon_handle; |
| ::std::optional<::fdf::ClientEnd<::test_driverhandle::DriverProtocol>> fdf_handle; |
| }; |
| |
| // TODO(https://fxbug.dev/42172795): 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__ |
| |
| class HandlesInProtocolSendHandlesRequest { |
| private: |
| struct Storage_; |
| |
| public: |
| HandlesInProtocolSendHandlesRequest(Storage_ storage) noexcept; |
| HandlesInProtocolSendHandlesRequest(::test_driverhandle::T t) noexcept; |
| |
| #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; |
| } |
| |
| // Setter for t. |
| // |
| |
| HandlesInProtocolSendHandlesRequest& t(::test_driverhandle::T value); |
| |
| HandlesInProtocolSendHandlesRequest(::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__ |
| |
| inline ClientEndWrapper::ClientEndWrapper(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| inline ClientEndWrapper::ClientEndWrapper(::fdf::ClientEnd<::test_driverhandle::DriverProtocol> value) noexcept |
| : storage_({.value = std::move(value)}) {} |
| |
| inline ClientEndWrapper::ClientEndWrapper(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) : ClientEndWrapper(Storage_{ |
| .value = {}, |
| }) {} |
| inline ClientEndWrapper& ClientEndWrapper::value(::fdf::ClientEnd<::test_driverhandle::DriverProtocol> value) { |
| storage_.value = std::move(value); |
| return *this; |
| } |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| inline ServerEndWrapper::ServerEndWrapper(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| inline ServerEndWrapper::ServerEndWrapper(::fdf::ServerEnd<::test_driverhandle::DriverProtocol> value) noexcept |
| : storage_({.value = std::move(value)}) {} |
| |
| inline ServerEndWrapper::ServerEndWrapper(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) : ServerEndWrapper(Storage_{ |
| .value = {}, |
| }) {} |
| inline ServerEndWrapper& ServerEndWrapper::value(::fdf::ServerEnd<::test_driverhandle::DriverProtocol> value) { |
| storage_.value = std::move(value); |
| return *this; |
| } |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| inline T::T(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| |
| inline T::T(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) : T(Storage_{}) {} |
| inline T& T::zircon_handle(std::optional<::zx::event> value) { |
| storage_.zircon_handle = std::move(value); |
| return *this; |
| } |
| inline T& T::fdf_handle(std::optional<::fdf::ClientEnd<::test_driverhandle::DriverProtocol>> value) { |
| storage_.fdf_handle = std::move(value); |
| return *this; |
| } |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| inline HandlesInProtocolSendHandlesRequest::HandlesInProtocolSendHandlesRequest(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| inline HandlesInProtocolSendHandlesRequest::HandlesInProtocolSendHandlesRequest(::test_driverhandle::T t) noexcept |
| : storage_({.t = std::move(t)}) {} |
| |
| inline HandlesInProtocolSendHandlesRequest::HandlesInProtocolSendHandlesRequest(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) : HandlesInProtocolSendHandlesRequest(Storage_{ |
| .t = ::fidl::internal::DefaultConstructPossiblyInvalidObjectTag{}, |
| }) {} |
| inline HandlesInProtocolSendHandlesRequest& HandlesInProtocolSendHandlesRequest::t(::test_driverhandle::T value) { |
| storage_.t = std::move(value); |
| return *this; |
| } |
| |
| #endif // __Fuchsia__ |
| |
| } // namespace test_driverhandle |
| namespace fidl { |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct IsResource<::test_driverhandle::ClientEndWrapper> : public std::true_type {}; |
| template <> |
| struct IsFidlType<::test_driverhandle::ClientEndWrapper> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::test_driverhandle::ClientEndWrapper> { |
| static constexpr uint32_t kMaxNumHandles = 1; |
| static constexpr uint32_t kMaxDepth = 0; |
| static constexpr uint32_t kPrimarySize = 4; |
| static constexpr uint32_t kMaxOutOfLine = 0; |
| static constexpr bool kHasPointer = false; |
| }; |
| |
| template <> |
| struct IsStruct<::test_driverhandle::ClientEndWrapper> : public std::true_type {}; |
| |
| template <> |
| struct internal::NaturalCodingTraits<::test_driverhandle::ClientEndWrapper, ::fidl::internal::NaturalCodingConstraintEmpty> final |
| : public ::fidl::internal::NaturalStructCodingTraits<::test_driverhandle::ClientEndWrapper, 4> {}; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct IsResource<::test_driverhandle::ServerEndWrapper> : public std::true_type {}; |
| template <> |
| struct IsFidlType<::test_driverhandle::ServerEndWrapper> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::test_driverhandle::ServerEndWrapper> { |
| static constexpr uint32_t kMaxNumHandles = 1; |
| static constexpr uint32_t kMaxDepth = 0; |
| static constexpr uint32_t kPrimarySize = 4; |
| static constexpr uint32_t kMaxOutOfLine = 0; |
| static constexpr bool kHasPointer = false; |
| }; |
| |
| template <> |
| struct IsStruct<::test_driverhandle::ServerEndWrapper> : public std::true_type {}; |
| |
| template <> |
| struct internal::NaturalCodingTraits<::test_driverhandle::ServerEndWrapper, ::fidl::internal::NaturalCodingConstraintEmpty> final |
| : public ::fidl::internal::NaturalStructCodingTraits<::test_driverhandle::ServerEndWrapper, 4> {}; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct IsResource<::test_driverhandle::HandlesInProtocolSendHandlesRequest> : public std::true_type {}; |
| template <> |
| struct IsFidlType<::test_driverhandle::HandlesInProtocolSendHandlesRequest> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::test_driverhandle::HandlesInProtocolSendHandlesRequest> { |
| static constexpr uint32_t kMaxNumHandles = 2; |
| static constexpr uint32_t kMaxDepth = 2; |
| static constexpr uint32_t kPrimarySize = 16; |
| static constexpr uint32_t kMaxOutOfLine = 16; |
| static constexpr bool kHasPointer = true; |
| }; |
| |
| template <> |
| struct IsStruct<::test_driverhandle::HandlesInProtocolSendHandlesRequest> : public std::true_type {}; |
| |
| template <> |
| struct internal::NaturalCodingTraits<::test_driverhandle::HandlesInProtocolSendHandlesRequest, ::fidl::internal::NaturalCodingConstraintEmpty> final |
| : public ::fidl::internal::NaturalStructCodingTraits<::test_driverhandle::HandlesInProtocolSendHandlesRequest, 16> {}; |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| template <> |
| struct IsResource<::test_driverhandle::T> : public std::true_type {}; |
| template <> |
| struct IsFidlType<::test_driverhandle::T> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::test_driverhandle::T> { |
| static constexpr uint32_t kMaxNumHandles = 2; |
| static constexpr uint32_t kMaxDepth = 2; |
| static constexpr uint32_t kPrimarySize = 16; |
| static constexpr uint32_t kMaxOutOfLine = 16; |
| static constexpr bool kHasPointer = true; |
| }; |
| |
| template <> |
| struct IsTable<::test_driverhandle::T> : public std::true_type {}; |
| |
| template <> |
| struct internal::NaturalCodingTraits<::test_driverhandle::T, ::fidl::internal::NaturalCodingConstraintEmpty> : public ::fidl::internal::NaturalTableCodingTraits<::test_driverhandle::T> {}; |
| |
| #endif // __Fuchsia__ |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace fidl |