| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #pragma once |
| |
| #include <fidl/test.drivertwoway/cpp/common_types.h> |
| #include <fidl/test.drivertwoway/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> |
| |
| #endif // __Fuchsia__ |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace test_drivertwoway { |
| |
| class TwoWayAddRequest; |
| |
| class TwoWayAddResponse; |
| |
| class TwoWayAddRequest { |
| private: |
| struct Storage_; |
| |
| public: |
| TwoWayAddRequest(Storage_ storage) noexcept; |
| TwoWayAddRequest(uint16_t addend1, uint16_t addend2) noexcept; |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wdefaulted-function-deleted" |
| // Default constructs a |TwoWayAddRequest| only if all of its members are default constructible. |
| TwoWayAddRequest() = default; |
| #pragma clang diagnostic pop |
| |
| TwoWayAddRequest(TwoWayAddRequest&&) noexcept = default; |
| TwoWayAddRequest& operator=(TwoWayAddRequest&&) noexcept = default; |
| TwoWayAddRequest(const TwoWayAddRequest& other) noexcept; |
| TwoWayAddRequest& operator=(const TwoWayAddRequest& other) noexcept; |
| |
| bool operator==(const TwoWayAddRequest& other) const noexcept { |
| return ::fidl::internal::NaturalStructCodingTraits<::test_drivertwoway::TwoWayAddRequest, 4>::Equal(this, &other); |
| } |
| bool operator!=(const TwoWayAddRequest& other) const noexcept { |
| return !::fidl::internal::NaturalStructCodingTraits<::test_drivertwoway::TwoWayAddRequest, 4>::Equal(this, &other); |
| } |
| |
| uint16_t |
| addend1() const { |
| return storage_.addend1; |
| } |
| |
| uint16_t& addend1() { |
| return storage_.addend1; |
| } |
| |
| // Setter for addend1. |
| // |
| |
| TwoWayAddRequest& addend1(uint16_t value); |
| |
| uint16_t |
| addend2() const { |
| return storage_.addend2; |
| } |
| |
| uint16_t& addend2() { |
| return storage_.addend2; |
| } |
| |
| // Setter for addend2. |
| // |
| |
| TwoWayAddRequest& addend2(uint16_t value); |
| |
| TwoWayAddRequest(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag); |
| |
| private: |
| struct Storage_ final { |
| uint16_t addend1 = {}; |
| uint16_t addend2 = {}; |
| }; |
| |
| Storage_ storage_; |
| Storage_ CloneStorage_() const; |
| |
| friend struct ::fidl::internal::NaturalStructCodingTraits<::test_drivertwoway::TwoWayAddRequest, 4>; |
| friend struct ::fidl::internal::MemberVisitor<::test_drivertwoway::TwoWayAddRequest>; |
| static constexpr auto kMembers = std::make_tuple(::fidl::internal::NaturalStructMember<Storage_, uint16_t, fidl::internal::NaturalCodingConstraintEmpty>{ |
| &Storage_::addend1, 0}, |
| ::fidl::internal::NaturalStructMember<Storage_, uint16_t, fidl::internal::NaturalCodingConstraintEmpty>{&Storage_::addend2, 2}); |
| static constexpr auto kPadding = std::make_tuple(); |
| }; |
| |
| class TwoWayAddResponse { |
| private: |
| struct Storage_; |
| |
| public: |
| TwoWayAddResponse(Storage_ storage) noexcept; |
| TwoWayAddResponse(uint16_t sum) noexcept; |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wdefaulted-function-deleted" |
| // Default constructs a |TwoWayAddResponse| only if all of its members are default constructible. |
| TwoWayAddResponse() = default; |
| #pragma clang diagnostic pop |
| |
| TwoWayAddResponse(TwoWayAddResponse&&) noexcept = default; |
| TwoWayAddResponse& operator=(TwoWayAddResponse&&) noexcept = default; |
| TwoWayAddResponse(const TwoWayAddResponse& other) noexcept; |
| TwoWayAddResponse& operator=(const TwoWayAddResponse& other) noexcept; |
| |
| bool operator==(const TwoWayAddResponse& other) const noexcept { |
| return ::fidl::internal::NaturalStructCodingTraits<::test_drivertwoway::TwoWayAddResponse, 2>::Equal(this, &other); |
| } |
| bool operator!=(const TwoWayAddResponse& other) const noexcept { |
| return !::fidl::internal::NaturalStructCodingTraits<::test_drivertwoway::TwoWayAddResponse, 2>::Equal(this, &other); |
| } |
| |
| uint16_t |
| sum() const { |
| return storage_.sum; |
| } |
| |
| uint16_t& sum() { |
| return storage_.sum; |
| } |
| |
| // Setter for sum. |
| // |
| |
| TwoWayAddResponse& sum(uint16_t value); |
| |
| TwoWayAddResponse(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag); |
| |
| private: |
| struct Storage_ final { |
| uint16_t sum = {}; |
| }; |
| |
| Storage_ storage_; |
| Storage_ CloneStorage_() const; |
| |
| friend struct ::fidl::internal::NaturalStructCodingTraits<::test_drivertwoway::TwoWayAddResponse, 2>; |
| friend struct ::fidl::internal::MemberVisitor<::test_drivertwoway::TwoWayAddResponse>; |
| static constexpr auto kMembers = std::make_tuple(::fidl::internal::NaturalStructMember<Storage_, uint16_t, fidl::internal::NaturalCodingConstraintEmpty>{ |
| &Storage_::sum, 0}); |
| static constexpr auto kPadding = std::make_tuple(); |
| }; |
| |
| inline TwoWayAddRequest::TwoWayAddRequest(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| inline TwoWayAddRequest::TwoWayAddRequest(uint16_t addend1, uint16_t addend2) noexcept |
| : storage_({.addend1 = std::move(addend1), |
| .addend2 = std::move(addend2)}) {} |
| inline TwoWayAddRequest::TwoWayAddRequest(const ::test_drivertwoway::TwoWayAddRequest& other) noexcept : ::test_drivertwoway::TwoWayAddRequest(other.CloneStorage_()) {} |
| inline TwoWayAddRequest& ::test_drivertwoway::TwoWayAddRequest::operator=(const ::test_drivertwoway::TwoWayAddRequest & other) noexcept { |
| storage_ = other.CloneStorage_(); |
| return *this; |
| } |
| |
| inline TwoWayAddRequest::TwoWayAddRequest(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) : TwoWayAddRequest(Storage_{ |
| .addend1 = {}, |
| .addend2 = {}, |
| }) {} |
| inline TwoWayAddRequest& TwoWayAddRequest::addend1(uint16_t value) { |
| storage_.addend1 = std::move(value); |
| return *this; |
| } |
| inline TwoWayAddRequest& TwoWayAddRequest::addend2(uint16_t value) { |
| storage_.addend2 = std::move(value); |
| return *this; |
| } |
| |
| inline TwoWayAddResponse::TwoWayAddResponse(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| inline TwoWayAddResponse::TwoWayAddResponse(uint16_t sum) noexcept |
| : storage_({.sum = std::move(sum)}) {} |
| inline TwoWayAddResponse::TwoWayAddResponse(const ::test_drivertwoway::TwoWayAddResponse& other) noexcept : ::test_drivertwoway::TwoWayAddResponse(other.CloneStorage_()) {} |
| inline TwoWayAddResponse& ::test_drivertwoway::TwoWayAddResponse::operator=(const ::test_drivertwoway::TwoWayAddResponse & other) noexcept { |
| storage_ = other.CloneStorage_(); |
| return *this; |
| } |
| |
| inline TwoWayAddResponse::TwoWayAddResponse(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) : TwoWayAddResponse(Storage_{ |
| .sum = {}, |
| }) {} |
| inline TwoWayAddResponse& TwoWayAddResponse::sum(uint16_t value) { |
| storage_.sum = std::move(value); |
| return *this; |
| } |
| |
| } // namespace test_drivertwoway |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::test_drivertwoway::TwoWayAddRequest> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::test_drivertwoway::TwoWayAddRequest> { |
| static constexpr uint32_t kMaxNumHandles = 0; |
| 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_drivertwoway::TwoWayAddRequest> : public std::true_type {}; |
| |
| template <> |
| struct internal::NaturalCodingTraits<::test_drivertwoway::TwoWayAddRequest, ::fidl::internal::NaturalCodingConstraintEmpty> final |
| : public ::fidl::internal::NaturalStructCodingTraits<::test_drivertwoway::TwoWayAddRequest, 4> {}; |
| |
| template <> |
| struct IsFidlType<::test_drivertwoway::TwoWayAddResponse> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::test_drivertwoway::TwoWayAddResponse> { |
| static constexpr uint32_t kMaxNumHandles = 0; |
| static constexpr uint32_t kMaxDepth = 0; |
| static constexpr uint32_t kPrimarySize = 2; |
| static constexpr uint32_t kMaxOutOfLine = 0; |
| static constexpr bool kHasPointer = false; |
| }; |
| |
| template <> |
| struct IsStruct<::test_drivertwoway::TwoWayAddResponse> : public std::true_type {}; |
| |
| template <> |
| struct internal::NaturalCodingTraits<::test_drivertwoway::TwoWayAddResponse, ::fidl::internal::NaturalCodingConstraintEmpty> final |
| : public ::fidl::internal::NaturalStructCodingTraits<::test_drivertwoway::TwoWayAddResponse, 2> {}; |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace fidl |